@start9labs/start-sdk 0.4.0-beta.49 → 0.4.0-beta.50
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 +16 -1
- package/base/lib/actions/input/builder/inputSpec.d.ts +17 -5
- package/base/lib/actions/input/builder/inputSpec.js +19 -0
- package/base/lib/actions/input/builder/inputSpec.js.map +1 -1
- package/base/lib/actions/input/builder/inputSpecTools.d.ts +173 -0
- package/base/lib/actions/input/builder/inputSpecTools.js +16 -0
- package/base/lib/actions/input/builder/inputSpecTools.js.map +1 -0
- package/base/lib/actions/input/builder/list.d.ts +6 -6
- package/base/lib/actions/input/builder/list.js.map +1 -1
- package/base/lib/actions/input/builder/value.d.ts +43 -44
- package/base/lib/actions/input/builder/value.js +2 -2
- package/base/lib/actions/input/builder/value.js.map +1 -1
- package/base/lib/actions/input/builder/variants.d.ts +3 -3
- 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/setupActions.d.ts +2 -0
- package/base/lib/actions/setupActions.js.map +1 -1
- package/base/lib/interfaces/setupExportedUrls.d.ts +7 -0
- package/base/lib/interfaces/setupExportedUrls.js +27 -0
- package/base/lib/interfaces/setupExportedUrls.js.map +1 -0
- package/base/lib/osBindings/GetActionInputParams.d.ts +1 -0
- package/base/lib/osBindings/HostnameInfo.d.ts +1 -1
- package/base/lib/osBindings/HostnameMetadata.d.ts +5 -1
- package/base/lib/osBindings/Manifest.d.ts +2 -0
- package/base/lib/osBindings/PackageDataEntry.d.ts +2 -0
- package/base/lib/osBindings/PackagePlugin.d.ts +4 -0
- package/base/lib/osBindings/PackagePlugin.js +3 -0
- package/base/lib/osBindings/PackagePlugin.js.map +1 -0
- package/base/lib/osBindings/PackageVersionInfo.d.ts +2 -0
- package/base/lib/osBindings/PluginHostnameInfo.d.ts +12 -0
- package/base/lib/osBindings/PluginHostnameInfo.js +3 -0
- package/base/lib/osBindings/PluginHostnameInfo.js.map +1 -0
- package/base/lib/osBindings/PluginId.d.ts +1 -0
- package/base/lib/osBindings/PluginId.js +4 -0
- package/base/lib/osBindings/PluginId.js.map +1 -0
- package/base/lib/osBindings/UrlPluginClearUrlsParams.d.ts +4 -0
- package/base/lib/osBindings/UrlPluginClearUrlsParams.js +3 -0
- package/base/lib/osBindings/UrlPluginClearUrlsParams.js.map +1 -0
- package/base/lib/osBindings/UrlPluginExportUrlParams.d.ts +7 -0
- package/base/lib/osBindings/UrlPluginExportUrlParams.js +3 -0
- package/base/lib/osBindings/UrlPluginExportUrlParams.js.map +1 -0
- package/base/lib/osBindings/UrlPluginRegisterParams.d.ts +4 -0
- package/base/lib/osBindings/UrlPluginRegisterParams.js +3 -0
- package/base/lib/osBindings/UrlPluginRegisterParams.js.map +1 -0
- package/base/lib/osBindings/UrlPluginRegistration.d.ts +4 -0
- package/base/lib/osBindings/UrlPluginRegistration.js +3 -0
- package/base/lib/osBindings/UrlPluginRegistration.js.map +1 -0
- package/base/lib/osBindings/index.d.ts +7 -0
- package/base/lib/types/ManifestTypes.d.ts +4 -0
- package/base/lib/util/getServiceInterface.js +10 -10
- package/base/lib/util/getServiceInterface.js.map +1 -1
- package/package/lib/StartSdk.d.ts +39 -8
- package/package/lib/StartSdk.js +19 -0
- package/package/lib/StartSdk.js.map +1 -1
- package/package/lib/manifest/setupManifest.js +1 -0
- package/package/lib/manifest/setupManifest.js.map +1 -1
- package/package/lib/test/output.sdk.d.ts +5 -2
- package/package/package.json +1 -1
- package/package.json +1 -1
package/base/lib/Effects.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ActionId, ActionInput, ActionMetadata, SetMainStatus, DependencyRequirement, CheckDependenciesResult, SetHealth, BindParams, HostId, NetInfo, Host, ExportServiceInterfaceParams, ServiceInterface, CreateTaskParams, MountParams, StatusInfo, Manifest } from './osBindings';
|
|
2
|
-
import { PackageId, Dependencies, ServiceInterfaceId, SmtpValue, ActionResult } from './types';
|
|
2
|
+
import { PackageId, Dependencies, ServiceInterfaceId, SmtpValue, ActionResult, PluginHostnameInfo } from './types';
|
|
3
3
|
/** Used to reach out from the pure js runtime */
|
|
4
4
|
export type Effects = {
|
|
5
5
|
readonly eventId: string | null;
|
|
@@ -126,6 +126,21 @@ export type Effects = {
|
|
|
126
126
|
clearServiceInterfaces(options: {
|
|
127
127
|
except: ServiceInterfaceId[];
|
|
128
128
|
}): Promise<null>;
|
|
129
|
+
plugin: {
|
|
130
|
+
url: {
|
|
131
|
+
register(options: {
|
|
132
|
+
tableAction: ActionId;
|
|
133
|
+
}): Promise<null>;
|
|
134
|
+
exportUrl(options: {
|
|
135
|
+
hostnameInfo: PluginHostnameInfo;
|
|
136
|
+
removeAction: ActionId | null;
|
|
137
|
+
overflowActions: ActionId[];
|
|
138
|
+
}): Promise<null>;
|
|
139
|
+
clearUrls(options: {
|
|
140
|
+
except: PluginHostnameInfo[];
|
|
141
|
+
}): Promise<null>;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
129
144
|
/** Returns a PEM encoded fullchain for the hostnames specified */
|
|
130
145
|
getSslCertificate: (options: {
|
|
131
146
|
hostnames: string[];
|
|
@@ -3,16 +3,18 @@ import { Value } from './value';
|
|
|
3
3
|
import { Effects } from '../../../Effects';
|
|
4
4
|
import { Parser } from 'ts-matches';
|
|
5
5
|
import { DeepPartial } from '../../../types';
|
|
6
|
-
|
|
6
|
+
import { InputSpecTools } from './inputSpecTools';
|
|
7
|
+
export type LazyBuildOptions<Type> = {
|
|
7
8
|
effects: Effects;
|
|
9
|
+
prefill: DeepPartial<Type> | null;
|
|
8
10
|
};
|
|
9
|
-
export type LazyBuild<ExpectedOut> = (options: LazyBuildOptions) => Promise<ExpectedOut> | ExpectedOut;
|
|
11
|
+
export type LazyBuild<ExpectedOut, Type> = (options: LazyBuildOptions<Type>) => Promise<ExpectedOut> | ExpectedOut;
|
|
10
12
|
export type ExtractInputSpecType<A extends InputSpec<Record<string, any>, any>> = A extends InputSpec<infer B, any> ? B : never;
|
|
11
13
|
export type ExtractInputSpecStaticValidatedAs<A extends InputSpec<any, Record<string, any>>> = A extends InputSpec<any, infer B> ? B : never;
|
|
12
14
|
export type InputSpecOf<A extends Record<string, any>> = {
|
|
13
15
|
[K in keyof A]: Value<A[K]>;
|
|
14
16
|
};
|
|
15
|
-
export type MaybeLazyValues<A> = LazyBuild<A> | A;
|
|
17
|
+
export type MaybeLazyValues<A, T> = LazyBuild<A, T> | A;
|
|
16
18
|
/**
|
|
17
19
|
* InputSpecs are the specs that are used by the os input specification form for this service.
|
|
18
20
|
* Here is an example of a simple input specification
|
|
@@ -75,11 +77,21 @@ export declare class InputSpec<Type extends StaticValidatedAs, StaticValidatedAs
|
|
|
75
77
|
private constructor();
|
|
76
78
|
_TYPE: Type;
|
|
77
79
|
_PARTIAL: DeepPartial<Type>;
|
|
78
|
-
build(options: LazyBuildOptions): Promise<{
|
|
80
|
+
build<OuterType>(options: LazyBuildOptions<OuterType>): Promise<{
|
|
79
81
|
spec: {
|
|
80
82
|
[K in keyof Type]: ValueSpec;
|
|
81
83
|
};
|
|
82
84
|
validator: Parser<unknown, Type>;
|
|
83
85
|
}>;
|
|
84
|
-
|
|
86
|
+
addKey<Key extends string, V extends Value<any, any, any>>(key: Key, build: V | ((tools: InputSpecTools<Type>) => V)): InputSpec<Type & {
|
|
87
|
+
[K in Key]: V extends Value<infer T, any, any> ? T : never;
|
|
88
|
+
}, StaticValidatedAs & {
|
|
89
|
+
[K in Key]: V extends Value<any, infer S, any> ? S : never;
|
|
90
|
+
}>;
|
|
91
|
+
add<AddSpec extends Record<string, Value<any, any, any>>>(build: AddSpec | ((tools: InputSpecTools<Type>) => AddSpec)): InputSpec<Type & {
|
|
92
|
+
[K in keyof AddSpec]: AddSpec[K] extends Value<infer T, any, any> ? T : never;
|
|
93
|
+
}, StaticValidatedAs & {
|
|
94
|
+
[K in keyof AddSpec]: AddSpec[K] extends Value<any, infer S, any> ? S : never;
|
|
95
|
+
}>;
|
|
96
|
+
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, unknown> ? T : never; }, { [K_1 in keyof Spec]: Spec[K_1] extends Value<any, infer T_1, unknown> ? T_1 : never; }>;
|
|
85
97
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InputSpec = void 0;
|
|
4
4
|
const ts_matches_1 = require("ts-matches");
|
|
5
|
+
const inputSpecTools_1 = require("./inputSpecTools");
|
|
5
6
|
/**
|
|
6
7
|
* InputSpecs are the specs that are used by the os input specification form for this service.
|
|
7
8
|
* Here is an example of a simple input specification
|
|
@@ -78,6 +79,24 @@ class InputSpec {
|
|
|
78
79
|
validator: (0, ts_matches_1.object)(validator),
|
|
79
80
|
};
|
|
80
81
|
}
|
|
82
|
+
addKey(key, build) {
|
|
83
|
+
const value = build instanceof Function ? build((0, inputSpecTools_1.createInputSpecTools)()) : build;
|
|
84
|
+
const newSpec = { ...this.spec, [key]: value };
|
|
85
|
+
const newValidator = (0, ts_matches_1.object)(Object.fromEntries(Object.entries(newSpec).map(([k, v]) => [
|
|
86
|
+
k,
|
|
87
|
+
v.validator,
|
|
88
|
+
])));
|
|
89
|
+
return new InputSpec(newSpec, newValidator);
|
|
90
|
+
}
|
|
91
|
+
add(build) {
|
|
92
|
+
const addedValues = build instanceof Function ? build((0, inputSpecTools_1.createInputSpecTools)()) : build;
|
|
93
|
+
const newSpec = { ...this.spec, ...addedValues };
|
|
94
|
+
const newValidator = (0, ts_matches_1.object)(Object.fromEntries(Object.entries(newSpec).map(([k, v]) => [
|
|
95
|
+
k,
|
|
96
|
+
v.validator,
|
|
97
|
+
])));
|
|
98
|
+
return new InputSpec(newSpec, newValidator);
|
|
99
|
+
}
|
|
81
100
|
static of(spec) {
|
|
82
101
|
const validator = (0, ts_matches_1.object)(Object.fromEntries(Object.entries(spec).map(([k, v]) => [k, v.validator])));
|
|
83
102
|
return new InputSpec(spec, validator);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputSpec.js","sourceRoot":"","sources":["../../../../../../base/lib/actions/input/builder/inputSpec.ts"],"names":[],"mappings":";;;AAIA,2CAA2C;
|
|
1
|
+
{"version":3,"file":"inputSpec.js","sourceRoot":"","sources":["../../../../../../base/lib/actions/input/builder/inputSpec.ts"],"names":[],"mappings":";;;AAIA,2CAA2C;AAE3C,qDAAuE;AA4BvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,MAAa,SAAS;IAIpB,YACmB,IAEhB,EACe,SAA6C;QAH5C,SAAI,GAAJ,IAAI,CAEpB;QACe,cAAS,GAAT,SAAS,CAAoC;QAExD,UAAK,GAAS,IAAmB,CAAA;QACjC,aAAQ,GAAsB,IAAgC,CAAA;IAFlE,CAAC;IAGJ,KAAK,CAAC,KAAK,CAAY,OAAoC;QAMzD,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,CACJ,GAAQ,EACR,KAA+C;QAO/C,MAAM,KAAK,GACT,KAAK,YAAY,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAA,qCAAoB,GAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;QACzE,MAAM,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAS,CAAA;QACrD,MAAM,YAAY,GAAG,IAAA,mBAAM,EACzB,MAAM,CAAC,WAAW,CAChB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;YACtC,CAAC;YACA,CAAgB,CAAC,SAAS;SAC5B,CAAC,CACH,CACF,CAAA;QACD,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE,YAAmB,CAAC,CAAA;IACpD,CAAC;IAED,GAAG,CACD,KAA2D;QAa3D,MAAM,WAAW,GACf,KAAK,YAAY,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAA,qCAAoB,GAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;QACzE,MAAM,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,GAAG,WAAW,EAAS,CAAA;QACvD,MAAM,YAAY,GAAG,IAAA,mBAAM,EACzB,MAAM,CAAC,WAAW,CAChB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;YACtC,CAAC;YACA,CAAgB,CAAC,SAAS;SAC5B,CAAC,CACH,CACF,CAAA;QACD,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE,YAAmB,CAAC,CAAA;IACpD,CAAC;IAED,MAAM,CAAC,EAAE,CAA+C,IAAU;QAChE,MAAM,SAAS,GAAG,IAAA,mBAAM,EACtB,MAAM,CAAC,WAAW,CAChB,MAAM,CAAC,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,CAWlB,IAAI,EAAE,SAAgB,CAAC,CAAA;IAC3B,CAAC;CACF;AAzGD,8BAyGC"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { InputSpec, LazyBuild } from './inputSpec';
|
|
2
|
+
import { AsRequired, FileInfo, Value } from './value';
|
|
3
|
+
import { List } from './list';
|
|
4
|
+
import { UnionRes, UnionResStaticValidatedAs, Variants } from './variants';
|
|
5
|
+
import { Pattern, RandomString, ValueSpecDatetime, ValueSpecText } from '../inputSpecTypes';
|
|
6
|
+
import { DefaultString } from '../inputSpecTypes';
|
|
7
|
+
import { Parser } from 'ts-matches';
|
|
8
|
+
import { ListValueSpecText } from '../inputSpecTypes';
|
|
9
|
+
export interface InputSpecTools<OuterType> {
|
|
10
|
+
Value: BoundValue<OuterType>;
|
|
11
|
+
Variants: typeof Variants;
|
|
12
|
+
InputSpec: typeof InputSpec;
|
|
13
|
+
List: BoundList<OuterType>;
|
|
14
|
+
}
|
|
15
|
+
export interface BoundValue<OuterType> {
|
|
16
|
+
toggle: typeof Value.toggle;
|
|
17
|
+
text: typeof Value.text;
|
|
18
|
+
textarea: typeof Value.textarea;
|
|
19
|
+
number: typeof Value.number;
|
|
20
|
+
color: typeof Value.color;
|
|
21
|
+
datetime: typeof Value.datetime;
|
|
22
|
+
select: typeof Value.select;
|
|
23
|
+
multiselect: typeof Value.multiselect;
|
|
24
|
+
object: typeof Value.object;
|
|
25
|
+
file: typeof Value.file;
|
|
26
|
+
list: typeof Value.list;
|
|
27
|
+
hidden: typeof Value.hidden;
|
|
28
|
+
union: typeof Value.union;
|
|
29
|
+
dynamicToggle(a: LazyBuild<{
|
|
30
|
+
name: string;
|
|
31
|
+
description?: string | null;
|
|
32
|
+
warning?: string | null;
|
|
33
|
+
default: boolean;
|
|
34
|
+
disabled?: false | string;
|
|
35
|
+
}, OuterType>): Value<boolean, boolean, OuterType>;
|
|
36
|
+
dynamicText<Required extends boolean>(getA: LazyBuild<{
|
|
37
|
+
name: string;
|
|
38
|
+
description?: string | null;
|
|
39
|
+
warning?: string | null;
|
|
40
|
+
default: DefaultString | null;
|
|
41
|
+
required: Required;
|
|
42
|
+
masked?: boolean;
|
|
43
|
+
placeholder?: string | null;
|
|
44
|
+
minLength?: number | null;
|
|
45
|
+
maxLength?: number | null;
|
|
46
|
+
patterns?: Pattern[];
|
|
47
|
+
inputmode?: ValueSpecText['inputmode'];
|
|
48
|
+
disabled?: string | false;
|
|
49
|
+
generate?: null | RandomString;
|
|
50
|
+
}, OuterType>): Value<AsRequired<string, Required>, string | null, OuterType>;
|
|
51
|
+
dynamicTextarea<Required extends boolean>(getA: LazyBuild<{
|
|
52
|
+
name: string;
|
|
53
|
+
description?: string | null;
|
|
54
|
+
warning?: string | null;
|
|
55
|
+
default: string | null;
|
|
56
|
+
required: Required;
|
|
57
|
+
minLength?: number | null;
|
|
58
|
+
maxLength?: number | null;
|
|
59
|
+
patterns?: Pattern[];
|
|
60
|
+
minRows?: number;
|
|
61
|
+
maxRows?: number;
|
|
62
|
+
placeholder?: string | null;
|
|
63
|
+
disabled?: false | string;
|
|
64
|
+
}, OuterType>): Value<AsRequired<string, Required>, string | null, OuterType>;
|
|
65
|
+
dynamicNumber<Required extends boolean>(getA: LazyBuild<{
|
|
66
|
+
name: string;
|
|
67
|
+
description?: string | null;
|
|
68
|
+
warning?: string | null;
|
|
69
|
+
default: number | null;
|
|
70
|
+
required: Required;
|
|
71
|
+
min?: number | null;
|
|
72
|
+
max?: number | null;
|
|
73
|
+
step?: number | null;
|
|
74
|
+
integer: boolean;
|
|
75
|
+
units?: string | null;
|
|
76
|
+
placeholder?: string | null;
|
|
77
|
+
disabled?: false | string;
|
|
78
|
+
}, OuterType>): Value<AsRequired<number, Required>, number | null, OuterType>;
|
|
79
|
+
dynamicColor<Required extends boolean>(getA: LazyBuild<{
|
|
80
|
+
name: string;
|
|
81
|
+
description?: string | null;
|
|
82
|
+
warning?: string | null;
|
|
83
|
+
default: string | null;
|
|
84
|
+
required: Required;
|
|
85
|
+
disabled?: false | string;
|
|
86
|
+
}, OuterType>): Value<AsRequired<string, Required>, string | null, OuterType>;
|
|
87
|
+
dynamicDatetime<Required extends boolean>(getA: LazyBuild<{
|
|
88
|
+
name: string;
|
|
89
|
+
description?: string | null;
|
|
90
|
+
warning?: string | null;
|
|
91
|
+
default: string | null;
|
|
92
|
+
required: Required;
|
|
93
|
+
inputmode?: ValueSpecDatetime['inputmode'];
|
|
94
|
+
min?: string | null;
|
|
95
|
+
max?: string | null;
|
|
96
|
+
disabled?: false | string;
|
|
97
|
+
}, OuterType>): Value<AsRequired<string, Required>, string | null, OuterType>;
|
|
98
|
+
dynamicSelect<Values extends Record<string, string>>(getA: LazyBuild<{
|
|
99
|
+
name: string;
|
|
100
|
+
description?: string | null;
|
|
101
|
+
warning?: string | null;
|
|
102
|
+
default: string;
|
|
103
|
+
values: Values;
|
|
104
|
+
disabled?: false | string | string[];
|
|
105
|
+
}, OuterType>): Value<keyof Values & string, keyof Values & string, OuterType>;
|
|
106
|
+
dynamicMultiselect<Values extends Record<string, string>>(getA: LazyBuild<{
|
|
107
|
+
name: string;
|
|
108
|
+
description?: string | null;
|
|
109
|
+
warning?: string | null;
|
|
110
|
+
default: string[];
|
|
111
|
+
values: Values;
|
|
112
|
+
minLength?: number | null;
|
|
113
|
+
maxLength?: number | null;
|
|
114
|
+
disabled?: false | string | string[];
|
|
115
|
+
}, OuterType>): Value<(keyof Values & string)[], (keyof Values & string)[], OuterType>;
|
|
116
|
+
dynamicFile<Required extends boolean>(a: LazyBuild<{
|
|
117
|
+
name: string;
|
|
118
|
+
description?: string | null;
|
|
119
|
+
warning?: string | null;
|
|
120
|
+
extensions: string[];
|
|
121
|
+
required: Required;
|
|
122
|
+
}, OuterType>): Value<AsRequired<FileInfo, Required>, FileInfo | null, OuterType>;
|
|
123
|
+
dynamicUnion<VariantValues extends {
|
|
124
|
+
[K in string]: {
|
|
125
|
+
name: string;
|
|
126
|
+
spec: InputSpec<any>;
|
|
127
|
+
};
|
|
128
|
+
}>(getA: LazyBuild<{
|
|
129
|
+
name: string;
|
|
130
|
+
description?: string | null;
|
|
131
|
+
warning?: string | null;
|
|
132
|
+
variants: Variants<VariantValues>;
|
|
133
|
+
default: keyof VariantValues & string;
|
|
134
|
+
disabled: string[] | false | string;
|
|
135
|
+
}, OuterType>): Value<UnionRes<VariantValues>, UnionRes<VariantValues>, OuterType>;
|
|
136
|
+
dynamicUnion<StaticVariantValues extends {
|
|
137
|
+
[K in string]: {
|
|
138
|
+
name: string;
|
|
139
|
+
spec: InputSpec<any, any>;
|
|
140
|
+
};
|
|
141
|
+
}, VariantValues extends StaticVariantValues>(getA: LazyBuild<{
|
|
142
|
+
name: string;
|
|
143
|
+
description?: string | null;
|
|
144
|
+
warning?: string | null;
|
|
145
|
+
variants: Variants<VariantValues>;
|
|
146
|
+
default: keyof VariantValues & string;
|
|
147
|
+
disabled: string[] | false | string;
|
|
148
|
+
}, OuterType>, validator: Parser<unknown, UnionResStaticValidatedAs<StaticVariantValues>>): Value<UnionRes<VariantValues>, UnionResStaticValidatedAs<StaticVariantValues>, OuterType>;
|
|
149
|
+
dynamicHidden<T>(getParser: LazyBuild<Parser<unknown, T>, OuterType>): Value<T, T, OuterType>;
|
|
150
|
+
}
|
|
151
|
+
export interface BoundList<OuterType> {
|
|
152
|
+
text: typeof List.text;
|
|
153
|
+
obj: typeof List.obj;
|
|
154
|
+
dynamicText(getA: LazyBuild<{
|
|
155
|
+
name: string;
|
|
156
|
+
description?: string | null;
|
|
157
|
+
warning?: string | null;
|
|
158
|
+
default?: string[];
|
|
159
|
+
minLength?: number | null;
|
|
160
|
+
maxLength?: number | null;
|
|
161
|
+
disabled?: false | string;
|
|
162
|
+
generate?: null | RandomString;
|
|
163
|
+
spec: {
|
|
164
|
+
masked?: boolean;
|
|
165
|
+
placeholder?: string | null;
|
|
166
|
+
minLength?: number | null;
|
|
167
|
+
maxLength?: number | null;
|
|
168
|
+
patterns?: Pattern[];
|
|
169
|
+
inputmode?: ListValueSpecText['inputmode'];
|
|
170
|
+
};
|
|
171
|
+
}, OuterType>): List<string[], string[], OuterType>;
|
|
172
|
+
}
|
|
173
|
+
export declare function createInputSpecTools<OuterType>(): InputSpecTools<OuterType>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createInputSpecTools = createInputSpecTools;
|
|
4
|
+
const inputSpec_1 = require("./inputSpec");
|
|
5
|
+
const value_1 = require("./value");
|
|
6
|
+
const list_1 = require("./list");
|
|
7
|
+
const variants_1 = require("./variants");
|
|
8
|
+
function createInputSpecTools() {
|
|
9
|
+
return {
|
|
10
|
+
Value: value_1.Value,
|
|
11
|
+
Variants: variants_1.Variants,
|
|
12
|
+
InputSpec: inputSpec_1.InputSpec,
|
|
13
|
+
List: list_1.List,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=inputSpecTools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputSpecTools.js","sourceRoot":"","sources":["../../../../../../base/lib/actions/input/builder/inputSpecTools.ts"],"names":[],"mappings":";;AA0QA,oDAOC;AAjRD,2CAAkD;AAClD,mCAAqD;AACrD,iCAA6B;AAC7B,yCAA0E;AAuQ1E,SAAgB,oBAAoB;IAClC,OAAO;QACL,KAAK,EAAE,aAAqC;QAC5C,QAAQ,EAAR,mBAAQ;QACR,SAAS,EAAT,qBAAS;QACT,IAAI,EAAE,WAAmC;KAC1C,CAAA;AACH,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
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 extends StaticValidatedAs, StaticValidatedAs = Type> {
|
|
4
|
+
export declare class List<Type extends StaticValidatedAs, StaticValidatedAs = Type, OuterType = unknown> {
|
|
5
5
|
build: LazyBuild<{
|
|
6
6
|
spec: ValueSpecList;
|
|
7
7
|
validator: Parser<unknown, Type>;
|
|
8
|
-
}>;
|
|
8
|
+
}, OuterType>;
|
|
9
9
|
readonly validator: Parser<unknown, StaticValidatedAs>;
|
|
10
10
|
private constructor();
|
|
11
11
|
readonly _TYPE: Type;
|
|
@@ -48,8 +48,8 @@ export declare class List<Type extends StaticValidatedAs, StaticValidatedAs = Ty
|
|
|
48
48
|
* @description Displays a button that will generate a random string according to the provided charset and len attributes.
|
|
49
49
|
*/
|
|
50
50
|
generate?: null | RandomString;
|
|
51
|
-
}): List<string[], string[]>;
|
|
52
|
-
static dynamicText(getA: LazyBuild<{
|
|
51
|
+
}): List<string[], string[], unknown>;
|
|
52
|
+
static dynamicText<OuterType = unknown>(getA: LazyBuild<{
|
|
53
53
|
name: string;
|
|
54
54
|
description?: string | null;
|
|
55
55
|
warning?: string | null;
|
|
@@ -66,7 +66,7 @@ export declare class List<Type extends StaticValidatedAs, StaticValidatedAs = Ty
|
|
|
66
66
|
patterns?: Pattern[];
|
|
67
67
|
inputmode?: ListValueSpecText['inputmode'];
|
|
68
68
|
};
|
|
69
|
-
}>): List<string[], string[]>;
|
|
69
|
+
}, OuterType>): List<string[], string[], OuterType>;
|
|
70
70
|
static obj<Type extends StaticValidatedAs, StaticValidatedAs extends Record<string, any>>(a: {
|
|
71
71
|
name: string;
|
|
72
72
|
description?: string | null;
|
|
@@ -78,5 +78,5 @@ export declare class List<Type extends StaticValidatedAs, StaticValidatedAs = Ty
|
|
|
78
78
|
spec: InputSpec<Type, StaticValidatedAs>;
|
|
79
79
|
displayAs?: null | string;
|
|
80
80
|
uniqueBy?: null | UniqueBy;
|
|
81
|
-
}): List<Type[], StaticValidatedAs[]>;
|
|
81
|
+
}): List<Type[], StaticValidatedAs[], unknown>;
|
|
82
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../../base/lib/actions/input/builder/list.ts"],"names":[],"mappings":";;;AASA,2CAAoD;AAEpD,MAAa,IAAI;
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../../base/lib/actions/input/builder/list.ts"],"names":[],"mappings":"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"}
|
|
@@ -13,17 +13,17 @@ export declare const fileInfoParser: Parser<unknown, {
|
|
|
13
13
|
};
|
|
14
14
|
}>;
|
|
15
15
|
export type FileInfo = typeof fileInfoParser._TYPE;
|
|
16
|
-
type AsRequired<T, Required extends boolean> = Required extends true ? T : T | null;
|
|
17
|
-
export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = Type> {
|
|
16
|
+
export type AsRequired<T, Required extends boolean> = Required extends true ? T : T | null;
|
|
17
|
+
export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = Type, OuterType = unknown> {
|
|
18
18
|
build: LazyBuild<{
|
|
19
19
|
spec: ValueSpec;
|
|
20
20
|
validator: Parser<unknown, Type>;
|
|
21
|
-
}>;
|
|
21
|
+
}, OuterType>;
|
|
22
22
|
readonly validator: Parser<unknown, StaticValidatedAs>;
|
|
23
23
|
protected constructor(build: LazyBuild<{
|
|
24
24
|
spec: ValueSpec;
|
|
25
25
|
validator: Parser<unknown, Type>;
|
|
26
|
-
}>, validator: Parser<unknown, StaticValidatedAs>);
|
|
26
|
+
}, OuterType>, validator: Parser<unknown, StaticValidatedAs>);
|
|
27
27
|
_TYPE: Type;
|
|
28
28
|
_PARTIAL: DeepPartial<Type>;
|
|
29
29
|
/**
|
|
@@ -53,14 +53,14 @@ export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = T
|
|
|
53
53
|
* @default false
|
|
54
54
|
*/
|
|
55
55
|
immutable?: boolean;
|
|
56
|
-
}): Value<boolean, boolean>;
|
|
57
|
-
static dynamicToggle(a: LazyBuild<{
|
|
56
|
+
}): Value<boolean, boolean, unknown>;
|
|
57
|
+
static dynamicToggle<OuterType = unknown>(a: LazyBuild<{
|
|
58
58
|
name: string;
|
|
59
59
|
description?: string | null;
|
|
60
60
|
warning?: string | null;
|
|
61
61
|
default: boolean;
|
|
62
62
|
disabled?: false | string;
|
|
63
|
-
}>): Value<boolean, boolean>;
|
|
63
|
+
}, OuterType>): Value<boolean, boolean, OuterType>;
|
|
64
64
|
/**
|
|
65
65
|
* @description Displays a text input field
|
|
66
66
|
* @example
|
|
@@ -135,8 +135,8 @@ export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = T
|
|
|
135
135
|
* @description Displays a button that will generate a random string according to the provided charset and len attributes.
|
|
136
136
|
*/
|
|
137
137
|
generate?: RandomString | null;
|
|
138
|
-
}): Value<AsRequired<string, Required>, AsRequired<string, Required
|
|
139
|
-
static dynamicText<Required extends boolean>(getA: LazyBuild<{
|
|
138
|
+
}): Value<AsRequired<string, Required>, AsRequired<string, Required>, unknown>;
|
|
139
|
+
static dynamicText<Required extends boolean, OuterType = unknown>(getA: LazyBuild<{
|
|
140
140
|
name: string;
|
|
141
141
|
description?: string | null;
|
|
142
142
|
warning?: string | null;
|
|
@@ -150,7 +150,7 @@ export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = T
|
|
|
150
150
|
inputmode?: ValueSpecText['inputmode'];
|
|
151
151
|
disabled?: string | false;
|
|
152
152
|
generate?: null | RandomString;
|
|
153
|
-
}>): Value<AsRequired<string, Required>, string | null>;
|
|
153
|
+
}, OuterType>): Value<AsRequired<string, Required>, string | null, OuterType>;
|
|
154
154
|
/**
|
|
155
155
|
* @description Displays a large textarea field for long form entry.
|
|
156
156
|
* @example
|
|
@@ -206,8 +206,8 @@ export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = T
|
|
|
206
206
|
* @default false
|
|
207
207
|
*/
|
|
208
208
|
immutable?: boolean;
|
|
209
|
-
}): Value<AsRequired<string, Required>, AsRequired<string, Required
|
|
210
|
-
static dynamicTextarea<Required extends boolean>(getA: LazyBuild<{
|
|
209
|
+
}): Value<AsRequired<string, Required>, AsRequired<string, Required>, unknown>;
|
|
210
|
+
static dynamicTextarea<Required extends boolean, OuterType = unknown>(getA: LazyBuild<{
|
|
211
211
|
name: string;
|
|
212
212
|
description?: string | null;
|
|
213
213
|
warning?: string | null;
|
|
@@ -220,7 +220,7 @@ export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = T
|
|
|
220
220
|
maxRows?: number;
|
|
221
221
|
placeholder?: string | null;
|
|
222
222
|
disabled?: false | string;
|
|
223
|
-
}>): Value<AsRequired<string, Required>, string | null>;
|
|
223
|
+
}, OuterType>): Value<AsRequired<string, Required>, string | null, OuterType>;
|
|
224
224
|
/**
|
|
225
225
|
* @description Displays a number input field
|
|
226
226
|
* @example
|
|
@@ -278,8 +278,8 @@ export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = T
|
|
|
278
278
|
* @default false
|
|
279
279
|
*/
|
|
280
280
|
immutable?: boolean;
|
|
281
|
-
}): Value<AsRequired<number, Required>, AsRequired<number, Required
|
|
282
|
-
static dynamicNumber<Required extends boolean>(getA: LazyBuild<{
|
|
281
|
+
}): Value<AsRequired<number, Required>, AsRequired<number, Required>, unknown>;
|
|
282
|
+
static dynamicNumber<Required extends boolean, OuterType = unknown>(getA: LazyBuild<{
|
|
283
283
|
name: string;
|
|
284
284
|
description?: string | null;
|
|
285
285
|
warning?: string | null;
|
|
@@ -292,7 +292,7 @@ export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = T
|
|
|
292
292
|
units?: string | null;
|
|
293
293
|
placeholder?: string | null;
|
|
294
294
|
disabled?: false | string;
|
|
295
|
-
}>): Value<AsRequired<number, Required>, number | null>;
|
|
295
|
+
}, OuterType>): Value<AsRequired<number, Required>, number | null, OuterType>;
|
|
296
296
|
/**
|
|
297
297
|
* @description Displays a browser-native color selector.
|
|
298
298
|
* @example
|
|
@@ -328,15 +328,15 @@ export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = T
|
|
|
328
328
|
* @default false
|
|
329
329
|
*/
|
|
330
330
|
immutable?: boolean;
|
|
331
|
-
}): Value<AsRequired<string, Required>, AsRequired<string, Required
|
|
332
|
-
static dynamicColor<Required extends boolean>(getA: LazyBuild<{
|
|
331
|
+
}): Value<AsRequired<string, Required>, AsRequired<string, Required>, unknown>;
|
|
332
|
+
static dynamicColor<Required extends boolean, OuterType = unknown>(getA: LazyBuild<{
|
|
333
333
|
name: string;
|
|
334
334
|
description?: string | null;
|
|
335
335
|
warning?: string | null;
|
|
336
336
|
default: string | null;
|
|
337
337
|
required: Required;
|
|
338
338
|
disabled?: false | string;
|
|
339
|
-
}>): Value<AsRequired<string, Required>, string | null>;
|
|
339
|
+
}, OuterType>): Value<AsRequired<string, Required>, string | null, OuterType>;
|
|
340
340
|
/**
|
|
341
341
|
* @description Displays a browser-native date/time selector.
|
|
342
342
|
* @example
|
|
@@ -382,8 +382,8 @@ export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = T
|
|
|
382
382
|
* @default false
|
|
383
383
|
*/
|
|
384
384
|
immutable?: boolean;
|
|
385
|
-
}): Value<AsRequired<string, Required>, AsRequired<string, Required
|
|
386
|
-
static dynamicDatetime<Required extends boolean>(getA: LazyBuild<{
|
|
385
|
+
}): Value<AsRequired<string, Required>, AsRequired<string, Required>, unknown>;
|
|
386
|
+
static dynamicDatetime<Required extends boolean, OuterType = unknown>(getA: LazyBuild<{
|
|
387
387
|
name: string;
|
|
388
388
|
description?: string | null;
|
|
389
389
|
warning?: string | null;
|
|
@@ -393,7 +393,7 @@ export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = T
|
|
|
393
393
|
min?: string | null;
|
|
394
394
|
max?: string | null;
|
|
395
395
|
disabled?: false | string;
|
|
396
|
-
}>): Value<AsRequired<string, Required>, string | null>;
|
|
396
|
+
}, OuterType>): Value<AsRequired<string, Required>, string | null, OuterType>;
|
|
397
397
|
/**
|
|
398
398
|
* @description Displays a select modal with radio buttons, allowing for a single selection.
|
|
399
399
|
* @example
|
|
@@ -444,15 +444,15 @@ export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = T
|
|
|
444
444
|
* @default false
|
|
445
445
|
*/
|
|
446
446
|
immutable?: boolean;
|
|
447
|
-
}): Value<keyof Values & string, keyof Values & string>;
|
|
448
|
-
static dynamicSelect<Values extends Record<string, string
|
|
447
|
+
}): Value<keyof Values & string, keyof Values & string, unknown>;
|
|
448
|
+
static dynamicSelect<Values extends Record<string, string>, OuterType = unknown>(getA: LazyBuild<{
|
|
449
449
|
name: string;
|
|
450
450
|
description?: string | null;
|
|
451
451
|
warning?: string | null;
|
|
452
452
|
default: string;
|
|
453
453
|
values: Values;
|
|
454
454
|
disabled?: false | string | string[];
|
|
455
|
-
}>): Value<keyof Values & string, string>;
|
|
455
|
+
}, OuterType>): Value<keyof Values & string, keyof Values & string, OuterType>;
|
|
456
456
|
/**
|
|
457
457
|
* @description Displays a select modal with checkboxes, allowing for multiple selections.
|
|
458
458
|
* @example
|
|
@@ -504,8 +504,8 @@ export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = T
|
|
|
504
504
|
* @default false
|
|
505
505
|
*/
|
|
506
506
|
immutable?: boolean;
|
|
507
|
-
}): Value<(keyof Values & string)[], (keyof Values & string)[]>;
|
|
508
|
-
static dynamicMultiselect<Values extends Record<string, string
|
|
507
|
+
}): Value<(keyof Values & string)[], (keyof Values & string)[], unknown>;
|
|
508
|
+
static dynamicMultiselect<Values extends Record<string, string>, OuterType = unknown>(getA: LazyBuild<{
|
|
509
509
|
name: string;
|
|
510
510
|
description?: string | null;
|
|
511
511
|
warning?: string | null;
|
|
@@ -514,7 +514,7 @@ export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = T
|
|
|
514
514
|
minLength?: number | null;
|
|
515
515
|
maxLength?: number | null;
|
|
516
516
|
disabled?: false | string | string[];
|
|
517
|
-
}>): Value<(keyof Values & string)[], string[]>;
|
|
517
|
+
}, OuterType>): Value<(keyof Values & string)[], (keyof Values & string)[], OuterType>;
|
|
518
518
|
/**
|
|
519
519
|
* @description Display a collapsable grouping of additional fields, a "sub form". The second value is the inputSpec spec for the sub form.
|
|
520
520
|
* @example
|
|
@@ -535,7 +535,7 @@ export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = T
|
|
|
535
535
|
static object<Type extends StaticValidatedAs, StaticValidatedAs extends Record<string, any>>(a: {
|
|
536
536
|
name: string;
|
|
537
537
|
description?: string | null;
|
|
538
|
-
}, spec: InputSpec<Type, StaticValidatedAs>): Value<Type, StaticValidatedAs>;
|
|
538
|
+
}, spec: InputSpec<Type, StaticValidatedAs>): Value<Type, StaticValidatedAs, unknown>;
|
|
539
539
|
static file<Required extends boolean>(a: {
|
|
540
540
|
name: string;
|
|
541
541
|
description?: string | null;
|
|
@@ -554,14 +554,14 @@ export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = T
|
|
|
554
554
|
hash: string;
|
|
555
555
|
size: number;
|
|
556
556
|
};
|
|
557
|
-
}, Required
|
|
558
|
-
static dynamicFile<Required extends boolean>(a: LazyBuild<{
|
|
557
|
+
}, Required>, unknown>;
|
|
558
|
+
static dynamicFile<Required extends boolean, OuterType = unknown>(a: LazyBuild<{
|
|
559
559
|
name: string;
|
|
560
560
|
description?: string | null;
|
|
561
561
|
warning?: string | null;
|
|
562
562
|
extensions: string[];
|
|
563
563
|
required: Required;
|
|
564
|
-
}>): Value<AsRequired<{
|
|
564
|
+
}, OuterType>): Value<AsRequired<{
|
|
565
565
|
path: string;
|
|
566
566
|
commitment: {
|
|
567
567
|
hash: string;
|
|
@@ -573,7 +573,7 @@ export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = T
|
|
|
573
573
|
hash: string;
|
|
574
574
|
size: number;
|
|
575
575
|
};
|
|
576
|
-
} | null>;
|
|
576
|
+
} | null, OuterType>;
|
|
577
577
|
/**
|
|
578
578
|
* @description Displays a dropdown, allowing for a single selection. Depending on the selection, a different object ("sub form") is presented.
|
|
579
579
|
* @example
|
|
@@ -625,33 +625,33 @@ export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = T
|
|
|
625
625
|
* @default false
|
|
626
626
|
*/
|
|
627
627
|
immutable?: boolean;
|
|
628
|
-
}): Value<UnionRes<VariantValues, keyof VariantValues & string>, UnionResStaticValidatedAs<VariantValues, keyof VariantValues & string
|
|
628
|
+
}): Value<UnionRes<VariantValues, keyof VariantValues & string>, UnionResStaticValidatedAs<VariantValues, keyof VariantValues & string>, unknown>;
|
|
629
629
|
static dynamicUnion<VariantValues extends {
|
|
630
630
|
[K in string]: {
|
|
631
631
|
name: string;
|
|
632
632
|
spec: InputSpec<any>;
|
|
633
633
|
};
|
|
634
|
-
}>(getA: LazyBuild<{
|
|
634
|
+
}, OuterType = unknown>(getA: LazyBuild<{
|
|
635
635
|
name: string;
|
|
636
636
|
description?: string | null;
|
|
637
637
|
warning?: string | null;
|
|
638
638
|
variants: Variants<VariantValues>;
|
|
639
639
|
default: keyof VariantValues & string;
|
|
640
640
|
disabled: string[] | false | string;
|
|
641
|
-
}>): Value<UnionRes<VariantValues>,
|
|
642
|
-
static dynamicUnion<
|
|
641
|
+
}, OuterType>): Value<UnionRes<VariantValues>, UnionRes<VariantValues>, OuterType>;
|
|
642
|
+
static dynamicUnion<StaticVariantValues extends {
|
|
643
643
|
[K in string]: {
|
|
644
644
|
name: string;
|
|
645
645
|
spec: InputSpec<any, any>;
|
|
646
646
|
};
|
|
647
|
-
}>(getA: LazyBuild<{
|
|
647
|
+
}, VariantValues extends StaticVariantValues, OuterType = unknown>(getA: LazyBuild<{
|
|
648
648
|
name: string;
|
|
649
649
|
description?: string | null;
|
|
650
650
|
warning?: string | null;
|
|
651
651
|
variants: Variants<VariantValues>;
|
|
652
652
|
default: keyof VariantValues & string;
|
|
653
653
|
disabled: string[] | false | string;
|
|
654
|
-
}>, validator: Parser<unknown, UnionResStaticValidatedAs<StaticVariantValues>>): Value<UnionRes<VariantValues>, UnionResStaticValidatedAs<StaticVariantValues
|
|
654
|
+
}, OuterType>, validator: Parser<unknown, UnionResStaticValidatedAs<StaticVariantValues>>): Value<UnionRes<VariantValues>, UnionResStaticValidatedAs<StaticVariantValues>, OuterType>;
|
|
655
655
|
/**
|
|
656
656
|
* @description Presents an interface to add/remove/edit items in a list.
|
|
657
657
|
* @example
|
|
@@ -715,7 +715,7 @@ export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = T
|
|
|
715
715
|
),
|
|
716
716
|
* ```
|
|
717
717
|
*/
|
|
718
|
-
static list<Type>(a: List<Type>): Value<Type, Type>;
|
|
718
|
+
static list<Type>(a: List<Type>): Value<Type, Type, unknown>;
|
|
719
719
|
/**
|
|
720
720
|
* @description Provides a way to define a hidden field with a static value. Useful for tracking
|
|
721
721
|
* @example
|
|
@@ -723,7 +723,7 @@ export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = T
|
|
|
723
723
|
hiddenExample: Value.hidden(),
|
|
724
724
|
* ```
|
|
725
725
|
*/
|
|
726
|
-
static hidden<T>(): Value<T
|
|
726
|
+
static hidden<T>(): Value<T>;
|
|
727
727
|
static hidden<T>(parser: Parser<unknown, T>): Value<T>;
|
|
728
728
|
/**
|
|
729
729
|
* @description Provides a way to define a hidden field with a static value. Useful for tracking
|
|
@@ -732,7 +732,6 @@ export declare class Value<Type extends StaticValidatedAs, StaticValidatedAs = T
|
|
|
732
732
|
hiddenExample: Value.hidden(),
|
|
733
733
|
* ```
|
|
734
734
|
*/
|
|
735
|
-
static dynamicHidden<T>(getParser: LazyBuild<Parser<unknown, T
|
|
736
|
-
map<U>(fn: (value: StaticValidatedAs) => U): Value<U>;
|
|
735
|
+
static dynamicHidden<T, OuterType = unknown>(getParser: LazyBuild<Parser<unknown, T>, OuterType>): Value<T, T, OuterType>;
|
|
736
|
+
map<U>(fn: (value: StaticValidatedAs) => U): Value<U, U, OuterType>;
|
|
737
737
|
}
|
|
738
|
-
export {};
|
|
@@ -689,8 +689,8 @@ class Value {
|
|
|
689
689
|
}, ts_matches_1.any);
|
|
690
690
|
}
|
|
691
691
|
map(fn) {
|
|
692
|
-
return new Value(async (
|
|
693
|
-
const built = await this.build(
|
|
692
|
+
return new Value(async (options) => {
|
|
693
|
+
const built = await this.build(options);
|
|
694
694
|
return {
|
|
695
695
|
spec: built.spec,
|
|
696
696
|
validator: built.validator.map(fn),
|