@start9labs/start-sdk 0.4.0-beta.30 → 0.4.0-beta.31
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.
- package/base/lib/actions/index.d.ts +1 -2
- package/base/lib/actions/input/builder/inputSpec.d.ts +7 -3
- package/base/lib/actions/input/builder/inputSpec.js +10 -10
- package/base/lib/actions/input/builder/inputSpec.js.map +1 -1
- package/base/lib/actions/input/builder/list.d.ts +5 -2
- package/base/lib/actions/input/builder/list.js +19 -16
- package/base/lib/actions/input/builder/list.js.map +1 -1
- package/base/lib/actions/input/builder/value.d.ts +35 -28
- package/base/lib/actions/input/builder/value.js +225 -160
- package/base/lib/actions/input/builder/value.js.map +1 -1
- package/base/lib/actions/input/builder/variants.d.ts +5 -2
- package/base/lib/actions/input/builder/variants.js +16 -9
- package/base/lib/actions/input/builder/variants.js.map +1 -1
- package/base/lib/actions/input/inputSpecConstants.d.ts +1 -1
- package/base/lib/actions/input/inputSpecConstants.js +22 -21
- package/base/lib/actions/input/inputSpecConstants.js.map +1 -1
- package/base/lib/actions/setupActions.d.ts +11 -11
- package/base/lib/actions/setupActions.js +12 -3
- package/base/lib/actions/setupActions.js.map +1 -1
- package/base/lib/osBindings/Progress.d.ts +2 -0
- package/base/lib/osBindings/Progress.js +0 -1
- package/base/lib/osBindings/Progress.js.map +1 -1
- package/base/lib/osBindings/ProgressUnits.d.ts +1 -0
- package/base/lib/osBindings/ProgressUnits.js +4 -0
- package/base/lib/osBindings/ProgressUnits.js.map +1 -0
- package/base/lib/osBindings/Proxies.d.ts +4 -0
- package/base/lib/osBindings/Proxies.js +3 -0
- package/base/lib/osBindings/Proxies.js.map +1 -0
- package/base/lib/osBindings/ProxyInfo.d.ts +4 -0
- package/base/lib/osBindings/ProxyInfo.js +4 -0
- package/base/lib/osBindings/ProxyInfo.js.map +1 -0
- package/base/lib/osBindings/index.d.ts +1 -0
- package/package/lib/StartSdk.d.ts +3 -3
- package/package/lib/StartSdk.js +1 -1
- package/package/lib/StartSdk.js.map +1 -1
- package/package/lib/test/inputSpecBuilder.test.js +151 -148
- package/package/lib/test/inputSpecBuilder.test.js.map +1 -1
- package/package/lib/test/output.d.ts +1 -76
- package/package/lib/test/output.js +41 -40
- package/package/lib/test/output.js.map +1 -1
- package/package/lib/test/output.sdk.d.ts +2 -2
- package/package/lib/test/output.test.js +12 -8
- package/package/lib/test/output.test.js.map +1 -1
- package/package/package.json +1 -1
- package/package/scripts/oldSpecToBuilder.js +5 -4
- package/package/scripts/oldSpecToBuilder.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as T from "../types";
|
|
2
2
|
import * as IST from "../actions/input/inputSpecTypes";
|
|
3
3
|
import { Action, ActionInfo } from "./setupActions";
|
|
4
|
-
import { ExtractInputSpecType } from "./input/builder/inputSpec";
|
|
5
4
|
export type RunActionInput<Input> = Input | ((prev?: {
|
|
6
5
|
spec: IST.InputSpec;
|
|
7
6
|
value: Input | null;
|
|
@@ -11,7 +10,7 @@ export declare const runAction: <Input extends Record<string, unknown>>(options:
|
|
|
11
10
|
actionId: T.ActionId;
|
|
12
11
|
input?: RunActionInput<Input>;
|
|
13
12
|
}) => Promise<T.ActionResult | null>;
|
|
14
|
-
type GetActionInputType<A extends ActionInfo<T.ActionId, any>> = A extends Action<T.ActionId, infer I> ?
|
|
13
|
+
type GetActionInputType<A extends ActionInfo<T.ActionId, any>> = A extends Action<T.ActionId, infer I> ? I : never;
|
|
15
14
|
type TaskBase = {
|
|
16
15
|
reason?: string;
|
|
17
16
|
replayId?: string;
|
|
@@ -7,7 +7,7 @@ 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
|
|
10
|
+
export type ExtractInputSpecType<A extends InputSpec<Record<string, any>>> = A extends InputSpec<infer B> ? B : never;
|
|
11
11
|
export type ExtractPartialInputSpecType<A extends Record<string, any> | InputSpec<Record<string, any>>> = A extends InputSpec<infer B> ? DeepPartial<B> : DeepPartial<A>;
|
|
12
12
|
export type InputSpecOf<A extends Record<string, any>> = {
|
|
13
13
|
[K in keyof A]: Value<A[K]>;
|
|
@@ -71,10 +71,14 @@ export const addNodesSpec = InputSpec.of({ hostname: hostname, port: port });
|
|
|
71
71
|
*/
|
|
72
72
|
export declare class InputSpec<Type extends Record<string, any>> {
|
|
73
73
|
private readonly spec;
|
|
74
|
-
validator: Parser<unknown, Type>;
|
|
75
74
|
private constructor();
|
|
76
75
|
_TYPE: Type;
|
|
77
76
|
_PARTIAL: DeepPartial<Type>;
|
|
78
|
-
build(options: LazyBuildOptions): Promise<{
|
|
77
|
+
build(options: LazyBuildOptions): Promise<{
|
|
78
|
+
spec: {
|
|
79
|
+
[K in keyof Type]: ValueSpec;
|
|
80
|
+
};
|
|
81
|
+
validator: Parser<unknown, Type>;
|
|
82
|
+
}>;
|
|
79
83
|
static of<Spec extends Record<string, Value<any>>>(spec: Spec): InputSpec<{ [K in keyof Spec]: Spec[K] extends Value<infer T> ? T : never; }>;
|
|
80
84
|
}
|
|
@@ -59,26 +59,26 @@ export const addNodesSpec = InputSpec.of({ hostname: hostname, port: port });
|
|
|
59
59
|
```
|
|
60
60
|
*/
|
|
61
61
|
class InputSpec {
|
|
62
|
-
constructor(spec
|
|
62
|
+
constructor(spec) {
|
|
63
63
|
this.spec = spec;
|
|
64
|
-
this.validator = validator;
|
|
65
64
|
this._TYPE = null;
|
|
66
65
|
this._PARTIAL = null;
|
|
67
66
|
}
|
|
68
67
|
async build(options) {
|
|
69
68
|
const answer = {};
|
|
69
|
+
const validator = {};
|
|
70
70
|
for (const k in this.spec) {
|
|
71
|
-
|
|
71
|
+
const built = await this.spec[k].build(options);
|
|
72
|
+
answer[k] = built.spec;
|
|
73
|
+
validator[k] = built.validator;
|
|
72
74
|
}
|
|
73
|
-
return
|
|
75
|
+
return {
|
|
76
|
+
spec: answer,
|
|
77
|
+
validator: (0, ts_matches_1.object)(validator),
|
|
78
|
+
};
|
|
74
79
|
}
|
|
75
80
|
static of(spec) {
|
|
76
|
-
|
|
77
|
-
for (const key in spec) {
|
|
78
|
-
validatorObj[key] = spec[key].validator;
|
|
79
|
-
}
|
|
80
|
-
const validator = (0, ts_matches_1.object)(validatorObj);
|
|
81
|
-
return new InputSpec(spec, validator);
|
|
81
|
+
return new InputSpec(spec);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
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
|
|
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;QACD,OAAO;YACL,IAAI,EAAE,MAAM;YACZ,SAAS,EAAE,IAAA,mBAAM,EAAC,SAAS,CAAQ;SACpC,CAAA;IACH,CAAC;IAED,MAAM,CAAC,EAAE,CAA0C,IAAU;QAC3D,OAAO,IAAI,SAAS,CAEjB,IAAI,CAAC,CAAA;IACV,CAAC;CACF;AApCD,8BAoCC"}
|
|
@@ -2,9 +2,12 @@ import { InputSpec, LazyBuild } from "./inputSpec";
|
|
|
2
2
|
import { ListValueSpecText, Pattern, RandomString, UniqueBy, ValueSpecList } from "../inputSpecTypes";
|
|
3
3
|
import { Parser } from "ts-matches";
|
|
4
4
|
export declare class List<Type> {
|
|
5
|
-
build: LazyBuild<
|
|
6
|
-
|
|
5
|
+
build: LazyBuild<{
|
|
6
|
+
spec: ValueSpecList;
|
|
7
|
+
validator: Parser<unknown, Type>;
|
|
8
|
+
}>;
|
|
7
9
|
private constructor();
|
|
10
|
+
readonly _TYPE: Type;
|
|
8
11
|
static text(a: {
|
|
9
12
|
name: string;
|
|
10
13
|
description?: string | null;
|
|
@@ -3,9 +3,9 @@ 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) {
|
|
7
7
|
this.build = build;
|
|
8
|
-
this.
|
|
8
|
+
this._TYPE = null;
|
|
9
9
|
}
|
|
10
10
|
static text(a, aSpec) {
|
|
11
11
|
return new List(() => {
|
|
@@ -31,8 +31,8 @@ class List {
|
|
|
31
31
|
...a,
|
|
32
32
|
spec,
|
|
33
33
|
};
|
|
34
|
-
return built;
|
|
35
|
-
}
|
|
34
|
+
return { spec: built, validator: (0, ts_matches_1.arrayOf)(ts_matches_1.string) };
|
|
35
|
+
});
|
|
36
36
|
}
|
|
37
37
|
static dynamicText(getA) {
|
|
38
38
|
return new List(async (options) => {
|
|
@@ -59,19 +59,19 @@ class List {
|
|
|
59
59
|
...a,
|
|
60
60
|
spec,
|
|
61
61
|
};
|
|
62
|
-
return built;
|
|
63
|
-
}
|
|
62
|
+
return { spec: built, validator: (0, ts_matches_1.arrayOf)(ts_matches_1.string) };
|
|
63
|
+
});
|
|
64
64
|
}
|
|
65
65
|
static obj(a, aSpec) {
|
|
66
66
|
return new List(async (options) => {
|
|
67
67
|
const { spec: previousSpecSpec, ...restSpec } = aSpec;
|
|
68
|
-
const
|
|
68
|
+
const built = await previousSpecSpec.build(options);
|
|
69
69
|
const spec = {
|
|
70
70
|
type: "object",
|
|
71
71
|
displayAs: null,
|
|
72
72
|
uniqueBy: null,
|
|
73
73
|
...restSpec,
|
|
74
|
-
spec:
|
|
74
|
+
spec: built.spec,
|
|
75
75
|
};
|
|
76
76
|
const value = {
|
|
77
77
|
spec,
|
|
@@ -79,15 +79,18 @@ class List {
|
|
|
79
79
|
...a,
|
|
80
80
|
};
|
|
81
81
|
return {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
82
|
+
spec: {
|
|
83
|
+
description: null,
|
|
84
|
+
warning: null,
|
|
85
|
+
minLength: null,
|
|
86
|
+
maxLength: null,
|
|
87
|
+
type: "list",
|
|
88
|
+
disabled: false,
|
|
89
|
+
...value,
|
|
90
|
+
},
|
|
91
|
+
validator: (0, ts_matches_1.arrayOf)(built.validator),
|
|
89
92
|
};
|
|
90
|
-
}
|
|
93
|
+
});
|
|
91
94
|
}
|
|
92
95
|
}
|
|
93
96
|
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,
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../../base/lib/actions/input/builder/list.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { InputSpec, LazyBuild } from "./inputSpec";
|
|
2
2
|
import { List } from "./list";
|
|
3
|
-
import { Variants } from "./variants";
|
|
3
|
+
import { UnionRes, 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
9
|
export declare class Value<Type> {
|
|
10
|
-
build: LazyBuild<
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
build: LazyBuild<{
|
|
11
|
+
spec: ValueSpec;
|
|
12
|
+
validator: Parser<unknown, Type>;
|
|
13
|
+
}>;
|
|
14
|
+
protected constructor(build: LazyBuild<{
|
|
15
|
+
spec: ValueSpec;
|
|
16
|
+
validator: Parser<unknown, Type>;
|
|
17
|
+
}>);
|
|
13
18
|
_TYPE: Type;
|
|
14
19
|
_PARTIAL: DeepPartial<Type>;
|
|
15
20
|
/**
|
|
@@ -122,12 +127,12 @@ export declare class Value<Type> {
|
|
|
122
127
|
*/
|
|
123
128
|
generate?: RandomString | null;
|
|
124
129
|
}): Value<AsRequired<string, Required>>;
|
|
125
|
-
static dynamicText(getA: LazyBuild<{
|
|
130
|
+
static dynamicText<Required extends boolean>(getA: LazyBuild<{
|
|
126
131
|
name: string;
|
|
127
132
|
description?: string | null;
|
|
128
133
|
warning?: string | null;
|
|
129
134
|
default: DefaultString | null;
|
|
130
|
-
required:
|
|
135
|
+
required: Required;
|
|
131
136
|
masked?: boolean;
|
|
132
137
|
placeholder?: string | null;
|
|
133
138
|
minLength?: number | null;
|
|
@@ -136,7 +141,7 @@ export declare class Value<Type> {
|
|
|
136
141
|
inputmode?: ValueSpecText["inputmode"];
|
|
137
142
|
disabled?: string | false;
|
|
138
143
|
generate?: null | RandomString;
|
|
139
|
-
}>): Value<string
|
|
144
|
+
}>): Value<AsRequired<string, Required>>;
|
|
140
145
|
/**
|
|
141
146
|
* @description Displays a large textarea field for long form entry.
|
|
142
147
|
* @example
|
|
@@ -173,17 +178,17 @@ export declare class Value<Type> {
|
|
|
173
178
|
*/
|
|
174
179
|
immutable?: boolean;
|
|
175
180
|
}): Value<AsRequired<string, Required>>;
|
|
176
|
-
static dynamicTextarea(getA: LazyBuild<{
|
|
181
|
+
static dynamicTextarea<Required extends boolean>(getA: LazyBuild<{
|
|
177
182
|
name: string;
|
|
178
183
|
description?: string | null;
|
|
179
184
|
warning?: string | null;
|
|
180
185
|
default: string | null;
|
|
181
|
-
required:
|
|
186
|
+
required: Required;
|
|
182
187
|
minLength?: number | null;
|
|
183
188
|
maxLength?: number | null;
|
|
184
189
|
placeholder?: string | null;
|
|
185
190
|
disabled?: false | string;
|
|
186
|
-
}>): Value<string
|
|
191
|
+
}>): Value<AsRequired<string, Required>>;
|
|
187
192
|
/**
|
|
188
193
|
* @description Displays a number input field
|
|
189
194
|
* @example
|
|
@@ -242,12 +247,12 @@ export declare class Value<Type> {
|
|
|
242
247
|
*/
|
|
243
248
|
immutable?: boolean;
|
|
244
249
|
}): Value<AsRequired<number, Required>>;
|
|
245
|
-
static dynamicNumber(getA: LazyBuild<{
|
|
250
|
+
static dynamicNumber<Required extends boolean>(getA: LazyBuild<{
|
|
246
251
|
name: string;
|
|
247
252
|
description?: string | null;
|
|
248
253
|
warning?: string | null;
|
|
249
254
|
default: number | null;
|
|
250
|
-
required:
|
|
255
|
+
required: Required;
|
|
251
256
|
min?: number | null;
|
|
252
257
|
max?: number | null;
|
|
253
258
|
step?: number | null;
|
|
@@ -255,7 +260,7 @@ export declare class Value<Type> {
|
|
|
255
260
|
units?: string | null;
|
|
256
261
|
placeholder?: string | null;
|
|
257
262
|
disabled?: false | string;
|
|
258
|
-
}>): Value<number
|
|
263
|
+
}>): Value<AsRequired<number, Required>>;
|
|
259
264
|
/**
|
|
260
265
|
* @description Displays a browser-native color selector.
|
|
261
266
|
* @example
|
|
@@ -292,14 +297,14 @@ export declare class Value<Type> {
|
|
|
292
297
|
*/
|
|
293
298
|
immutable?: boolean;
|
|
294
299
|
}): Value<AsRequired<string, Required>>;
|
|
295
|
-
static dynamicColor(getA: LazyBuild<{
|
|
300
|
+
static dynamicColor<Required extends boolean>(getA: LazyBuild<{
|
|
296
301
|
name: string;
|
|
297
302
|
description?: string | null;
|
|
298
303
|
warning?: string | null;
|
|
299
304
|
default: string | null;
|
|
300
|
-
required:
|
|
305
|
+
required: Required;
|
|
301
306
|
disabled?: false | string;
|
|
302
|
-
}>): Value<string
|
|
307
|
+
}>): Value<AsRequired<string, Required>>;
|
|
303
308
|
/**
|
|
304
309
|
* @description Displays a browser-native date/time selector.
|
|
305
310
|
* @example
|
|
@@ -346,17 +351,17 @@ export declare class Value<Type> {
|
|
|
346
351
|
*/
|
|
347
352
|
immutable?: boolean;
|
|
348
353
|
}): Value<AsRequired<string, Required>>;
|
|
349
|
-
static dynamicDatetime(getA: LazyBuild<{
|
|
354
|
+
static dynamicDatetime<Required extends boolean>(getA: LazyBuild<{
|
|
350
355
|
name: string;
|
|
351
356
|
description?: string | null;
|
|
352
357
|
warning?: string | null;
|
|
353
358
|
default: string | null;
|
|
354
|
-
required:
|
|
359
|
+
required: Required;
|
|
355
360
|
inputmode?: ValueSpecDatetime["inputmode"];
|
|
356
361
|
min?: string | null;
|
|
357
362
|
max?: string | null;
|
|
358
363
|
disabled?: false | string;
|
|
359
|
-
}>): Value<string
|
|
364
|
+
}>): Value<AsRequired<string, Required>>;
|
|
360
365
|
/**
|
|
361
366
|
* @description Displays a select modal with radio buttons, allowing for a single selection.
|
|
362
367
|
* @example
|
|
@@ -408,14 +413,14 @@ export declare class Value<Type> {
|
|
|
408
413
|
*/
|
|
409
414
|
immutable?: boolean;
|
|
410
415
|
}): Value<keyof Values & string>;
|
|
411
|
-
static dynamicSelect(getA: LazyBuild<{
|
|
416
|
+
static dynamicSelect<Values extends Record<string, string>>(getA: LazyBuild<{
|
|
412
417
|
name: string;
|
|
413
418
|
description?: string | null;
|
|
414
419
|
warning?: string | null;
|
|
415
420
|
default: string;
|
|
416
|
-
values:
|
|
421
|
+
values: Values;
|
|
417
422
|
disabled?: false | string | string[];
|
|
418
|
-
}>): Value<string>;
|
|
423
|
+
}>): Value<keyof Values & string>;
|
|
419
424
|
/**
|
|
420
425
|
* @description Displays a select modal with checkboxes, allowing for multiple selections.
|
|
421
426
|
* @example
|
|
@@ -467,17 +472,17 @@ export declare class Value<Type> {
|
|
|
467
472
|
* @default false
|
|
468
473
|
*/
|
|
469
474
|
immutable?: boolean;
|
|
470
|
-
}): Value<(keyof Values)[]>;
|
|
471
|
-
static dynamicMultiselect(getA: LazyBuild<{
|
|
475
|
+
}): Value<(keyof Values & string)[]>;
|
|
476
|
+
static dynamicMultiselect<Values extends Record<string, string>>(getA: LazyBuild<{
|
|
472
477
|
name: string;
|
|
473
478
|
description?: string | null;
|
|
474
479
|
warning?: string | null;
|
|
475
480
|
default: string[];
|
|
476
|
-
values:
|
|
481
|
+
values: Values;
|
|
477
482
|
minLength?: number | null;
|
|
478
483
|
maxLength?: number | null;
|
|
479
484
|
disabled?: false | string | string[];
|
|
480
|
-
}>): Value<string[]>;
|
|
485
|
+
}>): Value<(keyof Values & string)[]>;
|
|
481
486
|
/**
|
|
482
487
|
* @description Display a collapsable grouping of additional fields, a "sub form". The second value is the inputSpec spec for the sub form.
|
|
483
488
|
* @example
|
|
@@ -538,6 +543,7 @@ export declare class Value<Type> {
|
|
|
538
543
|
description?: string | null;
|
|
539
544
|
/** Presents a warning prompt before permitting the value to change. */
|
|
540
545
|
warning?: string | null;
|
|
546
|
+
variants: Variants<VariantValues>;
|
|
541
547
|
/**
|
|
542
548
|
* @description Provide a default value from the list of variants.
|
|
543
549
|
* @type { string }
|
|
@@ -549,7 +555,7 @@ export declare class Value<Type> {
|
|
|
549
555
|
* @default false
|
|
550
556
|
*/
|
|
551
557
|
immutable?: boolean;
|
|
552
|
-
}
|
|
558
|
+
}): Value<UnionRes<VariantValues, keyof VariantValues & string>>;
|
|
553
559
|
static dynamicUnion<VariantValues extends {
|
|
554
560
|
[K in string]: {
|
|
555
561
|
name: string;
|
|
@@ -559,9 +565,10 @@ export declare class Value<Type> {
|
|
|
559
565
|
name: string;
|
|
560
566
|
description?: string | null;
|
|
561
567
|
warning?: string | null;
|
|
568
|
+
variants: Variants<VariantValues>;
|
|
562
569
|
default: keyof VariantValues & string;
|
|
563
570
|
disabled: string[] | false | string;
|
|
564
|
-
}
|
|
571
|
+
}>): Value<UnionRes<VariantValues>>;
|
|
565
572
|
/**
|
|
566
573
|
* @description Presents an interface to add/remove/edit items in a list.
|
|
567
574
|
* @example
|