aboutsummaryrefslogtreecommitdiff
path: root/src/fields
diff options
context:
space:
mode:
Diffstat (limited to 'src/fields')
-rw-r--r--src/fields/Doc.ts3
-rw-r--r--src/fields/util.ts6
2 files changed, 6 insertions, 3 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index 4512d5c5b..5028e1f8f 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -116,7 +116,9 @@ export type FieldResult<T extends FieldType = FieldType> = Opt<T> | FieldWaiting
* If no default value is given, and the returned value is not undefined, it can be safely modified.
*/
export function DocListCastAsync(field: FieldResult): Promise<Doc[] | undefined>;
+// eslint-disable-next-line no-redeclare
export function DocListCastAsync(field: FieldResult, defaultValue: Doc[]): Promise<Doc[]>;
+// eslint-disable-next-line no-redeclare
export function DocListCastAsync(field: FieldResult, defaultValue?: Doc[]) {
const list = Cast(field, listSpec(Doc));
return list ? Promise.all(list).then(() => list) : Promise.resolve(defaultValue);
@@ -416,6 +418,7 @@ export class Doc extends RefField {
}
}
+// eslint-disable-next-line no-redeclare
export namespace Doc {
export function SetContainer(doc: Doc, container: Doc) {
if (container !== Doc.MyRecentlyClosed) {
diff --git a/src/fields/util.ts b/src/fields/util.ts
index d7268f31a..72b0ef721 100644
--- a/src/fields/util.ts
+++ b/src/fields/util.ts
@@ -285,10 +285,10 @@ export function inheritParentAcls(parent: Doc, child: Doc, layoutOnly: boolean)
* sets a callback function to be called whenever a value is assigned to the specified field key.
* For example, this is used to "publish" documents with titles that start with '@'
* @param prop
- * @param setter
+ * @param propSetter
*/
-export function SetPropSetterCb(prop: string, setter: ((target: any, value: any) => void) | undefined) {
- _propSetterCB.set(prop, setter);
+export function SetPropSetterCb(prop: string, propSetter: ((target: any, value: any) => void) | undefined) {
+ _propSetterCB.set(prop, propSetter);
}
//