aboutsummaryrefslogtreecommitdiff
path: root/src/fields/List.ts
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2025-05-30 03:30:12 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2025-05-30 03:30:12 -0400
commit29e5bbe68e02fe1d86e960a634d0580c37612254 (patch)
treee88585946a58feb988e3a3bb45dd2a9a09fea4c3 /src/fields/List.ts
parentf92a02ec5d676359cb268a35d30e5bf9886199c1 (diff)
parent49fb76f1c54fb8fc4e76bdcf675719d41bfc36aa (diff)
Merge branch 'master' into Template-Changes
Diffstat (limited to 'src/fields/List.ts')
-rw-r--r--src/fields/List.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fields/List.ts b/src/fields/List.ts
index 22bbcb9ab..ba03c0d38 100644
--- a/src/fields/List.ts
+++ b/src/fields/List.ts
@@ -255,7 +255,7 @@ export class ListImpl<T extends FieldType> extends ObjectField {
if (fields) {
this[SelfProxy].push(...fields);
}
- // eslint-disable-next-line no-constructor-return
+
return list; // need to return the proxy here, otherwise we don't get any of our list handler functions
}
@@ -317,8 +317,8 @@ export class ListImpl<T extends FieldType> extends ObjectField {
// declare List as a type so you can use it in type declarations, e.g., { l: List, ...}
export type List<T extends FieldType> = ListImpl<T> & (T | (T extends RefField ? Promise<T> : never))[];
-// decalre List as a value so you can invoke 'new' on it, e.g., new List<Doc>() (since List<T> IS ListImpl<T>, we can safely cast the 'new' return value to return List<T>)
-// eslint-disable-next-line no-redeclare
+// declare List as a value so you can invoke 'new' on it, e.g., new List<Doc>() (since List<T> IS ListImpl<T>, we can safely cast the 'new' return value to return List<T>)
+// eslint-disable-next-line no-use-before-define
export const List: { new <T extends FieldType>(fields?: T[]): List<T> } = ListImpl as unknown as { new <T extends FieldType>(fields?: T[]): List<T> };
ScriptingGlobals.add('List', List);