@start9labs/start-sdk 0.4.0-beta.2 → 0.4.0-beta.21
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/Effects.d.ts +4 -22
- package/base/lib/actions/index.d.ts +5 -5
- package/base/lib/actions/index.js.map +1 -1
- package/base/lib/actions/input/builder/inputSpec.d.ts +10 -25
- package/base/lib/actions/input/builder/inputSpec.js +0 -17
- package/base/lib/actions/input/builder/inputSpec.js.map +1 -1
- package/base/lib/actions/input/builder/list.d.ts +8 -23
- package/base/lib/actions/input/builder/list.js +0 -17
- package/base/lib/actions/input/builder/list.js.map +1 -1
- package/base/lib/actions/input/builder/value.d.ts +318 -53
- package/base/lib/actions/input/builder/value.js +280 -17
- package/base/lib/actions/input/builder/value.js.map +1 -1
- package/base/lib/actions/input/builder/variants.d.ts +8 -23
- package/base/lib/actions/input/builder/variants.js +0 -17
- package/base/lib/actions/input/builder/variants.js.map +1 -1
- package/base/lib/actions/input/inputSpecConstants.d.ts +6 -6
- package/base/lib/actions/input/inputSpecConstants.js.map +1 -1
- package/base/lib/actions/setupActions.d.ts +10 -11
- package/base/lib/actions/setupActions.js +24 -11
- package/base/lib/actions/setupActions.js.map +1 -1
- package/base/lib/dependencies/setupDependencies.d.ts +1 -3
- package/base/lib/dependencies/setupDependencies.js +3 -12
- package/base/lib/dependencies/setupDependencies.js.map +1 -1
- package/base/lib/index.d.ts +1 -0
- package/base/lib/index.js +2 -1
- package/base/lib/index.js.map +1 -1
- package/base/lib/inits/index.d.ts +2 -0
- package/base/lib/inits/index.js +19 -0
- package/base/lib/inits/index.js.map +1 -0
- package/base/lib/inits/setupInit.d.ts +11 -0
- package/base/lib/inits/setupInit.js +69 -0
- package/base/lib/inits/setupInit.js.map +1 -0
- package/base/lib/inits/setupUninit.d.ts +7 -0
- package/base/lib/inits/setupUninit.js +14 -0
- package/base/lib/inits/setupUninit.js.map +1 -0
- package/base/lib/interfaces/setupInterfaces.d.ts +2 -4
- package/base/lib/interfaces/setupInterfaces.js +8 -19
- package/base/lib/interfaces/setupInterfaces.js.map +1 -1
- package/base/lib/osBindings/AddCategoryParams.d.ts +0 -2
- package/base/lib/osBindings/AddPackageToCategoryParams.d.ts +5 -0
- package/base/lib/osBindings/AddPackageToCategoryParams.js +3 -0
- package/base/lib/osBindings/AddPackageToCategoryParams.js.map +1 -0
- package/base/lib/osBindings/Category.d.ts +0 -2
- package/base/lib/osBindings/Category.js +1 -0
- package/base/lib/osBindings/Category.js.map +1 -1
- package/base/lib/osBindings/FileType.d.ts +1 -0
- package/base/lib/osBindings/{UnsetPublicParams.js → FileType.js} +1 -1
- package/base/lib/osBindings/FileType.js.map +1 -0
- package/base/lib/osBindings/GetOsVersionParams.d.ts +4 -3
- package/base/lib/osBindings/GetPackageParams.d.ts +1 -1
- package/base/lib/osBindings/MainStatus.d.ts +0 -2
- package/base/lib/osBindings/MountTarget.d.ts +2 -0
- package/base/lib/osBindings/PackageDataEntry.d.ts +1 -2
- package/base/lib/osBindings/RemoveAdminParams.d.ts +4 -0
- package/base/lib/osBindings/RemoveAdminParams.js +3 -0
- package/base/lib/osBindings/RemoveAdminParams.js.map +1 -0
- package/base/lib/osBindings/RemoveAssetParams.d.ts +4 -0
- package/base/lib/osBindings/{NetworkInterfaceSetPublicParams.js → RemoveAssetParams.js} +1 -1
- package/base/lib/osBindings/RemoveAssetParams.js.map +1 -0
- package/base/lib/osBindings/RemovePackageFromCategoryParams.d.ts +5 -0
- package/base/lib/osBindings/RemovePackageFromCategoryParams.js +3 -0
- package/base/lib/osBindings/RemovePackageFromCategoryParams.js.map +1 -0
- package/base/lib/osBindings/RemovePackageParams.d.ts +6 -0
- package/base/lib/osBindings/RemovePackageParams.js +3 -0
- package/base/lib/osBindings/RemovePackageParams.js.map +1 -0
- package/base/lib/osBindings/index.d.ts +6 -3
- package/base/lib/types.d.ts +20 -33
- package/base/lib/types.js +8 -0
- package/base/lib/types.js.map +1 -1
- package/base/lib/util/GetSystemSmtp.js +7 -2
- package/base/lib/util/GetSystemSmtp.js.map +1 -1
- package/base/lib/util/getServiceInterface.d.ts +10 -0
- package/base/lib/util/getServiceInterface.js +41 -1
- package/base/lib/util/getServiceInterface.js.map +1 -1
- package/base/lib/util/getServiceInterfaces.js +6 -1
- package/base/lib/util/getServiceInterfaces.js.map +1 -1
- package/base/lib/util/index.d.ts +0 -1
- package/base/lib/util/index.js +1 -3
- package/base/lib/util/index.js.map +1 -1
- package/package/lib/StartSdk.d.ts +106 -546
- package/package/lib/StartSdk.js +81 -410
- package/package/lib/StartSdk.js.map +1 -1
- package/package/lib/backup/Backups.d.ts +15 -3
- package/package/lib/backup/Backups.js +47 -5
- package/package/lib/backup/Backups.js.map +1 -1
- package/package/lib/backup/setupBackups.d.ts +5 -2
- package/package/lib/backup/setupBackups.js +7 -5
- package/package/lib/backup/setupBackups.js.map +1 -1
- package/package/lib/health/HealthCheck.js +1 -1
- package/package/lib/health/HealthCheck.js.map +1 -1
- package/package/lib/health/checkFns/runHealthScript.d.ts +2 -1
- package/package/lib/health/checkFns/runHealthScript.js +1 -1
- package/package/lib/health/checkFns/runHealthScript.js.map +1 -1
- package/package/lib/index.d.ts +0 -3
- package/package/lib/index.js +1 -8
- package/package/lib/index.js.map +1 -1
- package/package/lib/inits/index.d.ts +2 -3
- package/package/lib/inits/index.js +16 -3
- package/package/lib/inits/index.js.map +1 -1
- package/package/lib/inits/setupInit.d.ts +7 -13
- package/package/lib/inits/setupInit.js +22 -48
- package/package/lib/inits/setupInit.js.map +1 -1
- package/package/lib/inits/setupInstall.d.ts +10 -10
- package/package/lib/inits/setupInstall.js.map +1 -1
- package/package/lib/inits/setupUninit.d.ts +7 -0
- package/package/lib/inits/setupUninit.js +14 -0
- package/package/lib/inits/setupUninit.js.map +1 -0
- package/package/lib/inits/setupUninstall.d.ts +5 -5
- package/package/lib/inits/setupUninstall.js.map +1 -1
- package/package/lib/mainFn/CommandController.d.ts +4 -13
- package/package/lib/mainFn/CommandController.js +28 -49
- package/package/lib/mainFn/CommandController.js.map +1 -1
- package/package/lib/mainFn/Daemon.d.ts +13 -14
- package/package/lib/mainFn/Daemon.js +44 -12
- package/package/lib/mainFn/Daemon.js.map +1 -1
- package/package/lib/mainFn/Daemons.d.ts +34 -33
- package/package/lib/mainFn/Daemons.js +30 -10
- package/package/lib/mainFn/Daemons.js.map +1 -1
- package/package/lib/mainFn/HealthDaemon.d.ts +6 -6
- package/package/lib/mainFn/HealthDaemon.js +30 -14
- package/package/lib/mainFn/HealthDaemon.js.map +1 -1
- package/package/lib/mainFn/Mounts.d.ts +38 -43
- package/package/lib/mainFn/Mounts.js +19 -48
- package/package/lib/mainFn/Mounts.js.map +1 -1
- package/package/lib/mainFn/Oneshot.d.ts +21 -0
- package/package/lib/mainFn/Oneshot.js +31 -0
- package/package/lib/mainFn/Oneshot.js.map +1 -0
- package/package/lib/mainFn/index.d.ts +1 -1
- package/package/lib/store/getStore.js +7 -2
- package/package/lib/store/getStore.js.map +1 -1
- package/package/lib/test/inputSpecBuilder.test.js +0 -8
- package/package/lib/test/inputSpecBuilder.test.js.map +1 -1
- package/package/lib/test/output.d.ts +2 -38
- package/package/lib/test/output.sdk.d.ts +239 -887
- package/package/lib/test/output.sdk.js +0 -1
- package/package/lib/test/output.sdk.js.map +1 -1
- package/package/lib/util/Drop.d.ts +1 -0
- package/package/lib/util/Drop.js +17 -4
- package/package/lib/util/Drop.js.map +1 -1
- package/package/lib/util/GetSslCertificate.js +7 -2
- package/package/lib/util/GetSslCertificate.js.map +1 -1
- package/package/lib/util/SubContainer.d.ts +160 -44
- package/package/lib/util/SubContainer.js +215 -99
- package/package/lib/util/SubContainer.js.map +1 -1
- package/package/lib/util/fileHelper.d.ts +41 -15
- package/package/lib/util/fileHelper.js +72 -27
- package/package/lib/util/fileHelper.js.map +1 -1
- package/package/lib/version/VersionGraph.d.ts +20 -5
- package/package/lib/version/VersionGraph.js +85 -18
- package/package/lib/version/VersionGraph.js.map +1 -1
- package/package.json +10 -11
- package/base/lib/osBindings/NetworkInterfaceSetPublicParams.d.ts +0 -4
- package/base/lib/osBindings/NetworkInterfaceSetPublicParams.js.map +0 -1
- package/base/lib/osBindings/UnsetPublicParams.d.ts +0 -3
- package/base/lib/osBindings/UnsetPublicParams.js.map +0 -1
|
@@ -6,12 +6,28 @@ 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
|
|
10
|
-
build: LazyBuild<
|
|
9
|
+
export declare class Value<Type> {
|
|
10
|
+
build: LazyBuild<ValueSpec>;
|
|
11
11
|
validator: Parser<unknown, Type>;
|
|
12
|
-
protected constructor(build: LazyBuild<
|
|
12
|
+
protected constructor(build: LazyBuild<ValueSpec>, validator: Parser<unknown, Type>);
|
|
13
13
|
_TYPE: Type;
|
|
14
14
|
_PARTIAL: DeepPartial<Type>;
|
|
15
|
+
/**
|
|
16
|
+
* @description Displays a boolean toggle to enable/disable
|
|
17
|
+
* @example
|
|
18
|
+
* ```
|
|
19
|
+
toggleExample: Value.toggle({
|
|
20
|
+
// required
|
|
21
|
+
name: 'Toggle Example',
|
|
22
|
+
default: true,
|
|
23
|
+
|
|
24
|
+
// optional
|
|
25
|
+
description: null,
|
|
26
|
+
warning: null,
|
|
27
|
+
immutable: false,
|
|
28
|
+
}),
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
15
31
|
static toggle(a: {
|
|
16
32
|
name: string;
|
|
17
33
|
description?: string | null;
|
|
@@ -23,14 +39,38 @@ export declare class Value<Type, Store> {
|
|
|
23
39
|
* @default false
|
|
24
40
|
*/
|
|
25
41
|
immutable?: boolean;
|
|
26
|
-
}): Value<boolean
|
|
27
|
-
static dynamicToggle
|
|
42
|
+
}): Value<boolean>;
|
|
43
|
+
static dynamicToggle(a: LazyBuild<{
|
|
28
44
|
name: string;
|
|
29
45
|
description?: string | null;
|
|
30
46
|
warning?: string | null;
|
|
31
47
|
default: boolean;
|
|
32
48
|
disabled?: false | string;
|
|
33
|
-
}>): Value<boolean
|
|
49
|
+
}>): Value<boolean>;
|
|
50
|
+
/**
|
|
51
|
+
* @description Displays a text input field
|
|
52
|
+
* @example
|
|
53
|
+
* ```
|
|
54
|
+
textExample: Value.text({
|
|
55
|
+
// required
|
|
56
|
+
name: 'Text Example',
|
|
57
|
+
required: false,
|
|
58
|
+
default: null,
|
|
59
|
+
|
|
60
|
+
// optional
|
|
61
|
+
description: null,
|
|
62
|
+
placeholder: null,
|
|
63
|
+
warning: null,
|
|
64
|
+
generate: null,
|
|
65
|
+
inputmode: 'text',
|
|
66
|
+
masked: false,
|
|
67
|
+
minLength: null,
|
|
68
|
+
maxLength: null,
|
|
69
|
+
patterns: [],
|
|
70
|
+
immutable: false,
|
|
71
|
+
}),
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
34
74
|
static text<Required extends boolean>(a: {
|
|
35
75
|
name: string;
|
|
36
76
|
description?: string | null;
|
|
@@ -81,8 +121,8 @@ export declare class Value<Type, Store> {
|
|
|
81
121
|
* @description Displays a button that will generate a random string according to the provided charset and len attributes.
|
|
82
122
|
*/
|
|
83
123
|
generate?: RandomString | null;
|
|
84
|
-
}): Value<AsRequired<string, Required
|
|
85
|
-
static dynamicText
|
|
124
|
+
}): Value<AsRequired<string, Required>>;
|
|
125
|
+
static dynamicText(getA: LazyBuild<{
|
|
86
126
|
name: string;
|
|
87
127
|
description?: string | null;
|
|
88
128
|
warning?: string | null;
|
|
@@ -96,7 +136,27 @@ export declare class Value<Type, Store> {
|
|
|
96
136
|
inputmode?: ValueSpecText["inputmode"];
|
|
97
137
|
disabled?: string | false;
|
|
98
138
|
generate?: null | RandomString;
|
|
99
|
-
}>): Value<string | null
|
|
139
|
+
}>): Value<string | null>;
|
|
140
|
+
/**
|
|
141
|
+
* @description Displays a large textarea field for long form entry.
|
|
142
|
+
* @example
|
|
143
|
+
* ```
|
|
144
|
+
textareaExample: Value.textarea({
|
|
145
|
+
// required
|
|
146
|
+
name: 'Textarea Example',
|
|
147
|
+
required: false,
|
|
148
|
+
default: null,
|
|
149
|
+
|
|
150
|
+
// optional
|
|
151
|
+
description: null,
|
|
152
|
+
placeholder: null,
|
|
153
|
+
warning: null,
|
|
154
|
+
minLength: null,
|
|
155
|
+
maxLength: null,
|
|
156
|
+
immutable: false,
|
|
157
|
+
}),
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
100
160
|
static textarea<Required extends boolean>(a: {
|
|
101
161
|
name: string;
|
|
102
162
|
description?: string | null;
|
|
@@ -112,8 +172,8 @@ export declare class Value<Type, Store> {
|
|
|
112
172
|
* @default false
|
|
113
173
|
*/
|
|
114
174
|
immutable?: boolean;
|
|
115
|
-
}): Value<AsRequired<string, Required
|
|
116
|
-
static dynamicTextarea
|
|
175
|
+
}): Value<AsRequired<string, Required>>;
|
|
176
|
+
static dynamicTextarea(getA: LazyBuild<{
|
|
117
177
|
name: string;
|
|
118
178
|
description?: string | null;
|
|
119
179
|
warning?: string | null;
|
|
@@ -123,7 +183,30 @@ export declare class Value<Type, Store> {
|
|
|
123
183
|
maxLength?: number | null;
|
|
124
184
|
placeholder?: string | null;
|
|
125
185
|
disabled?: false | string;
|
|
126
|
-
}>): Value<string | null
|
|
186
|
+
}>): Value<string | null>;
|
|
187
|
+
/**
|
|
188
|
+
* @description Displays a number input field
|
|
189
|
+
* @example
|
|
190
|
+
* ```
|
|
191
|
+
numberExample: Value.number({
|
|
192
|
+
// required
|
|
193
|
+
name: 'Number Example',
|
|
194
|
+
required: false,
|
|
195
|
+
default: null,
|
|
196
|
+
integer: true,
|
|
197
|
+
|
|
198
|
+
// optional
|
|
199
|
+
description: null,
|
|
200
|
+
placeholder: null,
|
|
201
|
+
warning: null,
|
|
202
|
+
min: null,
|
|
203
|
+
max: null,
|
|
204
|
+
immutable: false,
|
|
205
|
+
step: null,
|
|
206
|
+
units: null,
|
|
207
|
+
}),
|
|
208
|
+
* ```
|
|
209
|
+
*/
|
|
127
210
|
static number<Required extends boolean>(a: {
|
|
128
211
|
name: string;
|
|
129
212
|
description?: string | null;
|
|
@@ -158,8 +241,8 @@ export declare class Value<Type, Store> {
|
|
|
158
241
|
* @default false
|
|
159
242
|
*/
|
|
160
243
|
immutable?: boolean;
|
|
161
|
-
}): Value<AsRequired<number, Required
|
|
162
|
-
static dynamicNumber
|
|
244
|
+
}): Value<AsRequired<number, Required>>;
|
|
245
|
+
static dynamicNumber(getA: LazyBuild<{
|
|
163
246
|
name: string;
|
|
164
247
|
description?: string | null;
|
|
165
248
|
warning?: string | null;
|
|
@@ -172,7 +255,24 @@ export declare class Value<Type, Store> {
|
|
|
172
255
|
units?: string | null;
|
|
173
256
|
placeholder?: string | null;
|
|
174
257
|
disabled?: false | string;
|
|
175
|
-
}>): Value<number | null
|
|
258
|
+
}>): Value<number | null>;
|
|
259
|
+
/**
|
|
260
|
+
* @description Displays a browser-native color selector.
|
|
261
|
+
* @example
|
|
262
|
+
* ```
|
|
263
|
+
colorExample: Value.color({
|
|
264
|
+
// required
|
|
265
|
+
name: 'Color Example',
|
|
266
|
+
required: false,
|
|
267
|
+
default: null,
|
|
268
|
+
|
|
269
|
+
// optional
|
|
270
|
+
description: null,
|
|
271
|
+
warning: null,
|
|
272
|
+
immutable: false,
|
|
273
|
+
}),
|
|
274
|
+
* ```
|
|
275
|
+
*/
|
|
176
276
|
static color<Required extends boolean>(a: {
|
|
177
277
|
name: string;
|
|
178
278
|
description?: string | null;
|
|
@@ -191,15 +291,35 @@ export declare class Value<Type, Store> {
|
|
|
191
291
|
* @default false
|
|
192
292
|
*/
|
|
193
293
|
immutable?: boolean;
|
|
194
|
-
}): Value<AsRequired<string, Required
|
|
195
|
-
static dynamicColor
|
|
294
|
+
}): Value<AsRequired<string, Required>>;
|
|
295
|
+
static dynamicColor(getA: LazyBuild<{
|
|
196
296
|
name: string;
|
|
197
297
|
description?: string | null;
|
|
198
298
|
warning?: string | null;
|
|
199
299
|
default: string | null;
|
|
200
300
|
required: boolean;
|
|
201
301
|
disabled?: false | string;
|
|
202
|
-
}>): Value<string | null
|
|
302
|
+
}>): Value<string | null>;
|
|
303
|
+
/**
|
|
304
|
+
* @description Displays a browser-native date/time selector.
|
|
305
|
+
* @example
|
|
306
|
+
* ```
|
|
307
|
+
datetimeExample: Value.datetime({
|
|
308
|
+
// required
|
|
309
|
+
name: 'Datetime Example',
|
|
310
|
+
required: false,
|
|
311
|
+
default: null,
|
|
312
|
+
|
|
313
|
+
// optional
|
|
314
|
+
description: null,
|
|
315
|
+
warning: null,
|
|
316
|
+
immutable: false,
|
|
317
|
+
inputmode: 'datetime-local',
|
|
318
|
+
min: null,
|
|
319
|
+
max: null,
|
|
320
|
+
}),
|
|
321
|
+
* ```
|
|
322
|
+
*/
|
|
203
323
|
static datetime<Required extends boolean>(a: {
|
|
204
324
|
name: string;
|
|
205
325
|
description?: string | null;
|
|
@@ -225,8 +345,8 @@ export declare class Value<Type, Store> {
|
|
|
225
345
|
* @default false
|
|
226
346
|
*/
|
|
227
347
|
immutable?: boolean;
|
|
228
|
-
}): Value<AsRequired<string, Required
|
|
229
|
-
static dynamicDatetime
|
|
348
|
+
}): Value<AsRequired<string, Required>>;
|
|
349
|
+
static dynamicDatetime(getA: LazyBuild<{
|
|
230
350
|
name: string;
|
|
231
351
|
description?: string | null;
|
|
232
352
|
warning?: string | null;
|
|
@@ -236,7 +356,28 @@ export declare class Value<Type, Store> {
|
|
|
236
356
|
min?: string | null;
|
|
237
357
|
max?: string | null;
|
|
238
358
|
disabled?: false | string;
|
|
239
|
-
}>): Value<string | null
|
|
359
|
+
}>): Value<string | null>;
|
|
360
|
+
/**
|
|
361
|
+
* @description Displays a select modal with radio buttons, allowing for a single selection.
|
|
362
|
+
* @example
|
|
363
|
+
* ```
|
|
364
|
+
selectExample: Value.select({
|
|
365
|
+
// required
|
|
366
|
+
name: 'Select Example',
|
|
367
|
+
default: 'radio1',
|
|
368
|
+
values: {
|
|
369
|
+
radio1: 'Radio 1',
|
|
370
|
+
radio2: 'Radio 2',
|
|
371
|
+
},
|
|
372
|
+
|
|
373
|
+
// optional
|
|
374
|
+
description: null,
|
|
375
|
+
warning: null,
|
|
376
|
+
immutable: false,
|
|
377
|
+
disabled: false,
|
|
378
|
+
}),
|
|
379
|
+
* ```
|
|
380
|
+
*/
|
|
240
381
|
static select<Values extends Record<string, string>>(a: {
|
|
241
382
|
name: string;
|
|
242
383
|
description?: string | null;
|
|
@@ -266,15 +407,38 @@ export declare class Value<Type, Store> {
|
|
|
266
407
|
* @default false
|
|
267
408
|
*/
|
|
268
409
|
immutable?: boolean;
|
|
269
|
-
}): Value<keyof Values & string
|
|
270
|
-
static dynamicSelect
|
|
410
|
+
}): Value<keyof Values & string>;
|
|
411
|
+
static dynamicSelect(getA: LazyBuild<{
|
|
271
412
|
name: string;
|
|
272
413
|
description?: string | null;
|
|
273
414
|
warning?: string | null;
|
|
274
415
|
default: string;
|
|
275
416
|
values: Record<string, string>;
|
|
276
417
|
disabled?: false | string | string[];
|
|
277
|
-
}>): Value<string
|
|
418
|
+
}>): Value<string>;
|
|
419
|
+
/**
|
|
420
|
+
* @description Displays a select modal with checkboxes, allowing for multiple selections.
|
|
421
|
+
* @example
|
|
422
|
+
* ```
|
|
423
|
+
multiselectExample: Value.multiselect({
|
|
424
|
+
// required
|
|
425
|
+
name: 'Multiselect Example',
|
|
426
|
+
values: {
|
|
427
|
+
option1: 'Option 1',
|
|
428
|
+
option2: 'Option 2',
|
|
429
|
+
},
|
|
430
|
+
default: [],
|
|
431
|
+
|
|
432
|
+
// optional
|
|
433
|
+
description: null,
|
|
434
|
+
warning: null,
|
|
435
|
+
immutable: false,
|
|
436
|
+
disabled: false,
|
|
437
|
+
minlength: null,
|
|
438
|
+
maxLength: null,
|
|
439
|
+
}),
|
|
440
|
+
* ```
|
|
441
|
+
*/
|
|
278
442
|
static multiselect<Values extends Record<string, string>>(a: {
|
|
279
443
|
name: string;
|
|
280
444
|
description?: string | null;
|
|
@@ -303,8 +467,8 @@ export declare class Value<Type, Store> {
|
|
|
303
467
|
* @default false
|
|
304
468
|
*/
|
|
305
469
|
immutable?: boolean;
|
|
306
|
-
}): Value<(keyof Values)[]
|
|
307
|
-
static dynamicMultiselect
|
|
470
|
+
}): Value<(keyof Values)[]>;
|
|
471
|
+
static dynamicMultiselect(getA: LazyBuild<{
|
|
308
472
|
name: string;
|
|
309
473
|
description?: string | null;
|
|
310
474
|
warning?: string | null;
|
|
@@ -313,17 +477,63 @@ export declare class Value<Type, Store> {
|
|
|
313
477
|
minLength?: number | null;
|
|
314
478
|
maxLength?: number | null;
|
|
315
479
|
disabled?: false | string | string[];
|
|
316
|
-
}>): Value<string[]
|
|
317
|
-
|
|
480
|
+
}>): Value<string[]>;
|
|
481
|
+
/**
|
|
482
|
+
* @description Display a collapsable grouping of additional fields, a "sub form". The second value is the inputSpec spec for the sub form.
|
|
483
|
+
* @example
|
|
484
|
+
* ```
|
|
485
|
+
objectExample: Value.object(
|
|
486
|
+
{
|
|
487
|
+
// required
|
|
488
|
+
name: 'Object Example',
|
|
489
|
+
|
|
490
|
+
// optional
|
|
491
|
+
description: null,
|
|
492
|
+
warning: null,
|
|
493
|
+
},
|
|
494
|
+
InputSpec.of({}),
|
|
495
|
+
),
|
|
496
|
+
* ```
|
|
497
|
+
*/
|
|
498
|
+
static object<Type extends Record<string, any>>(a: {
|
|
318
499
|
name: string;
|
|
319
500
|
description?: string | null;
|
|
320
|
-
}, spec: InputSpec<Type
|
|
501
|
+
}, spec: InputSpec<Type>): Value<Type>;
|
|
502
|
+
/**
|
|
503
|
+
* @description Displays a dropdown, allowing for a single selection. Depending on the selection, a different object ("sub form") is presented.
|
|
504
|
+
* @example
|
|
505
|
+
* ```
|
|
506
|
+
unionExample: Value.union(
|
|
507
|
+
{
|
|
508
|
+
// required
|
|
509
|
+
name: 'Union Example',
|
|
510
|
+
default: 'option1',
|
|
511
|
+
|
|
512
|
+
// optional
|
|
513
|
+
description: null,
|
|
514
|
+
warning: null,
|
|
515
|
+
disabled: false,
|
|
516
|
+
immutable: false,
|
|
517
|
+
},
|
|
518
|
+
Variants.of({
|
|
519
|
+
option1: {
|
|
520
|
+
name: 'Option 1',
|
|
521
|
+
spec: InputSpec.of({}),
|
|
522
|
+
},
|
|
523
|
+
option2: {
|
|
524
|
+
name: 'Option 2',
|
|
525
|
+
spec: InputSpec.of({}),
|
|
526
|
+
},
|
|
527
|
+
}),
|
|
528
|
+
),
|
|
529
|
+
* ```
|
|
530
|
+
*/
|
|
321
531
|
static union<VariantValues extends {
|
|
322
532
|
[K in string]: {
|
|
323
533
|
name: string;
|
|
324
|
-
spec: InputSpec<any
|
|
534
|
+
spec: InputSpec<any>;
|
|
325
535
|
};
|
|
326
|
-
}
|
|
536
|
+
}>(a: {
|
|
327
537
|
name: string;
|
|
328
538
|
description?: string | null;
|
|
329
539
|
/** Presents a warning prompt before permitting the value to change. */
|
|
@@ -339,47 +549,102 @@ export declare class Value<Type, Store> {
|
|
|
339
549
|
* @default false
|
|
340
550
|
*/
|
|
341
551
|
immutable?: boolean;
|
|
342
|
-
}, aVariants: Variants<VariantValues
|
|
552
|
+
}, aVariants: Variants<VariantValues>): Value<import("./variants").UnionRes<VariantValues, keyof VariantValues & string>>;
|
|
343
553
|
static filteredUnion<VariantValues extends {
|
|
344
554
|
[K in string]: {
|
|
345
555
|
name: string;
|
|
346
|
-
spec: InputSpec<any
|
|
556
|
+
spec: InputSpec<any>;
|
|
347
557
|
};
|
|
348
|
-
}
|
|
558
|
+
}>(getDisabledFn: LazyBuild<string[] | false | string>, a: {
|
|
349
559
|
name: string;
|
|
350
560
|
description?: string | null;
|
|
351
561
|
warning?: string | null;
|
|
352
562
|
default: keyof VariantValues & string;
|
|
353
|
-
}, aVariants: Variants<VariantValues
|
|
563
|
+
}, aVariants: Variants<VariantValues>): Value<import("./variants").UnionRes<VariantValues, keyof VariantValues & string>>;
|
|
354
564
|
static dynamicUnion<VariantValues extends {
|
|
355
565
|
[K in string]: {
|
|
356
566
|
name: string;
|
|
357
|
-
spec: InputSpec<any
|
|
567
|
+
spec: InputSpec<any>;
|
|
358
568
|
};
|
|
359
|
-
}
|
|
569
|
+
}>(getA: LazyBuild<{
|
|
360
570
|
name: string;
|
|
361
571
|
description?: string | null;
|
|
362
572
|
warning?: string | null;
|
|
363
573
|
default: keyof VariantValues & string;
|
|
364
574
|
disabled: string[] | false | string;
|
|
365
|
-
}>, aVariants: Variants<VariantValues
|
|
366
|
-
static list<Type, Store>(a: List<Type, Store>): Value<Type, Store>;
|
|
367
|
-
static hidden<T>(parser?: Parser<unknown, T>): Value<T, never>;
|
|
368
|
-
map<U>(fn: (value: Type) => U): Value<U, Store>;
|
|
575
|
+
}>, aVariants: Variants<VariantValues>): Value<import("./variants").UnionRes<VariantValues, keyof VariantValues & string>>;
|
|
369
576
|
/**
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
577
|
+
* @description Presents an interface to add/remove/edit items in a list.
|
|
578
|
+
* @example
|
|
579
|
+
* In this example, we create a list of text inputs.
|
|
580
|
+
*
|
|
581
|
+
* ```
|
|
582
|
+
listExampleText: Value.list(
|
|
583
|
+
List.text(
|
|
584
|
+
{
|
|
585
|
+
// required
|
|
586
|
+
name: 'Text List',
|
|
587
|
+
|
|
588
|
+
// optional
|
|
589
|
+
description: null,
|
|
590
|
+
warning: null,
|
|
591
|
+
default: [],
|
|
592
|
+
minLength: null,
|
|
593
|
+
maxLength: null,
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
// required
|
|
597
|
+
patterns: [],
|
|
598
|
+
|
|
599
|
+
// optional
|
|
600
|
+
placeholder: null,
|
|
601
|
+
generate: null,
|
|
602
|
+
inputmode: 'url',
|
|
603
|
+
masked: false,
|
|
604
|
+
minLength: null,
|
|
605
|
+
maxLength: null,
|
|
606
|
+
},
|
|
607
|
+
),
|
|
608
|
+
),
|
|
609
|
+
* ```
|
|
610
|
+
* @example
|
|
611
|
+
* In this example, we create a list of objects.
|
|
612
|
+
*
|
|
613
|
+
* ```
|
|
614
|
+
listExampleObject: Value.list(
|
|
615
|
+
List.obj(
|
|
616
|
+
{
|
|
617
|
+
// required
|
|
618
|
+
name: 'Object List',
|
|
619
|
+
|
|
620
|
+
// optional
|
|
621
|
+
description: null,
|
|
622
|
+
warning: null,
|
|
623
|
+
default: [],
|
|
624
|
+
minLength: null,
|
|
625
|
+
maxLength: null,
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
// required
|
|
629
|
+
spec: InputSpec.of({}),
|
|
377
630
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
631
|
+
// optional
|
|
632
|
+
displayAs: null,
|
|
633
|
+
uniqueBy: null,
|
|
634
|
+
},
|
|
635
|
+
),
|
|
636
|
+
),
|
|
637
|
+
* ```
|
|
638
|
+
*/
|
|
639
|
+
static list<Type>(a: List<Type>): Value<Type>;
|
|
640
|
+
/**
|
|
641
|
+
* @description Provides a way to define a hidden field with a static value. Useful for tracking
|
|
642
|
+
* @example
|
|
643
|
+
* ```
|
|
644
|
+
hiddenExample: Value.hidden(),
|
|
645
|
+
* ```
|
|
382
646
|
*/
|
|
383
|
-
|
|
647
|
+
static hidden<T>(parser?: Parser<unknown, T>): Value<T>;
|
|
648
|
+
map<U>(fn: (value: Type) => U): Value<U>;
|
|
384
649
|
}
|
|
385
650
|
export {};
|