@builder-builder/builder 0.0.9 → 0.0.11
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/dist/bb.d.ts +28 -0
- package/dist/bb.js +49 -0
- package/dist/check.d.ts +1 -1
- package/dist/check.js +4 -2
- package/dist/entities/builder/bind.d.ts +4 -0
- package/dist/entities/builder/builder.d.ts +17 -490
- package/dist/entities/builder/builder.js +19 -76
- package/dist/entities/builder/factory.d.ts +7 -0
- package/dist/entities/builder/factory.js +4 -0
- package/dist/entities/builder/index.d.ts +3 -6
- package/dist/entities/builder/index.js +1 -2
- package/dist/entities/collection/collection.d.ts +71 -20
- package/dist/entities/collection/collection.js +10 -27
- package/dist/entities/collection/config.d.ts +40 -1049
- package/dist/entities/collection/config.js +11 -11
- package/dist/entities/collection/expectation.d.ts +8 -4
- package/dist/entities/collection/index.d.ts +3 -3
- package/dist/entities/collection/index.js +1 -1
- package/dist/entities/collection/when.d.ts +6 -5
- package/dist/entities/component/component.d.ts +272 -300
- package/dist/entities/component/component.js +9 -8
- package/dist/entities/component/details.d.ts +35 -60
- package/dist/entities/component/details.js +9 -9
- package/dist/entities/component/expectation.d.ts +7 -4
- package/dist/entities/component/expectation.js +0 -3
- package/dist/entities/component/field.d.ts +50 -0
- package/dist/entities/component/field.js +41 -0
- package/dist/entities/component/index.d.ts +5 -3
- package/dist/entities/component/index.js +3 -2
- package/dist/entities/component/when.d.ts +5 -5
- package/dist/entities/component/when.js +2 -2
- package/dist/entities/entry.d.ts +4 -0
- package/dist/entities/expectation.d.ts +10 -22
- package/dist/entities/expectation.js +2 -7
- package/dist/entities/index.d.ts +21 -16
- package/dist/entities/index.js +10 -8
- package/dist/entities/kind.d.ts +9 -0
- package/dist/entities/kind.js +5 -0
- package/dist/entities/model/bind.d.ts +83 -0
- package/dist/entities/model/expectation.d.ts +16 -0
- package/dist/entities/model/index.d.ts +7 -0
- package/dist/entities/model/index.js +2 -0
- package/dist/entities/model/methods.d.ts +57 -0
- package/dist/entities/{builder → model}/methods.js +8 -8
- package/dist/entities/model/model.d.ts +39 -0
- package/dist/entities/model/model.js +73 -0
- package/dist/entities/model/models.d.ts +39 -0
- package/dist/entities/model/models.js +14 -0
- package/dist/entities/{builder → model}/state.d.ts +10 -10
- package/dist/entities/option/index.d.ts +2 -2
- package/dist/entities/option/index.js +2 -2
- package/dist/entities/option/option.d.ts +216 -214
- package/dist/entities/option/option.js +9 -8
- package/dist/entities/option/select.d.ts +2 -12
- package/dist/entities/option/select.js +6 -3
- package/dist/entities/option/toggle.d.ts +2 -9
- package/dist/entities/option/toggle.js +3 -3
- package/dist/entities/option/values.d.ts +4 -24
- package/dist/entities/option/values.js +10 -4
- package/dist/entities/option/when.d.ts +6 -5
- package/dist/entities/refs.d.ts +6 -0
- package/dist/entities/refs.js +1 -0
- package/dist/entities/serialise.d.ts +393 -3568
- package/dist/entities/serialise.js +160 -31
- package/dist/entities/ui/describe.d.ts +23 -57
- package/dist/entities/ui/describe.js +4 -5
- package/dist/entities/ui/index.d.ts +4 -9
- package/dist/entities/ui/index.js +2 -4
- package/dist/entities/ui/page.d.ts +23 -57
- package/dist/entities/ui/page.js +4 -5
- package/dist/entities/ui/pages.d.ts +18 -403
- package/dist/entities/ui/pages.js +7 -7
- package/dist/entities/ui/ui.d.ts +22 -1575
- package/dist/entities/ui/ui.js +15 -28
- package/dist/entities/ui/uis.d.ts +5 -9
- package/dist/entities/ui/uis.js +12 -19
- package/dist/entities/validated.d.ts +35 -0
- package/dist/entities/validated.js +1 -0
- package/dist/entities/when.d.ts +79 -70
- package/dist/entities/when.js +11 -7
- package/dist/environment.d.ts +5 -0
- package/dist/environment.js +2 -0
- package/dist/exception.d.ts +8 -3
- package/dist/exception.js +3 -0
- package/dist/index.d.ts +21 -24
- package/dist/index.js +5 -10
- package/dist/instance.d.ts +56 -0
- package/dist/instance.js +10 -0
- package/dist/mappers/index.d.ts +7 -5
- package/dist/mappers/index.js +5 -3
- package/dist/mappers/instance.d.ts +3 -0
- package/dist/mappers/instance.js +35 -0
- package/dist/mappers/order.d.ts +6 -0
- package/dist/mappers/order.js +22 -0
- package/dist/mappers/render/pages.d.ts +4 -4
- package/dist/mappers/render/render.d.ts +2 -3
- package/dist/mappers/render/render.js +83 -78
- package/dist/mappers/resolve.d.ts +5 -9
- package/dist/mappers/resolve.js +25 -33
- package/dist/mappers/variants/index.d.ts +1 -0
- package/dist/mappers/variants/index.js +1 -0
- package/dist/mappers/variants/option-graph.d.ts +19 -0
- package/dist/mappers/{models → variants}/option-graph.js +33 -22
- package/dist/mappers/variants/variants.d.ts +3 -0
- package/dist/mappers/variants/variants.js +57 -0
- package/dist/private.d.ts +4 -0
- package/dist/private.js +4 -0
- package/dist/references.d.ts +27 -36
- package/dist/references.js +19 -12
- package/dist/serialisable.d.ts +1 -9
- package/dist/serialisable.js +2 -3
- package/dist/validate/brand.d.ts +14 -0
- package/dist/validate/brand.js +17 -0
- package/dist/validate/builder.d.ts +4 -0
- package/dist/validate/builder.js +27 -0
- package/dist/validate/expectations.d.ts +10 -0
- package/dist/validate/expectations.js +12 -0
- package/dist/validate/index.d.ts +18 -0
- package/dist/validate/index.js +9 -0
- package/dist/validate/instance.d.ts +19 -0
- package/dist/validate/instance.js +46 -0
- package/dist/validate/model.d.ts +36 -0
- package/dist/validate/model.js +196 -0
- package/dist/validate/resolve.d.ts +16 -0
- package/dist/validate/resolve.js +91 -0
- package/dist/validate/result.d.ts +8 -0
- package/dist/validate/result.js +4 -0
- package/dist/validate/ui.d.ts +8 -0
- package/dist/validate/ui.js +77 -0
- package/dist/validate/variants.d.ts +59 -0
- package/dist/validate/variants.js +102 -0
- package/package.json +12 -9
- package/dist/entities/builder/builders.d.ts +0 -20
- package/dist/entities/builder/builders.js +0 -18
- package/dist/entities/builder/expectation.d.ts +0 -12
- package/dist/entities/builder/methods.d.ts +0 -58
- package/dist/entities/builder/parameter.d.ts +0 -62
- package/dist/entities/builder/parameter.js +0 -18
- package/dist/entities/builder/validate.d.ts +0 -3
- package/dist/entities/builder/validate.js +0 -108
- package/dist/entities/errors.d.ts +0 -21
- package/dist/entities/ui/label.d.ts +0 -18
- package/dist/entities/ui/label.js +0 -12
- package/dist/entities/ui/parameter.d.ts +0 -7
- package/dist/entities/ui/parameter.js +0 -29
- package/dist/entities/ui/validate.d.ts +0 -8
- package/dist/entities/ui/validate.js +0 -21
- package/dist/entities/validate.d.ts +0 -28
- package/dist/mappers/assert/builder.d.ts +0 -2
- package/dist/mappers/assert/builder.js +0 -46
- package/dist/mappers/assert/expectation.d.ts +0 -2
- package/dist/mappers/assert/expectation.js +0 -23
- package/dist/mappers/assert/index.d.ts +0 -6
- package/dist/mappers/assert/index.js +0 -4
- package/dist/mappers/assert/model.d.ts +0 -13
- package/dist/mappers/assert/model.js +0 -47
- package/dist/mappers/assert/models.d.ts +0 -33
- package/dist/mappers/assert/models.js +0 -74
- package/dist/mappers/assert/ui.d.ts +0 -2
- package/dist/mappers/assert/ui.js +0 -22
- package/dist/mappers/instance/index.d.ts +0 -1
- package/dist/mappers/instance/index.js +0 -1
- package/dist/mappers/instance/instance.d.ts +0 -4
- package/dist/mappers/instance/instance.js +0 -33
- package/dist/mappers/models/component-graph.d.ts +0 -9
- package/dist/mappers/models/component-graph.js +0 -51
- package/dist/mappers/models/graph.d.ts +0 -12
- package/dist/mappers/models/graph.js +0 -17
- package/dist/mappers/models/index.d.ts +0 -1
- package/dist/mappers/models/index.js +0 -1
- package/dist/mappers/models/models.d.ts +0 -3
- package/dist/mappers/models/models.js +0 -37
- package/dist/mappers/models/option-graph.d.ts +0 -9
- package/dist/mappers/order/index.d.ts +0 -2
- package/dist/mappers/order/index.js +0 -1
- package/dist/mappers/order/order.d.ts +0 -14
- package/dist/mappers/order/order.js +0 -31
- package/dist/model.d.ts +0 -14
- package/dist/walker/index.d.ts +0 -2
- package/dist/walker/index.js +0 -1
- package/dist/walker/walkable.d.ts +0 -4
- package/dist/walker/walkable.js +0 -4
- package/dist/walker/walker.d.ts +0 -18
- package/dist/walker/walker.js +0 -103
- package/dist/walker/walkers.d.ts +0 -8
- package/dist/walker/walkers.js +0 -51
- /package/dist/entities/builder/{expectation.js → bind.js} +0 -0
- /package/dist/entities/{builder/state.js → entry.js} +0 -0
- /package/dist/entities/{errors.js → model/bind.js} +0 -0
- /package/dist/entities/{validate.js → model/expectation.js} +0 -0
- /package/dist/{model.js → entities/model/state.js} +0 -0
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
2
|
import { BuilderPathsSchema } from '../../paths.js';
|
|
3
|
-
import {
|
|
3
|
+
import { paramable } from '../../references.js';
|
|
4
4
|
import { serialisable } from '../../serialisable.js';
|
|
5
|
-
import { createWhenSerialisedSchema } from '../when.js';
|
|
5
|
+
import { createSelectMapSerialisedSchema, createWhenSerialisedSchema } from '../when.js';
|
|
6
6
|
import { BuilderComponentDetailsSerialisedSchema } from './details.js';
|
|
7
7
|
export class BuilderComponent {
|
|
8
8
|
name;
|
|
9
9
|
payload;
|
|
10
|
-
|
|
11
|
-
constructor(name, payload,
|
|
10
|
+
paths;
|
|
11
|
+
constructor(name, payload, paths) {
|
|
12
12
|
this.name = name;
|
|
13
13
|
this.payload = payload;
|
|
14
|
-
this.
|
|
14
|
+
this.paths = paths;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
export const BuilderComponentSchema = v.instance(BuilderComponent);
|
|
18
18
|
export const BuilderComponentWhenSerialisedSchema = createWhenSerialisedSchema(BuilderComponentDetailsSerialisedSchema);
|
|
19
|
-
export const
|
|
19
|
+
export const BuilderComponentSelectMapSerialisedSchema = createSelectMapSerialisedSchema(BuilderComponentDetailsSerialisedSchema);
|
|
20
|
+
export const BuilderComponentSerialisedSchema = serialisable(v.object({
|
|
20
21
|
name: v.string(),
|
|
21
|
-
payload:
|
|
22
|
-
|
|
22
|
+
payload: paramable(v.union([BuilderComponentDetailsSerialisedSchema, BuilderComponentWhenSerialisedSchema])),
|
|
23
|
+
paths: v.optional(paramable(BuilderPathsSchema))
|
|
23
24
|
}));
|
|
24
25
|
export const BuilderComponentsSerialisedSchema = v.pipe(v.array(BuilderComponentSerialisedSchema), v.readonly());
|
|
@@ -1,82 +1,57 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { Paramable } from '../../references';
|
|
2
|
+
import type { BuilderComponentFields } from './field';
|
|
3
3
|
import * as v from 'valibot';
|
|
4
|
-
export declare class BuilderComponentDetails<
|
|
4
|
+
export declare class BuilderComponentDetails<const Fields extends Paramable<BuilderComponentFields> = Paramable<BuilderComponentFields>> {
|
|
5
5
|
readonly type: 'component-details';
|
|
6
|
-
|
|
7
|
-
constructor(
|
|
6
|
+
fields: Fields;
|
|
7
|
+
constructor(fields: Fields);
|
|
8
8
|
}
|
|
9
9
|
export declare const BuilderComponentDetailsSchema: v.InstanceSchema<typeof BuilderComponentDetails, undefined>;
|
|
10
10
|
export declare const BuilderComponentDetailsSerialisedSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
11
|
-
readonly
|
|
12
|
-
readonly type: v.LiteralSchema<"
|
|
11
|
+
readonly fields: v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
12
|
+
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
13
13
|
readonly id: v.StringSchema<undefined>;
|
|
14
14
|
readonly name: v.StringSchema<undefined>;
|
|
15
15
|
}, undefined>, v.ReadonlyAction<{
|
|
16
|
-
type: "
|
|
16
|
+
type: "parameter";
|
|
17
17
|
id: string;
|
|
18
18
|
name: string;
|
|
19
|
-
}>]>, v.
|
|
20
|
-
readonly
|
|
21
|
-
readonly
|
|
22
|
-
}, undefined>, v.
|
|
23
|
-
name: string;
|
|
24
|
-
kind: "option" | "component" | "collection" | "detail";
|
|
25
|
-
}, {
|
|
26
|
-
readonly serialisable: typeof import("..").BuilderExpectation;
|
|
27
|
-
readonly instance: v.InstanceSchema<typeof import("..").BuilderExpectation, undefined>;
|
|
28
|
-
}>, v.ReadonlyAction<{
|
|
29
|
-
name: string;
|
|
30
|
-
kind: "option" | "component" | "collection" | "detail";
|
|
31
|
-
}>]>, undefined>, v.ReadonlyAction<Readonly<{
|
|
32
|
-
name: string;
|
|
33
|
-
kind: "option" | "component" | "collection" | "detail";
|
|
34
|
-
}>[]>]>], undefined>, v.MetadataAction<import("../..").BuilderRef | Readonly<{
|
|
19
|
+
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
20
|
+
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
21
|
+
readonly id: v.StringSchema<undefined>;
|
|
22
|
+
}, undefined>, v.ReadonlyAction<{
|
|
35
23
|
type: "ref";
|
|
36
24
|
id: string;
|
|
25
|
+
}>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
26
|
+
readonly type: v.LiteralSchema<"component-field", undefined>;
|
|
27
|
+
readonly name: v.StringSchema<undefined>;
|
|
28
|
+
readonly valueType: v.PicklistSchema<["string", "boolean", "number"], undefined>;
|
|
29
|
+
readonly isOptional: v.BooleanSchema<undefined>;
|
|
30
|
+
}, undefined>, v.ReadonlyAction<{
|
|
31
|
+
type: "component-field";
|
|
37
32
|
name: string;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
readonly serialisable: typeof import("..").BuilderExpectation;
|
|
50
|
-
readonly instance: v.InstanceSchema<typeof import("..").BuilderExpectation, undefined>;
|
|
51
|
-
}>, v.ReadonlyAction<{
|
|
52
|
-
name: string;
|
|
53
|
-
kind: "option" | "component" | "collection" | "detail";
|
|
54
|
-
}>]>, undefined>, v.ReadonlyAction<Readonly<{
|
|
55
|
-
name: string;
|
|
56
|
-
kind: "option" | "component" | "collection" | "detail";
|
|
57
|
-
}>[]>]>;
|
|
58
|
-
}>]>;
|
|
59
|
-
}, undefined>, v.MetadataAction<{
|
|
60
|
-
expectations: import("../..").BuilderRef | Readonly<{
|
|
61
|
-
type: "ref";
|
|
33
|
+
valueType: "string" | "number" | "boolean";
|
|
34
|
+
isOptional: boolean;
|
|
35
|
+
}>]>, undefined>, v.ReadonlyAction<Readonly<{
|
|
36
|
+
type: "component-field";
|
|
37
|
+
name: string;
|
|
38
|
+
valueType: "string" | "number" | "boolean";
|
|
39
|
+
isOptional: boolean;
|
|
40
|
+
}>[]>]>], undefined>;
|
|
41
|
+
}, undefined>, v.ReadonlyAction<{
|
|
42
|
+
fields: Readonly<{
|
|
43
|
+
type: "parameter";
|
|
62
44
|
id: string;
|
|
63
45
|
name: string;
|
|
64
|
-
}> |
|
|
65
|
-
name: string;
|
|
66
|
-
kind: "option" | "component" | "collection" | "detail";
|
|
67
|
-
}>[];
|
|
68
|
-
}, {
|
|
69
|
-
readonly serialisable: typeof BuilderComponentDetails;
|
|
70
|
-
readonly instance: v.InstanceSchema<typeof BuilderComponentDetails, undefined>;
|
|
71
|
-
}>, v.ReadonlyAction<{
|
|
72
|
-
expectations: import("../..").BuilderRef | Readonly<{
|
|
46
|
+
}> | Readonly<{
|
|
73
47
|
type: "ref";
|
|
74
48
|
id: string;
|
|
75
|
-
name: string;
|
|
76
49
|
}> | readonly Readonly<{
|
|
50
|
+
type: "component-field";
|
|
77
51
|
name: string;
|
|
78
|
-
|
|
52
|
+
valueType: "string" | "number" | "boolean";
|
|
53
|
+
isOptional: boolean;
|
|
79
54
|
}>[];
|
|
80
55
|
}>]>;
|
|
81
56
|
export type BuilderComponentDetailsSerialised = v.InferOutput<typeof BuilderComponentDetailsSerialisedSchema>;
|
|
82
|
-
export declare function componentDetails<const
|
|
57
|
+
export declare function componentDetails<const Fields extends BuilderComponentFields>(...fields: Fields): BuilderComponentDetails<Fields>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
-
import {
|
|
3
|
-
import { refable } from '../../references.js';
|
|
2
|
+
import { paramable } from '../../references.js';
|
|
4
3
|
import { serialisable } from '../../serialisable.js';
|
|
4
|
+
import { BuilderComponentFieldsSerialisedSchema } from './field.js';
|
|
5
5
|
export class BuilderComponentDetails {
|
|
6
|
-
|
|
7
|
-
constructor(
|
|
8
|
-
this.
|
|
6
|
+
fields;
|
|
7
|
+
constructor(fields) {
|
|
8
|
+
this.fields = fields;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
export const BuilderComponentDetailsSchema = v.instance(BuilderComponentDetails);
|
|
12
|
-
export const BuilderComponentDetailsSerialisedSchema = serialisable(
|
|
13
|
-
|
|
12
|
+
export const BuilderComponentDetailsSerialisedSchema = serialisable(v.object({
|
|
13
|
+
fields: paramable(BuilderComponentFieldsSerialisedSchema)
|
|
14
14
|
}));
|
|
15
|
-
export function componentDetails(
|
|
16
|
-
return new BuilderComponentDetails(
|
|
15
|
+
export function componentDetails(...fields) {
|
|
16
|
+
return new BuilderComponentDetails(fields);
|
|
17
17
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BuilderModelState } from '../model/index';
|
|
2
2
|
import type { BuilderExpectations } from '../expectation';
|
|
3
3
|
import type { BuilderComponent } from './component';
|
|
4
4
|
import { BuilderExpectation } from '../expectation.js';
|
|
5
5
|
export declare function componentExpectation<const Name extends string>(name: Name): BuilderExpectation<Name, never, "component">;
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export type ComponentAsserted<State extends BuilderModelState, Expectations extends BuilderExpectations, Current extends State['components'] = State['components'], Asserted extends ComponentsExpected<Expectations> = ComponentsExpected<Expectations>> = Current extends [] ? ComponentsExpected<Expectations> : number extends Asserted['length'] ? Asserted : [...Current, ...Asserted];
|
|
7
|
+
type ComponentsExpected<Expectations extends BuilderExpectations> = Expectations extends readonly [
|
|
8
|
+
infer Head,
|
|
9
|
+
...infer Tail extends BuilderExpectations
|
|
10
|
+
] ? Head extends BuilderExpectation<infer Name, any, 'component'> ? [BuilderComponent<Name>, ...ComponentsExpected<Tail>] : ComponentsExpected<Tail> : [];
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { BuilderPrimitive } from '../../primitive';
|
|
2
|
+
import * as v from 'valibot';
|
|
3
|
+
export declare const BuilderComponentFieldValueTypeSchema: v.PicklistSchema<["string", "boolean", "number"], undefined>;
|
|
4
|
+
export type BuilderComponentFieldValueType = v.InferOutput<typeof BuilderComponentFieldValueTypeSchema>;
|
|
5
|
+
export declare class BuilderComponentField<const Name extends string = string, const ValueSchema extends v.GenericSchema<BuilderPrimitive> = v.GenericSchema<BuilderPrimitive>> {
|
|
6
|
+
readonly value: v.InferOutput<ValueSchema>;
|
|
7
|
+
readonly type: "component-field";
|
|
8
|
+
readonly name: Name;
|
|
9
|
+
readonly valueType: BuilderComponentFieldValueType;
|
|
10
|
+
readonly valueSchema: ValueSchema;
|
|
11
|
+
readonly isOptional: boolean;
|
|
12
|
+
constructor(name: Name, valueType: BuilderComponentFieldValueType, optional?: boolean);
|
|
13
|
+
optional(): BuilderComponentField<Name, v.NullableSchema<ValueSchema, undefined>>;
|
|
14
|
+
}
|
|
15
|
+
export declare function detailString<const Name extends string>(name: Name): BuilderComponentField<Name, v.StringSchema<undefined>>;
|
|
16
|
+
export declare function detailNumber<const Name extends string>(name: Name): BuilderComponentField<Name, v.NumberSchema<undefined>>;
|
|
17
|
+
export declare function detailBoolean<const Name extends string>(name: Name): BuilderComponentField<Name, v.BooleanSchema<undefined>>;
|
|
18
|
+
export declare const BuilderComponentFieldSchema: v.InstanceSchema<typeof BuilderComponentField, undefined>;
|
|
19
|
+
export declare const BuilderComponentFieldsSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.InstanceSchema<typeof BuilderComponentField, undefined>, undefined>, v.ReadonlyAction<BuilderComponentField<string, v.GenericSchema<string | number | boolean | null>>[]>]>;
|
|
20
|
+
export type BuilderComponentFields = v.InferOutput<typeof BuilderComponentFieldsSchema>;
|
|
21
|
+
export declare const BuilderComponentFieldSerialisedSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
22
|
+
readonly type: v.LiteralSchema<"component-field", undefined>;
|
|
23
|
+
readonly name: v.StringSchema<undefined>;
|
|
24
|
+
readonly valueType: v.PicklistSchema<["string", "boolean", "number"], undefined>;
|
|
25
|
+
readonly isOptional: v.BooleanSchema<undefined>;
|
|
26
|
+
}, undefined>, v.ReadonlyAction<{
|
|
27
|
+
type: "component-field";
|
|
28
|
+
name: string;
|
|
29
|
+
valueType: "string" | "number" | "boolean";
|
|
30
|
+
isOptional: boolean;
|
|
31
|
+
}>]>;
|
|
32
|
+
export type BuilderComponentFieldSerialised = v.InferOutput<typeof BuilderComponentFieldSerialisedSchema>;
|
|
33
|
+
export declare const BuilderComponentFieldsSerialisedSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
34
|
+
readonly type: v.LiteralSchema<"component-field", undefined>;
|
|
35
|
+
readonly name: v.StringSchema<undefined>;
|
|
36
|
+
readonly valueType: v.PicklistSchema<["string", "boolean", "number"], undefined>;
|
|
37
|
+
readonly isOptional: v.BooleanSchema<undefined>;
|
|
38
|
+
}, undefined>, v.ReadonlyAction<{
|
|
39
|
+
type: "component-field";
|
|
40
|
+
name: string;
|
|
41
|
+
valueType: "string" | "number" | "boolean";
|
|
42
|
+
isOptional: boolean;
|
|
43
|
+
}>]>, undefined>, v.ReadonlyAction<Readonly<{
|
|
44
|
+
type: "component-field";
|
|
45
|
+
name: string;
|
|
46
|
+
valueType: "string" | "number" | "boolean";
|
|
47
|
+
isOptional: boolean;
|
|
48
|
+
}>[]>]>;
|
|
49
|
+
export type BuilderComponentFieldsSerialised = v.InferOutput<typeof BuilderComponentFieldsSerialisedSchema>;
|
|
50
|
+
export declare function detailValueSchema(valueType: BuilderComponentFieldValueType, optional: boolean): v.GenericSchema<BuilderPrimitive>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { serialisable } from '../../serialisable.js';
|
|
3
|
+
export const BuilderComponentFieldValueTypeSchema = v.picklist(['string', 'boolean', 'number']);
|
|
4
|
+
export class BuilderComponentField {
|
|
5
|
+
type = 'component-field';
|
|
6
|
+
name;
|
|
7
|
+
valueType;
|
|
8
|
+
valueSchema;
|
|
9
|
+
isOptional;
|
|
10
|
+
constructor(name, valueType, optional = false) {
|
|
11
|
+
this.name = name;
|
|
12
|
+
this.valueType = valueType;
|
|
13
|
+
this.valueSchema = detailValueSchema(valueType, optional);
|
|
14
|
+
this.isOptional = optional;
|
|
15
|
+
}
|
|
16
|
+
optional() {
|
|
17
|
+
return new BuilderComponentField(this.name, this.valueType, true);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export function detailString(name) {
|
|
21
|
+
return new BuilderComponentField(name, 'string');
|
|
22
|
+
}
|
|
23
|
+
export function detailNumber(name) {
|
|
24
|
+
return new BuilderComponentField(name, 'number');
|
|
25
|
+
}
|
|
26
|
+
export function detailBoolean(name) {
|
|
27
|
+
return new BuilderComponentField(name, 'boolean');
|
|
28
|
+
}
|
|
29
|
+
export const BuilderComponentFieldSchema = v.instance(BuilderComponentField);
|
|
30
|
+
export const BuilderComponentFieldsSchema = v.pipe(v.array(BuilderComponentFieldSchema), v.readonly());
|
|
31
|
+
export const BuilderComponentFieldSerialisedSchema = serialisable(v.object({
|
|
32
|
+
type: v.literal('component-field'),
|
|
33
|
+
name: v.string(),
|
|
34
|
+
valueType: BuilderComponentFieldValueTypeSchema,
|
|
35
|
+
isOptional: v.boolean()
|
|
36
|
+
}));
|
|
37
|
+
export const BuilderComponentFieldsSerialisedSchema = v.pipe(v.array(BuilderComponentFieldSerialisedSchema), v.readonly());
|
|
38
|
+
export function detailValueSchema(valueType, optional) {
|
|
39
|
+
const baseSchema = valueType === 'string' ? v.string() : valueType === 'boolean' ? v.boolean() : v.number();
|
|
40
|
+
return optional ? v.nullable(baseSchema) : baseSchema;
|
|
41
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export type { BuilderComponentPayload, BuilderComponents, BuilderComponentSerialised, BuilderComponentsSerialised, BuilderComponentWhenSerialised } from './component';
|
|
2
2
|
export type { BuilderComponentDetailsSerialised } from './details';
|
|
3
|
-
export type { ComponentAsserted
|
|
3
|
+
export type { ComponentAsserted } from './expectation';
|
|
4
|
+
export type { BuilderComponentFields, BuilderComponentFieldsSerialised, BuilderComponentFieldSerialised, BuilderComponentFieldValueType } from './field';
|
|
4
5
|
export type { BuilderComponentWhen } from './when';
|
|
5
|
-
export { BuilderComponent, BuilderComponentSchema, BuilderComponentSerialisedSchema, BuilderComponentsSerialisedSchema, BuilderComponentWhenSerialisedSchema } from './component.js';
|
|
6
|
+
export { BuilderComponent, BuilderComponentSchema, BuilderComponentSelectMapSerialisedSchema, BuilderComponentSerialisedSchema, BuilderComponentsSerialisedSchema, BuilderComponentWhenSerialisedSchema } from './component.js';
|
|
6
7
|
export { BuilderComponentDetails, BuilderComponentDetailsSchema, BuilderComponentDetailsSerialisedSchema, componentDetails } from './details.js';
|
|
7
|
-
export { componentExpectation
|
|
8
|
+
export { componentExpectation } from './expectation.js';
|
|
9
|
+
export { BuilderComponentField, BuilderComponentFieldSchema, BuilderComponentFieldSerialisedSchema, BuilderComponentFieldsSchema, BuilderComponentFieldsSerialisedSchema, BuilderComponentFieldValueTypeSchema, detailBoolean, detailNumber, detailString, detailValueSchema } from './field.js';
|
|
8
10
|
export { componentWhen } from './when.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { BuilderComponent, BuilderComponentSchema, BuilderComponentSerialisedSchema, BuilderComponentsSerialisedSchema, BuilderComponentWhenSerialisedSchema } from './component.js';
|
|
1
|
+
export { BuilderComponent, BuilderComponentSchema, BuilderComponentSelectMapSerialisedSchema, BuilderComponentSerialisedSchema, BuilderComponentsSerialisedSchema, BuilderComponentWhenSerialisedSchema } from './component.js';
|
|
2
2
|
export { BuilderComponentDetails, BuilderComponentDetailsSchema, BuilderComponentDetailsSerialisedSchema, componentDetails } from './details.js';
|
|
3
|
-
export { componentExpectation
|
|
3
|
+
export { componentExpectation } from './expectation.js';
|
|
4
|
+
export { BuilderComponentField, BuilderComponentFieldSchema, BuilderComponentFieldSerialisedSchema, BuilderComponentFieldsSchema, BuilderComponentFieldsSerialisedSchema, BuilderComponentFieldValueTypeSchema, detailBoolean, detailNumber, detailString, detailValueSchema } from './field.js';
|
|
4
5
|
export { componentWhen } from './when.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { BuilderPath } from '../../paths';
|
|
2
2
|
import type { BuilderPrimitives } from '../../primitive';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Paramable } from '../../references';
|
|
4
4
|
import type { BuilderEnableConfig, BuilderMatchConfig, BuilderMatchSelectMap, BuilderUnlessConfig, BuilderWhen } from '../when';
|
|
5
5
|
import type { BuilderComponentDetails } from './details';
|
|
6
|
-
export type BuilderComponentWhen = BuilderWhen<
|
|
6
|
+
export type BuilderComponentWhen = BuilderWhen<Paramable<BuilderComponentDetails>, Paramable<BuilderPath>, Paramable<Record<string, Paramable<BuilderComponentDetails> | null>>, Paramable<BuilderPath>>;
|
|
7
7
|
export declare const componentWhen: {
|
|
8
|
-
enable: <const Payload extends
|
|
9
|
-
match: <const Payload extends
|
|
10
|
-
unless: <const UnlessPath extends
|
|
8
|
+
enable: <const Payload extends Paramable<BuilderComponentDetails>>(payload?: Payload) => BuilderEnableConfig<Payload>;
|
|
9
|
+
match: <const Payload extends Paramable<BuilderComponentDetails>, const MatchPath extends Paramable<BuilderPath>, const SelectMap extends Paramable<BuilderMatchSelectMap<Paramable<BuilderComponentDetails>>>>(matchPath: MatchPath, selectMap: SelectMap) => BuilderMatchConfig<Payload, MatchPath, SelectMap>;
|
|
10
|
+
unless: <const UnlessPath extends Paramable<BuilderPath>, const Payload extends Paramable<BuilderComponentDetails>>(unlessPath: UnlessPath, disabledValues: BuilderPrimitives, payload?: Payload) => BuilderUnlessConfig<Payload, UnlessPath>;
|
|
11
11
|
};
|
|
@@ -5,7 +5,7 @@ export const componentWhen = {
|
|
|
5
5
|
enable: (payload) => {
|
|
6
6
|
return {
|
|
7
7
|
type: 'enable',
|
|
8
|
-
payload: (payload ?? componentDetails(
|
|
8
|
+
payload: (payload ?? componentDetails())
|
|
9
9
|
};
|
|
10
10
|
},
|
|
11
11
|
match: baseFactories.match,
|
|
@@ -14,7 +14,7 @@ export const componentWhen = {
|
|
|
14
14
|
type: 'unless',
|
|
15
15
|
unlessPath,
|
|
16
16
|
disabledValues,
|
|
17
|
-
payload: (payload ?? componentDetails(
|
|
17
|
+
payload: (payload ?? componentDetails())
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BuilderCollectionSerialised } from './collection/index';
|
|
2
|
+
import type { BuilderComponentSerialised } from './component/index';
|
|
3
|
+
import type { BuilderOptionSerialised } from './option/index';
|
|
4
|
+
export type BuilderModelEntrySerialised = BuilderOptionSerialised | BuilderComponentSerialised | BuilderCollectionSerialised;
|
|
@@ -1,44 +1,32 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
-
export declare const BuilderExpectationKindSchema: v.PicklistSchema<["option", "component", "collection"
|
|
2
|
+
export declare const BuilderExpectationKindSchema: v.PicklistSchema<["option", "component", "collection"], undefined>;
|
|
3
3
|
export type BuilderExpectationKind = v.InferOutput<typeof BuilderExpectationKindSchema>;
|
|
4
4
|
export declare class BuilderExpectation<Name extends string = string, Value = unknown, Kind extends BuilderExpectationKind = BuilderExpectationKind> {
|
|
5
5
|
readonly type: 'expectation';
|
|
6
|
-
readonly
|
|
6
|
+
readonly value: Value;
|
|
7
7
|
readonly name: Name;
|
|
8
8
|
readonly kind: Kind;
|
|
9
9
|
constructor(name: Name, kind: Kind);
|
|
10
10
|
}
|
|
11
11
|
export declare const BuilderExpectationSchema: v.InstanceSchema<typeof BuilderExpectation, undefined>;
|
|
12
|
-
export declare const BuilderExpectationsSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.InstanceSchema<typeof BuilderExpectation, undefined>, undefined>, v.ReadonlyAction<BuilderExpectation<string, unknown, "option" | "component" | "collection"
|
|
12
|
+
export declare const BuilderExpectationsSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.InstanceSchema<typeof BuilderExpectation, undefined>, undefined>, v.ReadonlyAction<BuilderExpectation<string, unknown, "option" | "component" | "collection">[]>]>;
|
|
13
13
|
export type BuilderExpectations = v.InferOutput<typeof BuilderExpectationsSchema>;
|
|
14
14
|
export declare const BuilderExpectationSerialisedSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
15
15
|
readonly name: v.StringSchema<undefined>;
|
|
16
|
-
readonly kind: v.PicklistSchema<["option", "component", "collection"
|
|
17
|
-
}, undefined>, v.
|
|
16
|
+
readonly kind: v.PicklistSchema<["option", "component", "collection"], undefined>;
|
|
17
|
+
}, undefined>, v.ReadonlyAction<{
|
|
18
18
|
name: string;
|
|
19
|
-
kind: "option" | "component" | "collection"
|
|
20
|
-
}, {
|
|
21
|
-
readonly serialisable: typeof BuilderExpectation;
|
|
22
|
-
readonly instance: v.InstanceSchema<typeof BuilderExpectation, undefined>;
|
|
23
|
-
}>, v.ReadonlyAction<{
|
|
24
|
-
name: string;
|
|
25
|
-
kind: "option" | "component" | "collection" | "detail";
|
|
19
|
+
kind: "option" | "component" | "collection";
|
|
26
20
|
}>]>;
|
|
27
21
|
export type BuilderExpectationSerialised = v.InferOutput<typeof BuilderExpectationSerialisedSchema>;
|
|
28
22
|
export declare const BuilderExpectationsSerialisedSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
29
23
|
readonly name: v.StringSchema<undefined>;
|
|
30
|
-
readonly kind: v.PicklistSchema<["option", "component", "collection"
|
|
31
|
-
}, undefined>, v.
|
|
32
|
-
name: string;
|
|
33
|
-
kind: "option" | "component" | "collection" | "detail";
|
|
34
|
-
}, {
|
|
35
|
-
readonly serialisable: typeof BuilderExpectation;
|
|
36
|
-
readonly instance: v.InstanceSchema<typeof BuilderExpectation, undefined>;
|
|
37
|
-
}>, v.ReadonlyAction<{
|
|
24
|
+
readonly kind: v.PicklistSchema<["option", "component", "collection"], undefined>;
|
|
25
|
+
}, undefined>, v.ReadonlyAction<{
|
|
38
26
|
name: string;
|
|
39
|
-
kind: "option" | "component" | "collection"
|
|
27
|
+
kind: "option" | "component" | "collection";
|
|
40
28
|
}>]>, undefined>, v.ReadonlyAction<Readonly<{
|
|
41
29
|
name: string;
|
|
42
|
-
kind: "option" | "component" | "collection"
|
|
30
|
+
kind: "option" | "component" | "collection";
|
|
43
31
|
}>[]>]>;
|
|
44
32
|
export type BuilderExpectationsSerialised = v.InferOutput<typeof BuilderExpectationsSerialisedSchema>;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
2
|
import { serialisable } from '../serialisable.js';
|
|
3
|
-
export const BuilderExpectationKindSchema = v.picklist([
|
|
4
|
-
'option',
|
|
5
|
-
'component',
|
|
6
|
-
'collection',
|
|
7
|
-
'detail'
|
|
8
|
-
]);
|
|
3
|
+
export const BuilderExpectationKindSchema = v.picklist(['option', 'component', 'collection']);
|
|
9
4
|
export class BuilderExpectation {
|
|
10
5
|
name;
|
|
11
6
|
kind;
|
|
@@ -16,7 +11,7 @@ export class BuilderExpectation {
|
|
|
16
11
|
}
|
|
17
12
|
export const BuilderExpectationSchema = v.instance(BuilderExpectation);
|
|
18
13
|
export const BuilderExpectationsSchema = v.pipe(v.array(BuilderExpectationSchema), v.readonly());
|
|
19
|
-
export const BuilderExpectationSerialisedSchema = serialisable(
|
|
14
|
+
export const BuilderExpectationSerialisedSchema = serialisable(v.object({
|
|
20
15
|
name: v.string(),
|
|
21
16
|
kind: BuilderExpectationKindSchema
|
|
22
17
|
}));
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
export type { BuilderCollectionConfigSerialised, BuilderCollectionPayload, BuilderCollections, BuilderCollectionSerialised, BuilderCollectionsSerialised, BuilderCollectionWhen, BuilderCollectionWhenSerialised,
|
|
3
|
-
export type { BuilderComponentDetailsSerialised, BuilderComponentPayload, BuilderComponents, BuilderComponentSerialised, BuilderComponentsSerialised, BuilderComponentWhen, BuilderComponentWhenSerialised } from './component/index';
|
|
4
|
-
export type { BuilderErrorDuplicateName, BuilderErrorInvalidGatePath, BuilderErrorUnboundParameter, BuilderErrorUnmetExpectation } from './errors';
|
|
5
|
-
export type { BuilderOptionPayload, BuilderOptions, BuilderOptionSerialised, BuilderOptionsSerialised, BuilderOptionValues, BuilderOptionValuesSerialised, BuilderOptionWhen, BuilderOptionWhenSerialised, BuilderSelectTypeLabels, BuilderSelectTypeSerialised, BuilderSelectTypeValues, BuilderToggleTypeSerialised, BuilderToggleValueType } from './option/index';
|
|
6
|
-
export type { BuilderDescription, BuilderDescriptionItem, BuilderErrorPagesUnknownCollection, BuilderUIDescribeSerialised, BuilderUIGeneric, BuilderUIItem, BuilderUIItems, BuilderUIItemsSerialised, BuilderUILabelSerialised, BuilderUIPageSerialised, BuilderUIPagesSerialised, BuilderUIReference, BuilderUIReferences, BuilderUISerialised } from './ui/index';
|
|
1
|
+
export type { BuilderBindings, BuilderBindingsSerialised, BuilderSerialised } from './builder/index';
|
|
2
|
+
export type { BuilderCollectionConfigSerialised, BuilderCollectionPayload, BuilderCollections, BuilderCollectionSerialised, BuilderCollectionsSerialised, BuilderCollectionWhen, BuilderCollectionWhenSerialised, CollectionNamesOf, CollectionShape } from './collection/index';
|
|
3
|
+
export type { BuilderComponentDetailsSerialised, BuilderComponentFields, BuilderComponentFieldSerialised, BuilderComponentFieldsSerialised, BuilderComponentFieldValueType, BuilderComponentPayload, BuilderComponents, BuilderComponentSerialised, BuilderComponentsSerialised, BuilderComponentWhen, BuilderComponentWhenSerialised } from './component/index';
|
|
7
4
|
export type { BuilderExpectationKind, BuilderExpectations, BuilderExpectationSerialised, BuilderExpectationsSerialised } from './expectation';
|
|
8
|
-
export type {
|
|
9
|
-
export type {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
5
|
+
export type { BuilderEntityKind, BuilderEntitySerialised } from './kind.js';
|
|
6
|
+
export type { BuilderModelEntrySerialised } from './entry';
|
|
7
|
+
export type { BuilderInstanceOf, BuilderModelGeneric, BuilderModels, BuilderModelSerialised, BuilderModelState, BuilderModelStateEmpty, BuilderModelStateOf } from './model/index';
|
|
8
|
+
export { BuilderModel, BuilderModelSchema, BuilderModelSerialisedSchema, model, modelsMerge } from './model/index.js';
|
|
9
|
+
export type { BuilderOptionPayload, BuilderOptions, BuilderOptionSerialised, BuilderOptionsSerialised, BuilderOptionValues, BuilderOptionValuesSerialised, BuilderOptionWhen, BuilderOptionWhenSerialised, BuilderSelectTypeLabels, BuilderSelectTypeSerialised, BuilderSelectTypeValues, BuilderToggleTypeSerialised, BuilderToggleValueType } from './option/index';
|
|
10
|
+
export type { BuilderRefEntities, BuilderRefEntity } from './refs.js';
|
|
11
|
+
export type { BuilderDescription, BuilderDescriptionItem, BuilderUIDescribeSerialised, BuilderUIItem, BuilderUIItems, BuilderUIItemSerialised, BuilderUIItemsSerialised, BuilderUIPageSerialised, BuilderUIPagesSerialised, BuilderUIs, BuilderUIsSerialised, BuilderUISerialised } from './ui/index';
|
|
12
|
+
export type { BuilderCollectionConfigValidated, BuilderCollectionsValidated, BuilderCollectionValidated, BuilderComponentsValidated, BuilderComponentValidated, BuilderComponentVariantsValidated, BuilderInstancesValidated, BuilderInstanceValidated, BuilderModelValidated, BuilderOptionsValidated, BuilderOptionValidated, BuilderUIDescribeValidated, BuilderUIItemsValidated, BuilderUIPageValidated, BuilderUIValidated, BuilderValidated } from './validated';
|
|
13
|
+
export type { BuilderEnableConfig, BuilderMatchConfig, BuilderMatchSelectMap, BuilderUnlessConfig, BuilderWhen, BuilderWhenConfig, BuilderWhenSerialised } from './when';
|
|
14
|
+
export { Builder, builder, BuilderSchema, BuilderSerialisedSchema } from './builder/index.js';
|
|
15
|
+
export { BuilderCollection, BuilderCollectionConfig, BuilderCollectionConfigSchema, BuilderCollectionConfigSerialisedSchema, BuilderCollectionSchema, BuilderCollectionSelectMapSerialisedSchema, BuilderCollectionSerialisedSchema, BuilderCollectionsSerialisedSchema, BuilderCollectionWhenSerialisedSchema, collectionConfig, collectionExpectation, collectionWhen } from './collection/index.js';
|
|
16
|
+
export { BuilderComponent, BuilderComponentDetails, BuilderComponentDetailsSchema, BuilderComponentDetailsSerialisedSchema, BuilderComponentField, BuilderComponentFieldSchema, BuilderComponentFieldSerialisedSchema, BuilderComponentFieldsSchema, BuilderComponentFieldsSerialisedSchema, BuilderComponentFieldValueTypeSchema, BuilderComponentSchema, BuilderComponentSelectMapSerialisedSchema, BuilderComponentSerialisedSchema, BuilderComponentsSerialisedSchema, BuilderComponentWhenSerialisedSchema, componentDetails, componentExpectation, componentWhen, detailBoolean, detailNumber, detailString, detailValueSchema } from './component/index.js';
|
|
17
|
+
export { parameter, ref } from '../references.js';
|
|
15
18
|
export { BuilderExpectation, BuilderExpectationKindSchema, BuilderExpectationSchema, BuilderExpectationSerialisedSchema, BuilderExpectationsSchema, BuilderExpectationsSerialisedSchema } from './expectation.js';
|
|
16
|
-
export {
|
|
17
|
-
export { BuilderOption, BuilderOptionSchema, BuilderOptionSerialisedSchema, BuilderOptionsSerialisedSchema, BuilderOptionValuesSchema, BuilderOptionValuesSerialisedSchema, BuilderOptionWhenSerialisedSchema, BuilderSelectType, BuilderSelectTypeSchema, BuilderSelectTypeSerialisedSchema, BuilderToggleType, BuilderToggleTypeSchema, BuilderToggleTypeSerialisedSchema, optionExpectation, optionWhen, select, toggleBoolean, toggleNumber, toggleString } from './option/index.js';
|
|
18
|
-
export {
|
|
19
|
+
export { BuilderEntityKindSchema, BuilderEntitySerialisedSchema } from './kind.js';
|
|
20
|
+
export { BuilderOption, BuilderOptionSchema, BuilderOptionSelectMapSerialisedSchema, BuilderOptionSerialisedSchema, BuilderOptionsSerialisedSchema, BuilderOptionValuesSchema, BuilderOptionValuesSerialisedSchema, BuilderOptionWhenSerialisedSchema, BuilderSelectType, BuilderSelectTypeSchema, BuilderSelectTypeSerialisedSchema, BuilderToggleType, BuilderToggleTypeSchema, BuilderToggleTypeSerialisedSchema, optionExpectation, optionValueSchema, optionWhen, select, toggleBoolean, toggleNumber, toggleString } from './option/index.js';
|
|
21
|
+
export { serialise } from './serialise.js';
|
|
22
|
+
export { BuilderDescriptionItemSchema, BuilderDescriptionSchema, BuilderUI, BuilderUIDescribe, BuilderUIDescribeSchema, BuilderUIDescribeSerialisedSchema, BuilderUIItemSerialisedSchema, BuilderUIItemsSerialisedSchema, BuilderUIPage, BuilderUIPages, BuilderUIPageSchema, BuilderUIPageSerialisedSchema, BuilderUIPagesSchema, BuilderUIPagesSerialisedSchema, BuilderUISchema, BuilderUISerialisedSchema, uis } from './ui/index.js';
|
|
23
|
+
export { BuilderWhenConfigSchema, BuilderWhenEnableSchema, BuilderWhenMatchSchema, BuilderWhenSerialisedSchema, BuilderWhenUnlessSchema, createWhenFactories, createWhenSerialisedSchema } from './when.js';
|
package/dist/entities/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
1
|
+
export { BuilderModel, BuilderModelSchema, BuilderModelSerialisedSchema, model, modelsMerge } from './model/index.js';
|
|
2
|
+
export { Builder, builder, BuilderSchema, BuilderSerialisedSchema } from './builder/index.js';
|
|
3
|
+
export { BuilderCollection, BuilderCollectionConfig, BuilderCollectionConfigSchema, BuilderCollectionConfigSerialisedSchema, BuilderCollectionSchema, BuilderCollectionSelectMapSerialisedSchema, BuilderCollectionSerialisedSchema, BuilderCollectionsSerialisedSchema, BuilderCollectionWhenSerialisedSchema, collectionConfig, collectionExpectation, collectionWhen } from './collection/index.js';
|
|
4
|
+
export { BuilderComponent, BuilderComponentDetails, BuilderComponentDetailsSchema, BuilderComponentDetailsSerialisedSchema, BuilderComponentField, BuilderComponentFieldSchema, BuilderComponentFieldSerialisedSchema, BuilderComponentFieldsSchema, BuilderComponentFieldsSerialisedSchema, BuilderComponentFieldValueTypeSchema, BuilderComponentSchema, BuilderComponentSelectMapSerialisedSchema, BuilderComponentSerialisedSchema, BuilderComponentsSerialisedSchema, BuilderComponentWhenSerialisedSchema, componentDetails, componentExpectation, componentWhen, detailBoolean, detailNumber, detailString, detailValueSchema } from './component/index.js';
|
|
5
|
+
export { parameter, ref } from '../references.js';
|
|
6
6
|
export { BuilderExpectation, BuilderExpectationKindSchema, BuilderExpectationSchema, BuilderExpectationSerialisedSchema, BuilderExpectationsSchema, BuilderExpectationsSerialisedSchema } from './expectation.js';
|
|
7
|
-
export {
|
|
8
|
-
export { BuilderOption, BuilderOptionSchema, BuilderOptionSerialisedSchema, BuilderOptionsSerialisedSchema, BuilderOptionValuesSchema, BuilderOptionValuesSerialisedSchema, BuilderOptionWhenSerialisedSchema, BuilderSelectType, BuilderSelectTypeSchema, BuilderSelectTypeSerialisedSchema, BuilderToggleType, BuilderToggleTypeSchema, BuilderToggleTypeSerialisedSchema, optionExpectation, optionWhen, select, toggleBoolean, toggleNumber, toggleString } from './option/index.js';
|
|
9
|
-
export {
|
|
7
|
+
export { BuilderEntityKindSchema, BuilderEntitySerialisedSchema } from './kind.js';
|
|
8
|
+
export { BuilderOption, BuilderOptionSchema, BuilderOptionSelectMapSerialisedSchema, BuilderOptionSerialisedSchema, BuilderOptionsSerialisedSchema, BuilderOptionValuesSchema, BuilderOptionValuesSerialisedSchema, BuilderOptionWhenSerialisedSchema, BuilderSelectType, BuilderSelectTypeSchema, BuilderSelectTypeSerialisedSchema, BuilderToggleType, BuilderToggleTypeSchema, BuilderToggleTypeSerialisedSchema, optionExpectation, optionValueSchema, optionWhen, select, toggleBoolean, toggleNumber, toggleString } from './option/index.js';
|
|
9
|
+
export { serialise } from './serialise.js';
|
|
10
|
+
export { BuilderDescriptionItemSchema, BuilderDescriptionSchema, BuilderUI, BuilderUIDescribe, BuilderUIDescribeSchema, BuilderUIDescribeSerialisedSchema, BuilderUIItemSerialisedSchema, BuilderUIItemsSerialisedSchema, BuilderUIPage, BuilderUIPages, BuilderUIPageSchema, BuilderUIPageSerialisedSchema, BuilderUIPagesSchema, BuilderUIPagesSerialisedSchema, BuilderUISchema, BuilderUISerialisedSchema, uis } from './ui/index.js';
|
|
11
|
+
export { BuilderWhenConfigSchema, BuilderWhenEnableSchema, BuilderWhenMatchSchema, BuilderWhenSerialisedSchema, BuilderWhenUnlessSchema, createWhenFactories, createWhenSerialisedSchema } from './when.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { EntitiesMap } from './serialise';
|
|
2
|
+
import * as v from 'valibot';
|
|
3
|
+
import { entitiesMap } from './serialise.js';
|
|
4
|
+
export type BuilderEntityKind = keyof typeof entitiesMap;
|
|
5
|
+
export declare const BuilderEntityKindSchema: v.PicklistSchema<readonly ("string" | "number" | "boolean" | "builder" | "model" | "ui" | "select" | "toggle" | "paths" | "expectations" | "uiPage" | "uiDescribe" | "uiPages" | "componentDetails" | "collectionConfig" | "uiItems" | "optionWhen" | "componentWhen" | "collectionWhen" | "optionSelectMap" | "componentSelectMap" | "collectionSelectMap" | "path")[], undefined>;
|
|
6
|
+
export type BuilderEntitySerialised = {
|
|
7
|
+
[Kind in keyof EntitiesMap]: v.InferOutput<EntitiesMap[Kind]['serialised']>;
|
|
8
|
+
}[keyof EntitiesMap];
|
|
9
|
+
export declare const BuilderEntitySerialisedSchema: v.GenericSchema<BuilderEntitySerialised>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { entitiesMap } from './serialise.js';
|
|
3
|
+
const builderEntityKinds = Object.keys(entitiesMap);
|
|
4
|
+
export const BuilderEntityKindSchema = v.picklist(builderEntityKinds);
|
|
5
|
+
export const BuilderEntitySerialisedSchema = v.union(builderEntityKinds.map((kind) => entitiesMap[kind].serialised));
|