From d818ef151ca65008e5c6bb5e92b709decb3026d8 Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 14 Apr 2025 18:35:49 -0400 Subject: fixed how templates are expanded to avoid template sub-component conflicts by changing how field keys are named. fixed various Cast functions to be more typesafe by including undefined as part of return type. overhaul of Doc.MakeClone, MakeCopy, FindRefernces - makeClone is no longer async. fixed inlined docs in text docs. --- src/fields/List.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/fields/List.ts') 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 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 extends ObjectField { // declare List as a type so you can use it in type declarations, e.g., { l: List, ...} export type List = ListImpl & (T | (T extends RefField ? Promise : never))[]; -// decalre List as a value so you can invoke 'new' on it, e.g., new List() (since List IS ListImpl, we can safely cast the 'new' return value to return List) -// eslint-disable-next-line no-redeclare +// declare List as a value so you can invoke 'new' on it, e.g., new List() (since List IS ListImpl, we can safely cast the 'new' return value to return List) +// eslint-disable-next-line no-use-before-define export const List: { new (fields?: T[]): List } = ListImpl as unknown as { new (fields?: T[]): List }; ScriptingGlobals.add('List', List); -- cgit v1.2.3-70-g09d2