@start9labs/start-sdk 0.4.0-beta.31 → 0.4.0-beta.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,8 +7,8 @@ export type LazyBuildOptions = {
7
7
  effects: Effects;
8
8
  };
9
9
  export type LazyBuild<ExpectedOut> = (options: LazyBuildOptions) => Promise<ExpectedOut> | ExpectedOut;
10
- export type ExtractInputSpecType<A extends InputSpec<Record<string, any>>> = A extends InputSpec<infer B> ? B : never;
11
- export type ExtractPartialInputSpecType<A extends Record<string, any> | InputSpec<Record<string, any>>> = A extends InputSpec<infer B> ? DeepPartial<B> : DeepPartial<A>;
10
+ export type ExtractInputSpecType<A extends InputSpec<Record<string, any>, any>> = A extends InputSpec<infer B, any> ? B : never;
11
+ export type ExtractInputSpecStaticValidatedAs<A extends InputSpec<any, Record<string, any>>> = A extends InputSpec<any, infer B> ? B : never;
12
12
  export type InputSpecOf<A extends Record<string, any>> = {
13
13
  [K in keyof A]: Value<A[K]>;
14
14
  };
@@ -69,8 +69,9 @@ export const addNodesSpec = InputSpec.of({ hostname: hostname, port: port });
69
69
 
70
70
  ```
71
71
  */
72
- export declare class InputSpec<Type extends Record<string, any>> {
72
+ export declare class InputSpec<Type extends StaticValidatedAs, StaticValidatedAs extends Record<string, any> = Type> {
73
73
  private readonly spec;
74
+ readonly validator: Parser<unknown, StaticValidatedAs>;
74
75
  private constructor();
75
76
  _TYPE: Type;
76
77
  _PARTIAL: DeepPartial<Type>;
@@ -80,5 +81,5 @@ export declare class InputSpec<Type extends Record<string, any>> {
80
81
  };
81
82
  validator: Parser<unknown, Type>;
82
83
  }>;
83
- static of<Spec extends Record<string, Value<any>>>(spec: Spec): InputSpec<{ [K in keyof Spec]: Spec[K] extends Value<infer T> ? T : never; }>;
84
+ static of<Spec extends Record<string, Value<any, any>>>(spec: Spec): InputSpec<{ [K in keyof Spec]: Spec[K] extends Value<infer T extends any, any> ? T : never; }, { [K_1 in keyof Spec]: Spec[K_1] extends Value<any, infer T_1> ? T_1 : never; }>;
84
85
  }
@@ -59,8 +59,9 @@ export const addNodesSpec = InputSpec.of({ hostname: hostname, port: port });
59
59
  ```
60
60
  */
61
61
  class InputSpec {
62
- constructor(spec) {
62
+ constructor(spec, validator) {
63
63
  this.spec = spec;
64
+ this.validator = validator;
64
65
  this._TYPE = null;
65
66
  this._PARTIAL = null;
66
67
  }
@@ -78,7 +79,8 @@ class InputSpec {
78
79
  };
79
80
  }
80
81
  static of(spec) {
81
- return new InputSpec(spec);
82
+ const validator = (0, ts_matches_1.object)(Object.fromEntries(Object.entries(spec).map(([k, v]) => [k, v.validator])));
83
+ return new InputSpec(spec, validator);
82
84
  }
83
85
  }
84
86
  exports.InputSpec = InputSpec;
@@ -1 +1 @@
1
- {"version":3,"file":"inputSpec.js","sourceRoot":"","sources":["../../../../../../base/lib/actions/input/builder/inputSpec.ts"],"names":[],"mappings":";;;AAIA,2CAA2C;AAwB3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,MAAa,SAAS;IACpB,YACmB,IAEhB;QAFgB,SAAI,GAAJ,IAAI,CAEpB;QAEI,UAAK,GAAS,IAAmB,CAAA;QACjC,aAAQ,GAAsB,IAAgC,CAAA;IAFlE,CAAC;IAGJ,KAAK,CAAC,KAAK,CAAC,OAAyB;QAMnC,MAAM,MAAM,GAAG,EAEd,CAAA;QACD,MAAM,SAAS,GAAG,EAEjB,CAAA;QACD,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YAC1B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAc,CAAC,CAAA;YACtD,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAA;YACtB,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,SAAS,CAAA;QAChC,CAAC;Q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,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CACvD,CACF,CAAA;QACD,OAAO,IAAI,SAAS,CAOlB,IAAI,EAAE,SAAgB,CAAC,CAAA;IAC3B,CAAC;CACF;AAlDD,8BAkDC"}
@@ -1,11 +1,12 @@
1
1
  import { InputSpec, LazyBuild } from "./inputSpec";
2
2
  import { ListValueSpecText, Pattern, RandomString, UniqueBy, ValueSpecList } from "../inputSpecTypes";
3
3
  import { Parser } from "ts-matches";
4
- export declare class List<Type> {
4
+ export declare class List<Type extends StaticValidatedAs, StaticValidatedAs = Type> {
5
5
  build: LazyBuild<{
6
6
  spec: ValueSpecList;
7
7
  validator: Parser<unknown, Type>;
8
8
  }>;
9
+ readonly validator: Parser<unknown, StaticValidatedAs>;
9
10
  private constructor();
10
11
  readonly _TYPE: Type;
11
12
  static text(a: {
@@ -47,7 +48,7 @@ export declare class List<Type> {
47
48
  * @description Displays a button that will generate a random string according to the provided charset and len attributes.
48
49
  */
49
50
  generate?: null | RandomString;
50
- }): List<string[]>;
51
+ }): List<string[], string[]>;
51
52
  static dynamicText(getA: LazyBuild<{
52
53
  name: string;
53
54
  description?: string | null;
@@ -65,8 +66,8 @@ export declare class List<Type> {
65
66
  patterns?: Pattern[];
66
67
  inputmode?: ListValueSpecText["inputmode"];
67
68
  };
68
- }>): List<string[]>;
69
- static obj<Type extends Record<string, any>>(a: {
69
+ }>): List<string[], string[]>;
70
+ static obj<Type extends StaticValidatedAs, StaticValidatedAs extends Record<string, any>>(a: {
70
71
  name: string;
71
72
  description?: string | null;
72
73
  warning?: string | null;
@@ -74,8 +75,8 @@ export declare class List<Type> {
74
75
  minLength?: number | null;
75
76
  maxLength?: number | null;
76
77
  }, aSpec: {
77
- spec: InputSpec<Type>;
78
+ spec: InputSpec<Type, StaticValidatedAs>;
78
79
  displayAs?: null | string;
79
80
  uniqueBy?: null | UniqueBy;
80
- }): List<Type[]>;
81
+ }): List<Type[], StaticValidatedAs[]>;
81
82
  }
@@ -3,11 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.List = void 0;
4
4
  const ts_matches_1 = require("ts-matches");
5
5
  class List {
6
- constructor(build) {
6
+ constructor(build, validator) {
7
7
  this.build = build;
8
+ this.validator = validator;
8
9
  this._TYPE = null;
9
10
  }
10
11
  static text(a, aSpec) {
12
+ const validator = (0, ts_matches_1.arrayOf)(ts_matches_1.string);
11
13
  return new List(() => {
12
14
  const spec = {
13
15
  type: "text",
@@ -31,10 +33,11 @@ class List {
31
33
  ...a,
32
34
  spec,
33
35
  };
34
- return { spec: built, validator: (0, ts_matches_1.arrayOf)(ts_matches_1.string) };
35
- });
36
+ return { spec: built, validator };
37
+ }, validator);
36
38
  }
37
39
  static dynamicText(getA) {
40
+ const validator = (0, ts_matches_1.arrayOf)(ts_matches_1.string);
38
41
  return new List(async (options) => {
39
42
  const { spec: aSpec, ...a } = await getA(options);
40
43
  const spec = {
@@ -59,8 +62,8 @@ class List {
59
62
  ...a,
60
63
  spec,
61
64
  };
62
- return { spec: built, validator: (0, ts_matches_1.arrayOf)(ts_matches_1.string) };
63
- });
65
+ return { spec: built, validator };
66
+ }, validator);
64
67
  }
65
68
  static obj(a, aSpec) {
66
69
  return new List(async (options) => {
@@ -90,7 +93,7 @@ class List {
90
93
  },
91
94
  validator: (0, ts_matches_1.arrayOf)(built.validator),
92
95
  };
93
- });
96
+ }, (0, ts_matches_1.arrayOf)(aSpec.spec.validator));
94
97
  }
95
98
  }
96
99
  exports.List = List;
@@ -1 +1 @@
1
- {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../../base/lib/actions/input/builder/list.ts"],"names":[],"mappings":";;;AASA,2CAAoD;AAEpD,MAAa,IAAI;IACf,YACS,KAGL;QAHK,UAAK,GAAL,KAAK,CAGV;QAEK,UAAK,GAAS,IAAW,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}
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../../base/lib/actions/input/builder/list.ts"],"names":[],"mappings":";;;AASA,2CAAoD;AAEpD,MAAa,IAAI;IACf,YACS,KAGL,EACc,SAA6C;QAJtD,UAAK,GAAL,KAAK,CAGV;QACc,cAAS,GAAT,SAAS,CAAoC;QAEtD,UAAK,GAAS,IAAW,CAAA;IAD/B,CAAC;IAGJ,MAAM,CAAC,IAAI,CACT,CAOC,EACD,KAgCC;QAED,MAAM,SAAS,GAAG,IAAA,oBAAO,EAAC,mBAAM,CAAC,CAAA;QACjC,OAAO,IAAI,IAAI,CAAW,GAAG,EAAE;YAC7B,MAAM,IAAI,GAAG;gBACX,IAAI,EAAE,MAAe;gBACrB,WAAW,EAAE,IAAI;gBACjB,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,IAAI;gBACf,MAAM,EAAE,KAAK;gBACb,SAAS,EAAE,MAAe;gBAC1B,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,EAAE;gBAC9B,GAAG,KAAK;aACT,CAAA;YACD,MAAM,KAAK,GAA4B;gBACrC,WAAW,EAAE,IAAI;gBACjB,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,EAAE;gBACX,IAAI,EAAE,MAAe;gBACrB,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,IAAI;gBACf,QAAQ,EAAE,KAAK;gBACf,GAAG,CAAC;gBACJ,IAAI;aACL,CAAA;YACD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAA;QACnC,CAAC,EAAE,SAAS,CAAC,CAAA;IACf,CAAC;IAED,MAAM,CAAC,WAAW,CAChB,IAiBE;QAEF,MAAM,SAAS,GAAG,IAAA,oBAAO,EAAC,mBAAM,CAAC,CAAA;QACjC,OAAO,IAAI,IAAI,CAAW,KAAK,EAAE,OAAO,EAAE,EAAE;YAC1C,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,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AE;oBACJ,WAAW,EAAE,IAAI;oBACjB,OAAO,EAAE,IAAI;oBACb,SAAS,EAAE,IAAI;oBACf,SAAS,EAAE,IAAI;oBACf,IAAI,EAAE,MAAe;oBACrB,QAAQ,EAAE,KAAK;oBACf,GAAG,KAAK;iBACT;gBACD,SAAS,EAAE,IAAA,oBAAO,EAAC,KAAK,CAAC,SAAS,CAAC;aACpC,CAAA;QACH,CAAC,EAAE,IAAA,oBAAO,EAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAA;IACnC,CAAC;CACF;AAlLD,oBAkLC"}
@@ -1,20 +1,21 @@
1
1
  import { InputSpec, LazyBuild } from "./inputSpec";
2
2
  import { List } from "./list";
3
- import { UnionRes, Variants } from "./variants";
3
+ import { UnionRes, UnionResStaticValidatedAs, Variants } from "./variants";
4
4
  import { Pattern, RandomString, ValueSpec, ValueSpecDatetime, ValueSpecText } from "../inputSpecTypes";
5
5
  import { DefaultString } from "../inputSpecTypes";
6
6
  import { Parser } from "ts-matches";
7
7
  import { DeepPartial } from "../../../types";
8
8
  type AsRequired<T, Required extends boolean> = Required extends true ? T : T | null;
9
- export declare class Value<Type> {
9
+ export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = Type> {
10
10
  build: LazyBuild<{
11
11
  spec: ValueSpec;
12
12
  validator: Parser<unknown, Type>;
13
13
  }>;
14
+ readonly validator: Parser<unknown, StaticValidatedAs>;
14
15
  protected constructor(build: LazyBuild<{
15
16
  spec: ValueSpec;
16
17
  validator: Parser<unknown, Type>;
17
- }>);
18
+ }>, validator: Parser<unknown, StaticValidatedAs>);
18
19
  _TYPE: Type;
19
20
  _PARTIAL: DeepPartial<Type>;
20
21
  /**
@@ -44,14 +45,14 @@ export declare class Value<Type> {
44
45
  * @default false
45
46
  */
46
47
  immutable?: boolean;
47
- }): Value<boolean>;
48
+ }): Value<boolean, boolean>;
48
49
  static dynamicToggle(a: LazyBuild<{
49
50
  name: string;
50
51
  description?: string | null;
51
52
  warning?: string | null;
52
53
  default: boolean;
53
54
  disabled?: false | string;
54
- }>): Value<boolean>;
55
+ }>): Value<boolean, boolean>;
55
56
  /**
56
57
  * @description Displays a text input field
57
58
  * @example
@@ -126,7 +127,7 @@ export declare class Value<Type> {
126
127
  * @description Displays a button that will generate a random string according to the provided charset and len attributes.
127
128
  */
128
129
  generate?: RandomString | null;
129
- }): Value<AsRequired<string, Required>>;
130
+ }): Value<AsRequired<string, Required>, AsRequired<string, Required>>;
130
131
  static dynamicText<Required extends boolean>(getA: LazyBuild<{
131
132
  name: string;
132
133
  description?: string | null;
@@ -141,7 +142,7 @@ export declare class Value<Type> {
141
142
  inputmode?: ValueSpecText["inputmode"];
142
143
  disabled?: string | false;
143
144
  generate?: null | RandomString;
144
- }>): Value<AsRequired<string, Required>>;
145
+ }>): Value<AsRequired<string, Required>, string | null>;
145
146
  /**
146
147
  * @description Displays a large textarea field for long form entry.
147
148
  * @example
@@ -177,7 +178,7 @@ export declare class Value<Type> {
177
178
  * @default false
178
179
  */
179
180
  immutable?: boolean;
180
- }): Value<AsRequired<string, Required>>;
181
+ }): Value<AsRequired<string, Required>, AsRequired<string, Required>>;
181
182
  static dynamicTextarea<Required extends boolean>(getA: LazyBuild<{
182
183
  name: string;
183
184
  description?: string | null;
@@ -188,7 +189,7 @@ export declare class Value<Type> {
188
189
  maxLength?: number | null;
189
190
  placeholder?: string | null;
190
191
  disabled?: false | string;
191
- }>): Value<AsRequired<string, Required>>;
192
+ }>): Value<AsRequired<string, Required>, string | null>;
192
193
  /**
193
194
  * @description Displays a number input field
194
195
  * @example
@@ -246,7 +247,7 @@ export declare class Value<Type> {
246
247
  * @default false
247
248
  */
248
249
  immutable?: boolean;
249
- }): Value<AsRequired<number, Required>>;
250
+ }): Value<AsRequired<number, Required>, AsRequired<number, Required>>;
250
251
  static dynamicNumber<Required extends boolean>(getA: LazyBuild<{
251
252
  name: string;
252
253
  description?: string | null;
@@ -260,7 +261,7 @@ export declare class Value<Type> {
260
261
  units?: string | null;
261
262
  placeholder?: string | null;
262
263
  disabled?: false | string;
263
- }>): Value<AsRequired<number, Required>>;
264
+ }>): Value<AsRequired<number, Required>, number | null>;
264
265
  /**
265
266
  * @description Displays a browser-native color selector.
266
267
  * @example
@@ -296,7 +297,7 @@ export declare class Value<Type> {
296
297
  * @default false
297
298
  */
298
299
  immutable?: boolean;
299
- }): Value<AsRequired<string, Required>>;
300
+ }): Value<AsRequired<string, Required>, AsRequired<string, Required>>;
300
301
  static dynamicColor<Required extends boolean>(getA: LazyBuild<{
301
302
  name: string;
302
303
  description?: string | null;
@@ -304,7 +305,7 @@ export declare class Value<Type> {
304
305
  default: string | null;
305
306
  required: Required;
306
307
  disabled?: false | string;
307
- }>): Value<AsRequired<string, Required>>;
308
+ }>): Value<AsRequired<string, Required>, string | null>;
308
309
  /**
309
310
  * @description Displays a browser-native date/time selector.
310
311
  * @example
@@ -350,7 +351,7 @@ export declare class Value<Type> {
350
351
  * @default false
351
352
  */
352
353
  immutable?: boolean;
353
- }): Value<AsRequired<string, Required>>;
354
+ }): Value<AsRequired<string, Required>, AsRequired<string, Required>>;
354
355
  static dynamicDatetime<Required extends boolean>(getA: LazyBuild<{
355
356
  name: string;
356
357
  description?: string | null;
@@ -361,7 +362,7 @@ export declare class Value<Type> {
361
362
  min?: string | null;
362
363
  max?: string | null;
363
364
  disabled?: false | string;
364
- }>): Value<AsRequired<string, Required>>;
365
+ }>): Value<AsRequired<string, Required>, string | null>;
365
366
  /**
366
367
  * @description Displays a select modal with radio buttons, allowing for a single selection.
367
368
  * @example
@@ -412,7 +413,7 @@ export declare class Value<Type> {
412
413
  * @default false
413
414
  */
414
415
  immutable?: boolean;
415
- }): Value<keyof Values & string>;
416
+ }): Value<keyof Values & string, keyof Values & string>;
416
417
  static dynamicSelect<Values extends Record<string, string>>(getA: LazyBuild<{
417
418
  name: string;
418
419
  description?: string | null;
@@ -420,7 +421,7 @@ export declare class Value<Type> {
420
421
  default: string;
421
422
  values: Values;
422
423
  disabled?: false | string | string[];
423
- }>): Value<keyof Values & string>;
424
+ }>): Value<keyof Values & string, string>;
424
425
  /**
425
426
  * @description Displays a select modal with checkboxes, allowing for multiple selections.
426
427
  * @example
@@ -472,7 +473,7 @@ export declare class Value<Type> {
472
473
  * @default false
473
474
  */
474
475
  immutable?: boolean;
475
- }): Value<(keyof Values & string)[]>;
476
+ }): Value<(keyof Values & string)[], (keyof Values & string)[]>;
476
477
  static dynamicMultiselect<Values extends Record<string, string>>(getA: LazyBuild<{
477
478
  name: string;
478
479
  description?: string | null;
@@ -482,7 +483,7 @@ export declare class Value<Type> {
482
483
  minLength?: number | null;
483
484
  maxLength?: number | null;
484
485
  disabled?: false | string | string[];
485
- }>): Value<(keyof Values & string)[]>;
486
+ }>): Value<(keyof Values & string)[], string[]>;
486
487
  /**
487
488
  * @description Display a collapsable grouping of additional fields, a "sub form". The second value is the inputSpec spec for the sub form.
488
489
  * @example
@@ -500,10 +501,10 @@ export declare class Value<Type> {
500
501
  ),
501
502
  * ```
502
503
  */
503
- static object<Type extends Record<string, any>>(a: {
504
+ static object<Type extends StaticValidatedAs, StaticValidatedAs extends Record<string, any>>(a: {
504
505
  name: string;
505
506
  description?: string | null;
506
- }, spec: InputSpec<Type>): Value<Type>;
507
+ }, spec: InputSpec<Type, StaticValidatedAs>): Value<Type, StaticValidatedAs>;
507
508
  /**
508
509
  * @description Displays a dropdown, allowing for a single selection. Depending on the selection, a different object ("sub form") is presented.
509
510
  * @example
@@ -555,7 +556,7 @@ export declare class Value<Type> {
555
556
  * @default false
556
557
  */
557
558
  immutable?: boolean;
558
- }): Value<UnionRes<VariantValues, keyof VariantValues & string>>;
559
+ }): Value<UnionRes<VariantValues, keyof VariantValues & string>, UnionResStaticValidatedAs<VariantValues, keyof VariantValues & string>>;
559
560
  static dynamicUnion<VariantValues extends {
560
561
  [K in string]: {
561
562
  name: string;
@@ -568,7 +569,20 @@ export declare class Value<Type> {
568
569
  variants: Variants<VariantValues>;
569
570
  default: keyof VariantValues & string;
570
571
  disabled: string[] | false | string;
571
- }>): Value<UnionRes<VariantValues>>;
572
+ }>): Value<UnionRes<VariantValues>, unknown>;
573
+ static dynamicUnion<VariantValues extends StaticVariantValues, StaticVariantValues extends {
574
+ [K in string]: {
575
+ name: string;
576
+ spec: InputSpec<any, any>;
577
+ };
578
+ }>(getA: LazyBuild<{
579
+ name: string;
580
+ description?: string | null;
581
+ warning?: string | null;
582
+ variants: Variants<VariantValues>;
583
+ default: keyof VariantValues & string;
584
+ disabled: string[] | false | string;
585
+ }>, validator: Parser<unknown, UnionResStaticValidatedAs<StaticVariantValues>>): Value<UnionRes<VariantValues>, UnionResStaticValidatedAs<StaticVariantValues>>;
572
586
  /**
573
587
  * @description Presents an interface to add/remove/edit items in a list.
574
588
  * @example
@@ -632,7 +646,16 @@ export declare class Value<Type> {
632
646
  ),
633
647
  * ```
634
648
  */
635
- static list<Type>(a: List<Type>): Value<Type>;
649
+ static list<Type>(a: List<Type>): Value<Type, Type>;
650
+ /**
651
+ * @description Provides a way to define a hidden field with a static value. Useful for tracking
652
+ * @example
653
+ * ```
654
+ hiddenExample: Value.hidden(),
655
+ * ```
656
+ */
657
+ static hidden<T>(): Value<T, unknown>;
658
+ static hidden<T>(parser: Parser<unknown, T>): Value<T>;
636
659
  /**
637
660
  * @description Provides a way to define a hidden field with a static value. Useful for tracking
638
661
  * @example
@@ -640,7 +663,7 @@ export declare class Value<Type> {
640
663
  hiddenExample: Value.hidden(),
641
664
  * ```
642
665
  */
643
- static hidden<T>(parser?: Parser<unknown, T>): Value<T>;
644
- map<U>(fn: (value: Type) => U): Value<U>;
666
+ static dynamicHidden<T>(getParser: LazyBuild<Parser<unknown, T>>): Value<T, unknown>;
667
+ map<U>(fn: (value: StaticValidatedAs) => U): Value<U>;
645
668
  }
646
669
  export {};