@builder-builder/builder 0.0.28 → 0.0.29

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.
Files changed (77) hide show
  1. package/dist/bb.js +5 -6
  2. package/dist/client/schema.d.ts +49 -29
  3. package/dist/components/BuilderOption.svelte.d.ts +12 -12
  4. package/dist/components/BuilderOptionValueBoolean.svelte.d.ts +20 -0
  5. package/dist/components/BuilderOptionValueNumber.svelte.d.ts +21 -0
  6. package/dist/components/BuilderOptionValueSelect.svelte.d.ts +21 -0
  7. package/dist/components/BuilderOptionValueString.svelte.d.ts +21 -0
  8. package/dist/components/index.d.ts +8 -8
  9. package/dist/components/index.js +2479 -2435
  10. package/dist/components/index.min.js +3 -3
  11. package/dist/entities/collection/collection.d.ts +162 -372
  12. package/dist/entities/collection/collection.js +7 -4
  13. package/dist/entities/collection/{when.d.ts → condition.d.ts} +3 -4
  14. package/dist/entities/collection/condition.js +2 -0
  15. package/dist/entities/collection/config.d.ts +52 -70
  16. package/dist/entities/collection/index.d.ts +4 -4
  17. package/dist/entities/collection/index.js +2 -2
  18. package/dist/entities/component/component.d.ts +11 -23
  19. package/dist/entities/component/component.js +4 -4
  20. package/dist/entities/component/{when.d.ts → condition.d.ts} +3 -4
  21. package/dist/entities/component/{when.js → condition.js} +3 -9
  22. package/dist/entities/component/index.d.ts +4 -4
  23. package/dist/entities/component/index.js +2 -2
  24. package/dist/entities/{when.d.ts → condition.d.ts} +21 -34
  25. package/dist/entities/{when.js → condition.js} +20 -25
  26. package/dist/entities/expectation.d.ts +135 -3
  27. package/dist/entities/expectation.js +6 -2
  28. package/dist/entities/index.d.ts +8 -8
  29. package/dist/entities/index.js +4 -4
  30. package/dist/entities/kind.d.ts +1 -1
  31. package/dist/entities/kind.js +4 -5
  32. package/dist/entities/model/bind.d.ts +5 -5
  33. package/dist/entities/model/methods.d.ts +18 -27
  34. package/dist/entities/model/methods.js +4 -22
  35. package/dist/entities/model/model.d.ts +3 -1
  36. package/dist/entities/model/model.js +25 -27
  37. package/dist/entities/option/condition.d.ts +9 -0
  38. package/dist/entities/option/condition.js +2 -0
  39. package/dist/entities/option/config.d.ts +44 -69
  40. package/dist/entities/option/config.js +6 -6
  41. package/dist/entities/option/expectation.d.ts +6 -1
  42. package/dist/entities/option/expectation.js +2 -2
  43. package/dist/entities/option/index.d.ts +8 -8
  44. package/dist/entities/option/index.js +4 -4
  45. package/dist/entities/option/option.d.ts +171 -202
  46. package/dist/entities/option/option.js +4 -4
  47. package/dist/entities/option/select.d.ts +16 -43
  48. package/dist/entities/option/select.js +8 -31
  49. package/dist/entities/option/value.d.ts +73 -0
  50. package/dist/entities/option/value.js +99 -0
  51. package/dist/entities/references.d.ts +104 -64
  52. package/dist/entities/serialise.d.ts +147 -80
  53. package/dist/entities/serialise.js +26 -21
  54. package/dist/entities/ui/input.d.ts +1 -1
  55. package/dist/entities/validated.d.ts +1 -1
  56. package/dist/errors/errors.d.ts +8 -3
  57. package/dist/errors/errors.js +5 -2
  58. package/dist/index.d.ts +1 -1
  59. package/dist/index.js +1 -1
  60. package/dist/mappers/dependencies.js +4 -3
  61. package/dist/mappers/resolve.js +23 -22
  62. package/dist/mappers/variants/option-graph.js +1 -1
  63. package/dist/public.d.ts +17 -17
  64. package/dist/public.js +17 -9
  65. package/dist/validate/expectations.js +21 -3
  66. package/dist/validate/model.js +8 -11
  67. package/dist/validate/resolve.js +14 -18
  68. package/package.json +1 -1
  69. package/dist/components/BuilderOptionSelect.svelte.d.ts +0 -21
  70. package/dist/components/BuilderOptionToggleBoolean.svelte.d.ts +0 -20
  71. package/dist/components/BuilderOptionToggleNumber.svelte.d.ts +0 -21
  72. package/dist/components/BuilderOptionToggleString.svelte.d.ts +0 -21
  73. package/dist/entities/collection/when.js +0 -2
  74. package/dist/entities/option/toggle.d.ts +0 -45
  75. package/dist/entities/option/toggle.js +0 -71
  76. package/dist/entities/option/when.d.ts +0 -10
  77. package/dist/entities/option/when.js +0 -2
@@ -1,11 +1,11 @@
1
1
  import type { Paramable } from '../../references';
2
2
  import type { BuilderPaths } from '../paths';
3
3
  import type { BuilderTags } from '../tags';
4
- import type { BuilderWhenSerialised } from '../when';
4
+ import type { BuilderConditionSerialised } from '../condition';
5
5
  import type { BuilderOptionConfig, BuilderOptionConfigSerialised } from './config';
6
- import type { BuilderOptionWhen } from './when';
6
+ import type { BuilderOptionCondition } from './condition';
7
7
  import * as v from 'valibot';
8
- export type BuilderOptionPayload = BuilderOptionConfig | BuilderOptionWhen;
8
+ export type BuilderOptionPayload = BuilderOptionConfig | BuilderOptionCondition;
9
9
  export declare class BuilderOption<const Name extends string = string, const Payload extends Paramable<BuilderOptionPayload> = Paramable<BuilderOptionPayload>, const Paths extends Paramable<BuilderPaths> = Paramable<BuilderPaths>> {
10
10
  readonly type: 'option';
11
11
  readonly name: Name;
@@ -17,43 +17,45 @@ export declare class BuilderOption<const Name extends string = string, const Pay
17
17
  }
18
18
  export declare const BuilderOptionSchema: v.InstanceSchema<typeof BuilderOption, undefined>;
19
19
  export type BuilderOptions = ReadonlyArray<BuilderOption>;
20
- export declare const BuilderOptionWhenSerialisedSchema: v.GenericSchema<BuilderWhenSerialised<Readonly<Readonly<{
21
- type: "select";
22
- readonly options: readonly [string, ...string[]];
23
- defaultValue: string | null;
20
+ export declare const BuilderOptionConditionSerialisedSchema: v.GenericSchema<BuilderConditionSerialised<Readonly<{
21
+ kind: "string" | "number" | "boolean";
22
+ type: "value";
23
+ defaultValue: string | number | boolean | null;
24
24
  isOptional: boolean;
25
- optionLabels: {
26
- [x: string]: string;
27
- };
28
25
  tags?: readonly string[] | undefined;
29
- }>> | Readonly<Readonly<{
30
- type: "toggle";
31
- kind: "string" | "number" | "boolean";
26
+ }> | Readonly<{
27
+ kind: "select";
28
+ readonly options: readonly [string, ...string[]];
29
+ optionLabels?: {
30
+ [x: string]: string;
31
+ } | undefined;
32
+ type: "value";
32
33
  defaultValue: string | number | boolean | null;
33
34
  isOptional: boolean;
34
35
  tags?: readonly string[] | undefined;
35
- }>>>>;
36
- export type BuilderOptionWhenSerialised = BuilderWhenSerialised<BuilderOptionConfigSerialised>;
36
+ }>>>;
37
+ export type BuilderOptionConditionSerialised = BuilderConditionSerialised<BuilderOptionConfigSerialised>;
37
38
  export declare const BuilderOptionSelectMapSerialisedSchema: v.GenericSchema<import("..").BuilderMatchSelectMap<Readonly<{
38
39
  type: "parameter";
39
40
  id: string;
40
41
  name: string;
41
- }> | Readonly<Readonly<{
42
- type: "select";
43
- readonly options: readonly [string, ...string[]];
44
- defaultValue: string | null;
42
+ }> | Readonly<{
43
+ kind: "string" | "number" | "boolean";
44
+ type: "value";
45
+ defaultValue: string | number | boolean | null;
45
46
  isOptional: boolean;
46
- optionLabels: {
47
- [x: string]: string;
48
- };
49
47
  tags?: readonly string[] | undefined;
50
- }>> | Readonly<Readonly<{
51
- type: "toggle";
52
- kind: "string" | "number" | "boolean";
48
+ }> | Readonly<{
49
+ kind: "select";
50
+ readonly options: readonly [string, ...string[]];
51
+ optionLabels?: {
52
+ [x: string]: string;
53
+ } | undefined;
54
+ type: "value";
53
55
  defaultValue: string | number | boolean | null;
54
56
  isOptional: boolean;
55
57
  tags?: readonly string[] | undefined;
56
- }>>>>;
58
+ }>>>;
57
59
  export declare const BuilderOptionSerialisedSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
58
60
  readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
59
61
  readonly payload: v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
@@ -70,65 +72,53 @@ export declare const BuilderOptionSerialisedSchema: v.SchemaWithPipe<readonly [v
70
72
  }, undefined>, v.ReadonlyAction<{
71
73
  type: "ref";
72
74
  id: string;
73
- }>]>, v.UnionSchema<[v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.ObjectSchema<{
74
- readonly type: v.LiteralSchema<"select", undefined>;
75
- readonly options: v.SchemaWithPipe<readonly [v.TupleWithRestSchema<[v.StringSchema<undefined>], v.StringSchema<undefined>, undefined>, v.ReadonlyAction<[string, ...string[]]>]>;
76
- readonly defaultValue: v.NullableSchema<v.StringSchema<undefined>, undefined>;
75
+ }>]>, v.UnionSchema<[v.SchemaWithPipe<readonly [v.VariantSchema<"kind", [v.StrictObjectSchema<{
76
+ readonly kind: v.PicklistSchema<["string", "boolean", "number"], undefined>;
77
+ readonly type: v.LiteralSchema<"value", undefined>;
78
+ readonly defaultValue: v.NullableSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
77
79
  readonly isOptional: v.BooleanSchema<undefined>;
78
- readonly optionLabels: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
79
80
  readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
80
- }, undefined>, v.ReadonlyAction<{
81
- type: "select";
82
- readonly options: readonly [string, ...string[]];
83
- defaultValue: string | null;
84
- isOptional: boolean;
85
- optionLabels: {
86
- [x: string]: string;
87
- };
88
- tags?: readonly string[] | undefined;
89
- }>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
90
- readonly type: v.LiteralSchema<"toggle", undefined>;
91
- readonly kind: v.PicklistSchema<["string", "boolean", "number"], undefined>;
81
+ }, undefined>, v.StrictObjectSchema<{
82
+ readonly kind: v.LiteralSchema<"select", undefined>;
83
+ readonly options: v.SchemaWithPipe<readonly [v.TupleWithRestSchema<[v.StringSchema<undefined>], v.StringSchema<undefined>, undefined>, v.ReadonlyAction<[string, ...string[]]>]>;
84
+ readonly optionLabels: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
85
+ readonly type: v.LiteralSchema<"value", undefined>;
92
86
  readonly defaultValue: v.NullableSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
93
87
  readonly isOptional: v.BooleanSchema<undefined>;
94
88
  readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
95
- }, undefined>, v.ReadonlyAction<{
96
- type: "toggle";
89
+ }, undefined>], undefined>, v.ReadonlyAction<{
97
90
  kind: "string" | "number" | "boolean";
91
+ type: "value";
98
92
  defaultValue: string | number | boolean | null;
99
93
  isOptional: boolean;
100
94
  tags?: readonly string[] | undefined;
101
- }>]>], undefined>, v.ReadonlyAction<Readonly<{
102
- type: "select";
95
+ } | {
96
+ kind: "select";
103
97
  readonly options: readonly [string, ...string[]];
104
- defaultValue: string | null;
105
- isOptional: boolean;
106
- optionLabels: {
98
+ optionLabels?: {
107
99
  [x: string]: string;
108
- };
100
+ } | undefined;
101
+ type: "value";
102
+ defaultValue: string | number | boolean | null;
103
+ isOptional: boolean;
109
104
  tags?: readonly string[] | undefined;
110
- }> | Readonly<{
111
- type: "toggle";
105
+ }>]>, v.GenericSchema<BuilderConditionSerialised<Readonly<{
112
106
  kind: "string" | "number" | "boolean";
107
+ type: "value";
113
108
  defaultValue: string | number | boolean | null;
114
109
  isOptional: boolean;
115
110
  tags?: readonly string[] | undefined;
116
- }>>]>, v.GenericSchema<BuilderWhenSerialised<Readonly<Readonly<{
117
- type: "select";
111
+ }> | Readonly<{
112
+ kind: "select";
118
113
  readonly options: readonly [string, ...string[]];
119
- defaultValue: string | null;
120
- isOptional: boolean;
121
- optionLabels: {
114
+ optionLabels?: {
122
115
  [x: string]: string;
123
- };
124
- tags?: readonly string[] | undefined;
125
- }>> | Readonly<Readonly<{
126
- type: "toggle";
127
- kind: "string" | "number" | "boolean";
116
+ } | undefined;
117
+ type: "value";
128
118
  defaultValue: string | number | boolean | null;
129
119
  isOptional: boolean;
130
120
  tags?: readonly string[] | undefined;
131
- }>>>>], undefined>], undefined>;
121
+ }>>>], undefined>], undefined>;
132
122
  readonly paths: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
133
123
  readonly type: v.LiteralSchema<"parameter", undefined>;
134
124
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
@@ -154,37 +144,39 @@ export declare const BuilderOptionSerialisedSchema: v.SchemaWithPipe<readonly [v
154
144
  }> | Readonly<{
155
145
  type: "ref";
156
146
  id: string;
157
- }> | Readonly<Readonly<{
158
- type: "select";
159
- readonly options: readonly [string, ...string[]];
160
- defaultValue: string | null;
147
+ }> | Readonly<{
148
+ kind: "string" | "number" | "boolean";
149
+ type: "value";
150
+ defaultValue: string | number | boolean | null;
161
151
  isOptional: boolean;
162
- optionLabels: {
152
+ tags?: readonly string[] | undefined;
153
+ }> | Readonly<{
154
+ kind: "select";
155
+ readonly options: readonly [string, ...string[]];
156
+ optionLabels?: {
163
157
  [x: string]: string;
164
- };
158
+ } | undefined;
159
+ type: "value";
160
+ defaultValue: string | number | boolean | null;
161
+ isOptional: boolean;
165
162
  tags?: readonly string[] | undefined;
166
- }>> | Readonly<Readonly<{
167
- type: "toggle";
163
+ }> | BuilderConditionSerialised<Readonly<{
168
164
  kind: "string" | "number" | "boolean";
165
+ type: "value";
169
166
  defaultValue: string | number | boolean | null;
170
167
  isOptional: boolean;
171
168
  tags?: readonly string[] | undefined;
172
- }>> | BuilderWhenSerialised<Readonly<Readonly<{
173
- type: "select";
169
+ }> | Readonly<{
170
+ kind: "select";
174
171
  readonly options: readonly [string, ...string[]];
175
- defaultValue: string | null;
176
- isOptional: boolean;
177
- optionLabels: {
172
+ optionLabels?: {
178
173
  [x: string]: string;
179
- };
180
- tags?: readonly string[] | undefined;
181
- }>> | Readonly<Readonly<{
182
- type: "toggle";
183
- kind: "string" | "number" | "boolean";
174
+ } | undefined;
175
+ type: "value";
184
176
  defaultValue: string | number | boolean | null;
185
177
  isOptional: boolean;
186
178
  tags?: readonly string[] | undefined;
187
- }>>>;
179
+ }>>;
188
180
  paths?: Readonly<{
189
181
  type: "parameter";
190
182
  id: string;
@@ -212,65 +204,53 @@ export declare const BuilderOptionsSerialisedSchema: v.SchemaWithPipe<readonly [
212
204
  }, undefined>, v.ReadonlyAction<{
213
205
  type: "ref";
214
206
  id: string;
215
- }>]>, v.UnionSchema<[v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.ObjectSchema<{
216
- readonly type: v.LiteralSchema<"select", undefined>;
217
- readonly options: v.SchemaWithPipe<readonly [v.TupleWithRestSchema<[v.StringSchema<undefined>], v.StringSchema<undefined>, undefined>, v.ReadonlyAction<[string, ...string[]]>]>;
218
- readonly defaultValue: v.NullableSchema<v.StringSchema<undefined>, undefined>;
207
+ }>]>, v.UnionSchema<[v.SchemaWithPipe<readonly [v.VariantSchema<"kind", [v.StrictObjectSchema<{
208
+ readonly kind: v.PicklistSchema<["string", "boolean", "number"], undefined>;
209
+ readonly type: v.LiteralSchema<"value", undefined>;
210
+ readonly defaultValue: v.NullableSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
219
211
  readonly isOptional: v.BooleanSchema<undefined>;
220
- readonly optionLabels: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
221
212
  readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
222
- }, undefined>, v.ReadonlyAction<{
223
- type: "select";
224
- readonly options: readonly [string, ...string[]];
225
- defaultValue: string | null;
226
- isOptional: boolean;
227
- optionLabels: {
228
- [x: string]: string;
229
- };
230
- tags?: readonly string[] | undefined;
231
- }>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
232
- readonly type: v.LiteralSchema<"toggle", undefined>;
233
- readonly kind: v.PicklistSchema<["string", "boolean", "number"], undefined>;
213
+ }, undefined>, v.StrictObjectSchema<{
214
+ readonly kind: v.LiteralSchema<"select", undefined>;
215
+ readonly options: v.SchemaWithPipe<readonly [v.TupleWithRestSchema<[v.StringSchema<undefined>], v.StringSchema<undefined>, undefined>, v.ReadonlyAction<[string, ...string[]]>]>;
216
+ readonly optionLabels: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
217
+ readonly type: v.LiteralSchema<"value", undefined>;
234
218
  readonly defaultValue: v.NullableSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
235
219
  readonly isOptional: v.BooleanSchema<undefined>;
236
220
  readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
237
- }, undefined>, v.ReadonlyAction<{
238
- type: "toggle";
221
+ }, undefined>], undefined>, v.ReadonlyAction<{
239
222
  kind: "string" | "number" | "boolean";
223
+ type: "value";
240
224
  defaultValue: string | number | boolean | null;
241
225
  isOptional: boolean;
242
226
  tags?: readonly string[] | undefined;
243
- }>]>], undefined>, v.ReadonlyAction<Readonly<{
244
- type: "select";
227
+ } | {
228
+ kind: "select";
245
229
  readonly options: readonly [string, ...string[]];
246
- defaultValue: string | null;
247
- isOptional: boolean;
248
- optionLabels: {
230
+ optionLabels?: {
249
231
  [x: string]: string;
250
- };
232
+ } | undefined;
233
+ type: "value";
234
+ defaultValue: string | number | boolean | null;
235
+ isOptional: boolean;
251
236
  tags?: readonly string[] | undefined;
252
- }> | Readonly<{
253
- type: "toggle";
237
+ }>]>, v.GenericSchema<BuilderConditionSerialised<Readonly<{
254
238
  kind: "string" | "number" | "boolean";
239
+ type: "value";
255
240
  defaultValue: string | number | boolean | null;
256
241
  isOptional: boolean;
257
242
  tags?: readonly string[] | undefined;
258
- }>>]>, v.GenericSchema<BuilderWhenSerialised<Readonly<Readonly<{
259
- type: "select";
243
+ }> | Readonly<{
244
+ kind: "select";
260
245
  readonly options: readonly [string, ...string[]];
261
- defaultValue: string | null;
262
- isOptional: boolean;
263
- optionLabels: {
246
+ optionLabels?: {
264
247
  [x: string]: string;
265
- };
266
- tags?: readonly string[] | undefined;
267
- }>> | Readonly<Readonly<{
268
- type: "toggle";
269
- kind: "string" | "number" | "boolean";
248
+ } | undefined;
249
+ type: "value";
270
250
  defaultValue: string | number | boolean | null;
271
251
  isOptional: boolean;
272
252
  tags?: readonly string[] | undefined;
273
- }>>>>], undefined>], undefined>;
253
+ }>>>], undefined>], undefined>;
274
254
  readonly paths: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
275
255
  readonly type: v.LiteralSchema<"parameter", undefined>;
276
256
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
@@ -296,37 +276,39 @@ export declare const BuilderOptionsSerialisedSchema: v.SchemaWithPipe<readonly [
296
276
  }> | Readonly<{
297
277
  type: "ref";
298
278
  id: string;
299
- }> | Readonly<Readonly<{
300
- type: "select";
301
- readonly options: readonly [string, ...string[]];
302
- defaultValue: string | null;
279
+ }> | Readonly<{
280
+ kind: "string" | "number" | "boolean";
281
+ type: "value";
282
+ defaultValue: string | number | boolean | null;
303
283
  isOptional: boolean;
304
- optionLabels: {
284
+ tags?: readonly string[] | undefined;
285
+ }> | Readonly<{
286
+ kind: "select";
287
+ readonly options: readonly [string, ...string[]];
288
+ optionLabels?: {
305
289
  [x: string]: string;
306
- };
290
+ } | undefined;
291
+ type: "value";
292
+ defaultValue: string | number | boolean | null;
293
+ isOptional: boolean;
307
294
  tags?: readonly string[] | undefined;
308
- }>> | Readonly<Readonly<{
309
- type: "toggle";
295
+ }> | BuilderConditionSerialised<Readonly<{
310
296
  kind: "string" | "number" | "boolean";
297
+ type: "value";
311
298
  defaultValue: string | number | boolean | null;
312
299
  isOptional: boolean;
313
300
  tags?: readonly string[] | undefined;
314
- }>> | BuilderWhenSerialised<Readonly<Readonly<{
315
- type: "select";
301
+ }> | Readonly<{
302
+ kind: "select";
316
303
  readonly options: readonly [string, ...string[]];
317
- defaultValue: string | null;
318
- isOptional: boolean;
319
- optionLabels: {
304
+ optionLabels?: {
320
305
  [x: string]: string;
321
- };
322
- tags?: readonly string[] | undefined;
323
- }>> | Readonly<Readonly<{
324
- type: "toggle";
325
- kind: "string" | "number" | "boolean";
306
+ } | undefined;
307
+ type: "value";
326
308
  defaultValue: string | number | boolean | null;
327
309
  isOptional: boolean;
328
310
  tags?: readonly string[] | undefined;
329
- }>>>;
311
+ }>>;
330
312
  paths?: Readonly<{
331
313
  type: "parameter";
332
314
  id: string;
@@ -345,37 +327,39 @@ export declare const BuilderOptionsSerialisedSchema: v.SchemaWithPipe<readonly [
345
327
  }> | Readonly<{
346
328
  type: "ref";
347
329
  id: string;
348
- }> | Readonly<Readonly<{
349
- type: "select";
350
- readonly options: readonly [string, ...string[]];
351
- defaultValue: string | null;
330
+ }> | Readonly<{
331
+ kind: "string" | "number" | "boolean";
332
+ type: "value";
333
+ defaultValue: string | number | boolean | null;
352
334
  isOptional: boolean;
353
- optionLabels: {
335
+ tags?: readonly string[] | undefined;
336
+ }> | Readonly<{
337
+ kind: "select";
338
+ readonly options: readonly [string, ...string[]];
339
+ optionLabels?: {
354
340
  [x: string]: string;
355
- };
341
+ } | undefined;
342
+ type: "value";
343
+ defaultValue: string | number | boolean | null;
344
+ isOptional: boolean;
356
345
  tags?: readonly string[] | undefined;
357
- }>> | Readonly<Readonly<{
358
- type: "toggle";
346
+ }> | BuilderConditionSerialised<Readonly<{
359
347
  kind: "string" | "number" | "boolean";
348
+ type: "value";
360
349
  defaultValue: string | number | boolean | null;
361
350
  isOptional: boolean;
362
351
  tags?: readonly string[] | undefined;
363
- }>> | BuilderWhenSerialised<Readonly<Readonly<{
364
- type: "select";
352
+ }> | Readonly<{
353
+ kind: "select";
365
354
  readonly options: readonly [string, ...string[]];
366
- defaultValue: string | null;
367
- isOptional: boolean;
368
- optionLabels: {
355
+ optionLabels?: {
369
356
  [x: string]: string;
370
- };
371
- tags?: readonly string[] | undefined;
372
- }>> | Readonly<Readonly<{
373
- type: "toggle";
374
- kind: "string" | "number" | "boolean";
357
+ } | undefined;
358
+ type: "value";
375
359
  defaultValue: string | number | boolean | null;
376
360
  isOptional: boolean;
377
361
  tags?: readonly string[] | undefined;
378
- }>>>;
362
+ }>>;
379
363
  paths?: Readonly<{
380
364
  type: "parameter";
381
365
  id: string;
@@ -387,40 +371,23 @@ export declare const BuilderOptionsSerialisedSchema: v.SchemaWithPipe<readonly [
387
371
  tags?: readonly string[] | undefined;
388
372
  }>[]>]>;
389
373
  export type BuilderOptionsSerialised = v.InferOutput<typeof BuilderOptionsSerialisedSchema>;
390
- export declare const validateOptionWhen: (input: unknown, references?: import("..").BuilderReferences, issues?: import("../../errors").BuilderIssuesScope) => import("..").ValidationResult<{
391
- readonly type: "enable";
392
- readonly payload: {
393
- readonly type: "select";
394
- readonly options: readonly [string, ...string[]];
395
- readonly defaultValue: string | null;
396
- readonly isOptional: boolean;
397
- readonly optionLabels: {
398
- readonly [x: string]: string;
399
- } & import("../../validate").BuilderValidatedBrand;
400
- readonly tags?: readonly string[] | undefined;
401
- } | {
402
- readonly type: "toggle";
403
- readonly kind: "string" | "number" | "boolean";
404
- readonly defaultValue: string | number | boolean | null;
405
- readonly isOptional: boolean;
406
- readonly tags?: readonly string[] | undefined;
407
- };
408
- } | {
374
+ export declare const validateOptionCondition: (input: unknown, references?: import("..").BuilderReferences, issues?: import("../../errors").BuilderIssuesScope) => import("..").ValidationResult<{
409
375
  readonly type: "match";
410
376
  readonly matchPath: readonly (string | number)[];
411
377
  readonly selectMap: {
412
378
  readonly [x: string]: {
413
- readonly type: "select";
414
- readonly options: readonly [string, ...string[]];
415
- readonly defaultValue: string | null;
379
+ readonly kind: "string" | "number" | "boolean";
380
+ readonly type: "value";
381
+ readonly defaultValue: string | number | boolean | null;
416
382
  readonly isOptional: boolean;
417
- readonly optionLabels: {
418
- readonly [x: string]: string;
419
- } & import("../../validate").BuilderValidatedBrand;
420
383
  readonly tags?: readonly string[] | undefined;
421
384
  } | {
422
- readonly type: "toggle";
423
- readonly kind: "string" | "number" | "boolean";
385
+ readonly kind: "select";
386
+ readonly options: readonly [string, ...string[]];
387
+ readonly optionLabels?: ({
388
+ readonly [x: string]: string;
389
+ } & import("../../validate").BuilderValidatedBrand) | undefined;
390
+ readonly type: "value";
424
391
  readonly defaultValue: string | number | boolean | null;
425
392
  readonly isOptional: boolean;
426
393
  readonly tags?: readonly string[] | undefined;
@@ -431,17 +398,18 @@ export declare const validateOptionWhen: (input: unknown, references?: import(".
431
398
  readonly unlessPath: readonly (string | number)[];
432
399
  readonly disabledValues: readonly (string | number | boolean | null)[];
433
400
  readonly payload: {
434
- readonly type: "select";
435
- readonly options: readonly [string, ...string[]];
436
- readonly defaultValue: string | null;
401
+ readonly kind: "string" | "number" | "boolean";
402
+ readonly type: "value";
403
+ readonly defaultValue: string | number | boolean | null;
437
404
  readonly isOptional: boolean;
438
- readonly optionLabels: {
439
- readonly [x: string]: string;
440
- } & import("../../validate").BuilderValidatedBrand;
441
405
  readonly tags?: readonly string[] | undefined;
442
406
  } | {
443
- readonly type: "toggle";
444
- readonly kind: "string" | "number" | "boolean";
407
+ readonly kind: "select";
408
+ readonly options: readonly [string, ...string[]];
409
+ readonly optionLabels?: ({
410
+ readonly [x: string]: string;
411
+ } & import("../../validate").BuilderValidatedBrand) | undefined;
412
+ readonly type: "value";
445
413
  readonly defaultValue: string | number | boolean | null;
446
414
  readonly isOptional: boolean;
447
415
  readonly tags?: readonly string[] | undefined;
@@ -449,17 +417,18 @@ export declare const validateOptionWhen: (input: unknown, references?: import(".
449
417
  }>;
450
418
  export declare const validateOptionSelectMap: (input: unknown, references?: import("..").BuilderReferences, issues?: import("../../errors").BuilderIssuesScope) => import("..").ValidationResult<{
451
419
  readonly [x: string]: {
452
- readonly type: "select";
453
- readonly options: readonly [string, ...string[]];
454
- readonly defaultValue: string | null;
420
+ readonly kind: "string" | "number" | "boolean";
421
+ readonly type: "value";
422
+ readonly defaultValue: string | number | boolean | null;
455
423
  readonly isOptional: boolean;
456
- readonly optionLabels: {
457
- readonly [x: string]: string;
458
- } & import("../../validate").BuilderValidatedBrand;
459
424
  readonly tags?: readonly string[] | undefined;
460
425
  } | {
461
- readonly type: "toggle";
462
- readonly kind: "string" | "number" | "boolean";
426
+ readonly kind: "select";
427
+ readonly options: readonly [string, ...string[]];
428
+ readonly optionLabels?: ({
429
+ readonly [x: string]: string;
430
+ } & import("../../validate").BuilderValidatedBrand) | undefined;
431
+ readonly type: "value";
463
432
  readonly defaultValue: string | number | boolean | null;
464
433
  readonly isOptional: boolean;
465
434
  readonly tags?: readonly string[] | undefined;
@@ -5,7 +5,7 @@ import { createEntityValidator } from '../kind.js';
5
5
  import { BuilderPathsSchema } from '../paths.js';
6
6
  import { serialisable } from '../serialisable.js';
7
7
  import { BuilderTagsSchema } from '../tags.js';
8
- import { createSelectMapSerialisedSchema, createWhenSerialisedSchema } from '../when.js';
8
+ import { createSelectMapSerialisedSchema, createConditionSerialisedSchema } from '../condition.js';
9
9
  import { BuilderOptionConfigSerialisedSchema } from './config.js';
10
10
  export class BuilderOption {
11
11
  name;
@@ -23,14 +23,14 @@ export class BuilderOption {
23
23
  }
24
24
  }
25
25
  export const BuilderOptionSchema = v.instance(BuilderOption);
26
- export const BuilderOptionWhenSerialisedSchema = createWhenSerialisedSchema(BuilderOptionConfigSerialisedSchema);
26
+ export const BuilderOptionConditionSerialisedSchema = createConditionSerialisedSchema(BuilderOptionConfigSerialisedSchema);
27
27
  export const BuilderOptionSelectMapSerialisedSchema = createSelectMapSerialisedSchema(BuilderOptionConfigSerialisedSchema);
28
28
  export const BuilderOptionSerialisedSchema = serialisable(v.object({
29
29
  name: NameSchema,
30
- payload: paramable(v.union([BuilderOptionConfigSerialisedSchema, BuilderOptionWhenSerialisedSchema])),
30
+ payload: paramable(v.union([BuilderOptionConfigSerialisedSchema, BuilderOptionConditionSerialisedSchema])),
31
31
  paths: v.optional(paramable(BuilderPathsSchema)),
32
32
  tags: v.optional(BuilderTagsSchema)
33
33
  }));
34
34
  export const BuilderOptionsSerialisedSchema = v.pipe(v.array(BuilderOptionSerialisedSchema), v.readonly());
35
- export const validateOptionWhen = createEntityValidator('optionWhen', BuilderOptionWhenSerialisedSchema);
35
+ export const validateOptionCondition = createEntityValidator('optionCondition', BuilderOptionConditionSerialisedSchema);
36
36
  export const validateOptionSelectMap = createEntityValidator('optionSelectMap', BuilderOptionSelectMapSerialisedSchema);