type tweak

This commit is contained in:
Alexander Rose
2026-05-09 15:43:04 -07:00
parent 57a790544c
commit 40b6038380

View File

@@ -296,9 +296,9 @@ export namespace ParamDefinition {
element: Params,
ctor(): T,
getLabel(t: T): string,
presets?: Select<T[]>['options']
presets?: SelectOption<T[]>
}
export function ObjectList<T>(element: For<T>, getLabel: (e: T) => string, info?: Info & { defaultValue?: T[], ctor?: () => T, presets?: Select<T[]>['options'] }): ObjectList<Normalize<T>> {
export function ObjectList<T>(element: For<T>, getLabel: (e: T) => string, info?: Info & { defaultValue?: T[], ctor?: () => T, presets?: SelectOption<T[]> }): ObjectList<Normalize<T>> {
const ret = setInfo<ObjectList<Normalize<T>>>({ type: 'object-list', element: element as any as Params, getLabel, ctor: _defaultObjectListCtor, defaultValue: (info?.defaultValue) || [] }, info);
if (info?.presets) ret.presets = info.presets as any;
return ret;