diff options
author | Joanne <zehan_ding@brown.edu> | 2025-05-12 20:58:01 -0400 |
---|---|---|
committer | Joanne <zehan_ding@brown.edu> | 2025-05-12 20:58:01 -0400 |
commit | cd93c88b8fee83a99342eac4dc60f7b4373fa843 (patch) | |
tree | b00d1f46c802752c90e54bb21be785a05e05195e /src/fields/List.ts | |
parent | 4997c3de20a381eac30224a7a550afa66174f07d (diff) | |
parent | 3a733aa0fd24517e83649824dec0fc8bcc0bde43 (diff) |
added tutorial tool, still need to integrate with metadatatool
Diffstat (limited to 'src/fields/List.ts')
-rw-r--r-- | src/fields/List.ts | 6 |
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); |