@builder-builder/builder 0.0.9 → 0.0.10
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/entities/bind.d.ts +4 -0
- package/dist/entities/bind.js +44 -0
- package/dist/entities/builder/bind.d.ts +85 -0
- package/dist/entities/builder/bind.js +9 -0
- package/dist/entities/builder/builder.d.ts +111 -92
- package/dist/entities/builder/builder.js +11 -8
- package/dist/entities/builder/builders.d.ts +23 -8
- package/dist/entities/builder/builders.js +6 -5
- package/dist/entities/builder/index.d.ts +3 -3
- package/dist/entities/builder/index.js +1 -1
- package/dist/entities/builder/methods.d.ts +17 -17
- package/dist/entities/builder/state.d.ts +4 -4
- package/dist/entities/builder/validate.js +7 -7
- package/dist/entities/collection/collection.d.ts +6 -5
- package/dist/entities/collection/collection.js +6 -5
- package/dist/entities/collection/config.d.ts +280 -232
- package/dist/entities/collection/config.js +4 -4
- package/dist/entities/collection/index.d.ts +1 -1
- package/dist/entities/collection/index.js +1 -1
- package/dist/entities/collection/when.d.ts +5 -5
- package/dist/entities/component/component.d.ts +91 -90
- package/dist/entities/component/component.js +5 -4
- package/dist/entities/component/details.d.ts +16 -16
- package/dist/entities/component/details.js +2 -2
- package/dist/entities/component/index.d.ts +1 -1
- package/dist/entities/component/index.js +1 -1
- package/dist/entities/component/when.d.ts +5 -5
- package/dist/entities/index.d.ts +10 -8
- package/dist/entities/index.js +7 -6
- package/dist/entities/kind.d.ts +6 -0
- package/dist/entities/kind.js +6 -0
- package/dist/entities/option/index.d.ts +1 -1
- package/dist/entities/option/index.js +1 -1
- package/dist/entities/option/option.d.ts +39 -38
- package/dist/entities/option/option.js +5 -4
- package/dist/entities/option/values.d.ts +5 -7
- package/dist/entities/option/values.js +4 -4
- package/dist/entities/option/when.d.ts +5 -5
- package/dist/entities/serialise.d.ts +1582 -2226
- package/dist/entities/serialise.js +52 -22
- package/dist/entities/ui/bind.d.ts +10 -0
- package/dist/entities/ui/bind.js +9 -0
- package/dist/entities/ui/describe.d.ts +26 -51
- package/dist/entities/ui/describe.js +3 -4
- package/dist/entities/ui/index.d.ts +5 -7
- package/dist/entities/ui/index.js +2 -3
- package/dist/entities/ui/page.d.ts +26 -51
- package/dist/entities/ui/page.js +3 -4
- package/dist/entities/ui/pages.d.ts +17 -405
- package/dist/entities/ui/pages.js +6 -6
- package/dist/entities/ui/ui.d.ts +307 -688
- package/dist/entities/ui/ui.js +16 -17
- package/dist/entities/ui/uis.d.ts +11 -5
- package/dist/entities/ui/uis.js +9 -10
- package/dist/entities/ui/validate.d.ts +2 -2
- package/dist/entities/ui/validate.js +3 -3
- package/dist/entities/validate.d.ts +3 -3
- package/dist/entities/when.d.ts +45 -44
- package/dist/entities/when.js +10 -7
- package/dist/index.d.ts +19 -15
- package/dist/index.js +6 -3
- package/dist/mappers/assert/builder.js +13 -13
- package/dist/mappers/assert/ui.js +4 -4
- package/dist/mappers/index.d.ts +2 -0
- package/dist/mappers/index.js +1 -0
- package/dist/mappers/refs.d.ts +12 -0
- package/dist/mappers/refs.js +36 -0
- package/dist/mappers/render/render.js +3 -3
- package/dist/model.d.ts +29 -8
- package/dist/model.js +9 -1
- package/dist/references.d.ts +55 -29
- package/dist/references.js +25 -10
- package/dist/walker/walker.d.ts +13 -5
- package/dist/walker/walker.js +39 -27
- package/dist/walker/walkers.d.ts +4 -3
- package/dist/walker/walkers.js +18 -14
- package/package.json +9 -7
- package/dist/entities/builder/parameter.d.ts +0 -62
- package/dist/entities/builder/parameter.js +0 -18
- 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
|
@@ -1,37 +1,67 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
+
import { BuilderPathSchema, BuilderPathsSchema } from '../paths.js';
|
|
2
3
|
import { createWalkerDeserialise, createWalkerSerialise } from '../walker/index.js';
|
|
3
4
|
import { BuilderSchema, BuilderSerialisedSchema } from './builder/index.js';
|
|
4
|
-
import { BuilderCollectionConfigSchema, BuilderCollectionConfigSerialisedSchema,
|
|
5
|
-
import { BuilderComponentDetailsSchema, BuilderComponentDetailsSerialisedSchema,
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { BuilderUIDescribeSchema, BuilderUIDescribeSerialisedSchema,
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
import { BuilderCollectionConfigSchema, BuilderCollectionConfigSerialisedSchema, BuilderCollectionSelectMapSerialisedSchema, BuilderCollectionWhenSerialisedSchema } from './collection/index.js';
|
|
6
|
+
import { BuilderComponentDetailsSchema, BuilderComponentDetailsSerialisedSchema, BuilderComponentSelectMapSerialisedSchema, BuilderComponentWhenSerialisedSchema } from './component/index.js';
|
|
7
|
+
import { BuilderExpectationsSchema, BuilderExpectationsSerialisedSchema } from './expectation.js';
|
|
8
|
+
import { BuilderOptionSelectMapSerialisedSchema, BuilderOptionWhenSerialisedSchema, BuilderSelectTypeSchema, BuilderSelectTypeSerialisedSchema, BuilderToggleTypeSchema, BuilderToggleTypeSerialisedSchema } from './option/index.js';
|
|
9
|
+
import { BuilderUIDescribeSchema, BuilderUIDescribeSerialisedSchema, BuilderUIItemsSerialisedSchema, BuilderUIPageSchema, BuilderUIPageSerialisedSchema, BuilderUIPagesSchema, BuilderUIPagesSerialisedSchema, BuilderUISchema, BuilderUISerialisedSchema } from './ui/index.js';
|
|
10
|
+
export const entitiesByKind = {
|
|
11
|
+
builder: { runtime: BuilderSchema, serialised: BuilderSerialisedSchema },
|
|
12
|
+
ui: { runtime: BuilderUISchema, serialised: BuilderUISerialisedSchema },
|
|
13
|
+
select: { runtime: BuilderSelectTypeSchema, serialised: BuilderSelectTypeSerialisedSchema },
|
|
14
|
+
toggle: { runtime: BuilderToggleTypeSchema, serialised: BuilderToggleTypeSerialisedSchema },
|
|
15
|
+
uiPage: { runtime: BuilderUIPageSchema, serialised: BuilderUIPageSerialisedSchema },
|
|
16
|
+
uiDescribe: { runtime: BuilderUIDescribeSchema, serialised: BuilderUIDescribeSerialisedSchema },
|
|
17
|
+
uiPages: { runtime: BuilderUIPagesSchema, serialised: BuilderUIPagesSerialisedSchema },
|
|
17
18
|
componentDetails: {
|
|
18
|
-
|
|
19
|
+
runtime: BuilderComponentDetailsSchema,
|
|
19
20
|
serialised: BuilderComponentDetailsSerialisedSchema
|
|
20
21
|
},
|
|
21
22
|
collectionConfig: {
|
|
22
|
-
|
|
23
|
+
runtime: BuilderCollectionConfigSchema,
|
|
23
24
|
serialised: BuilderCollectionConfigSerialisedSchema
|
|
24
25
|
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
expectations: {
|
|
27
|
+
runtime: BuilderExpectationsSchema,
|
|
28
|
+
serialised: BuilderExpectationsSerialisedSchema
|
|
29
|
+
},
|
|
30
|
+
uiItems: { runtime: BuilderUIItemsSerialisedSchema, serialised: BuilderUIItemsSerialisedSchema },
|
|
31
|
+
optionWhen: {
|
|
32
|
+
runtime: BuilderOptionWhenSerialisedSchema,
|
|
33
|
+
serialised: BuilderOptionWhenSerialisedSchema
|
|
34
|
+
},
|
|
35
|
+
componentWhen: {
|
|
36
|
+
runtime: BuilderComponentWhenSerialisedSchema,
|
|
37
|
+
serialised: BuilderComponentWhenSerialisedSchema
|
|
38
|
+
},
|
|
39
|
+
collectionWhen: {
|
|
40
|
+
runtime: BuilderCollectionWhenSerialisedSchema,
|
|
41
|
+
serialised: BuilderCollectionWhenSerialisedSchema
|
|
42
|
+
},
|
|
43
|
+
optionSelectMap: {
|
|
44
|
+
runtime: BuilderOptionSelectMapSerialisedSchema,
|
|
45
|
+
serialised: BuilderOptionSelectMapSerialisedSchema
|
|
46
|
+
},
|
|
47
|
+
componentSelectMap: {
|
|
48
|
+
runtime: BuilderComponentSelectMapSerialisedSchema,
|
|
49
|
+
serialised: BuilderComponentSelectMapSerialisedSchema
|
|
50
|
+
},
|
|
51
|
+
collectionSelectMap: {
|
|
52
|
+
runtime: BuilderCollectionSelectMapSerialisedSchema,
|
|
53
|
+
serialised: BuilderCollectionSelectMapSerialisedSchema
|
|
54
|
+
},
|
|
55
|
+
paths: { runtime: BuilderPathsSchema, serialised: BuilderPathsSchema },
|
|
56
|
+
path: { runtime: BuilderPathSchema, serialised: BuilderPathSchema },
|
|
57
|
+
number: { runtime: v.number(), serialised: v.number() },
|
|
58
|
+
string: { runtime: v.string(), serialised: v.string() },
|
|
59
|
+
boolean: { runtime: v.boolean(), serialised: v.boolean() }
|
|
30
60
|
};
|
|
31
61
|
const walkerSerialise = createWalkerSerialise();
|
|
32
62
|
const walkerDeserialise = createWalkerDeserialise();
|
|
33
|
-
export const serialise = deriveMap(
|
|
34
|
-
export const deserialise = deriveMap(
|
|
63
|
+
export const serialise = deriveMap(entitiesByKind, ({ serialised }) => (input) => walkerSerialise(serialised, input));
|
|
64
|
+
export const deserialise = deriveMap(entitiesByKind, ({ serialised }) => (data) => walkerDeserialise(serialised, v.parse(serialised, data)));
|
|
35
65
|
function deriveMap(input, build) {
|
|
36
66
|
const result = {};
|
|
37
67
|
Object.entries(input).forEach(([name, entry]) => {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BuilderRef, Paramable } from '../../references';
|
|
2
|
+
import type { BuilderPaths } from '../../paths';
|
|
3
|
+
import type { BuilderBindings, BuilderGeneric, BuilderStateOf } from '../builder/index';
|
|
4
|
+
import type { BuilderUIItems } from './pages';
|
|
5
|
+
import type { BuilderUIGeneric } from './ui';
|
|
6
|
+
import { BuilderUI } from './ui.js';
|
|
7
|
+
type BuilderUIBindingValue = string | number | boolean | BuilderUIGeneric | BuilderUIItems | BuilderPaths | BuilderGeneric | BuilderRef;
|
|
8
|
+
export type BuilderUIBindings<BuilderType extends Paramable<BuilderGeneric> = BuilderGeneric> = BuilderType extends BuilderGeneric ? Record<string, BuilderUIBindingValue | BuilderBindings<BuilderStateOf<BuilderType>>[keyof BuilderBindings<BuilderStateOf<BuilderType>>]> : Record<string, BuilderUIBindingValue>;
|
|
9
|
+
export declare function bindUI<BuilderType extends Paramable<BuilderGeneric>>(ui: BuilderUI<BuilderType>, bindings: BuilderUIBindings<BuilderType>): BuilderUI<BuilderType>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { bind } from '../bind.js';
|
|
2
|
+
import { BuilderUI } from './ui.js';
|
|
3
|
+
import { flattenUIItems, mergeUIParts } from './uis.js';
|
|
4
|
+
export function bindUI(ui, bindings) {
|
|
5
|
+
return bind(ui, bindings, (walked, walkedNonRefValues, remainingParameters, newReferences) => {
|
|
6
|
+
const merged = mergeUIParts(walkedNonRefValues);
|
|
7
|
+
return new BuilderUI(walked.builder, [...remainingParameters, ...merged.parameters], flattenUIItems(walked.items), [...walked.expectations, ...merged.expectations], [...walked.references, ...newReferences, ...merged.references]);
|
|
8
|
+
});
|
|
9
|
+
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { BuilderPaths } from '../../paths';
|
|
2
|
-
import type {
|
|
3
|
-
import type { BuilderUILabel } from './label';
|
|
2
|
+
import type { Paramable } from '../../references';
|
|
4
3
|
import * as v from 'valibot';
|
|
5
4
|
export declare const BuilderDescriptionItemSchema: v.SchemaWithPipe<readonly [v.TupleSchema<[v.StringSchema<undefined>, v.StringSchema<undefined>], undefined>, v.ReadonlyAction<[string, string]>]>;
|
|
6
5
|
export type BuilderDescriptionItem = v.InferOutput<typeof BuilderDescriptionItemSchema>;
|
|
7
6
|
export declare const BuilderDescriptionSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.TupleSchema<[v.StringSchema<undefined>, v.StringSchema<undefined>], undefined>, v.ReadonlyAction<[string, string]>]>, undefined>, v.ReadonlyAction<(readonly [string, string])[]>]>;
|
|
8
7
|
export type BuilderDescription = v.InferOutput<typeof BuilderDescriptionSchema>;
|
|
9
|
-
export declare class BuilderUIDescribe<const Label extends
|
|
8
|
+
export declare class BuilderUIDescribe<const Label extends Paramable<string> = Paramable<string>, const Paths extends Paramable<BuilderPaths> = Paramable<BuilderPaths>> {
|
|
10
9
|
readonly type: "describe";
|
|
11
10
|
readonly label: Label;
|
|
12
11
|
readonly paths: Paths;
|
|
@@ -16,85 +15,61 @@ export declare const BuilderUIDescribeSchema: v.InstanceSchema<typeof BuilderUID
|
|
|
16
15
|
export declare const BuilderUIDescribeSerialisedSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
17
16
|
readonly type: v.LiteralSchema<"describe", undefined>;
|
|
18
17
|
readonly label: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
19
|
-
readonly type: v.LiteralSchema<"
|
|
18
|
+
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
20
19
|
readonly id: v.StringSchema<undefined>;
|
|
21
20
|
readonly name: v.StringSchema<undefined>;
|
|
22
21
|
}, undefined>, v.ReadonlyAction<{
|
|
23
|
-
type: "
|
|
22
|
+
type: "parameter";
|
|
24
23
|
id: string;
|
|
25
24
|
name: string;
|
|
26
|
-
}>]>, v.InstanceSchema<typeof import("../..").
|
|
27
|
-
|
|
28
|
-
}, undefined>, v.MetadataAction<{
|
|
29
|
-
label: string;
|
|
30
|
-
}, {
|
|
31
|
-
readonly serialisable: typeof BuilderUILabel;
|
|
32
|
-
readonly instance: v.InstanceSchema<typeof BuilderUILabel, undefined>;
|
|
33
|
-
}>, v.ReadonlyAction<{
|
|
34
|
-
label: string;
|
|
35
|
-
}>]>], undefined>, v.MetadataAction<import("../..").BuilderRef | Readonly<{
|
|
36
|
-
type: "ref";
|
|
25
|
+
}>]>, v.InstanceSchema<typeof import("../..").BuilderParameter, undefined>, v.StringSchema<undefined>], undefined>, v.MetadataAction<string | Readonly<{
|
|
26
|
+
type: "parameter";
|
|
37
27
|
id: string;
|
|
38
28
|
name: string;
|
|
39
|
-
}> |
|
|
40
|
-
|
|
41
|
-
}>, {
|
|
42
|
-
readonly refable: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
43
|
-
readonly label: v.StringSchema<undefined>;
|
|
44
|
-
}, undefined>, v.MetadataAction<{
|
|
45
|
-
label: string;
|
|
46
|
-
}, {
|
|
47
|
-
readonly serialisable: typeof BuilderUILabel;
|
|
48
|
-
readonly instance: v.InstanceSchema<typeof BuilderUILabel, undefined>;
|
|
49
|
-
}>, v.ReadonlyAction<{
|
|
50
|
-
label: string;
|
|
51
|
-
}>]>;
|
|
29
|
+
}> | import("../..").BuilderParameter<string>, {
|
|
30
|
+
readonly paramable: v.StringSchema<undefined>;
|
|
52
31
|
}>]>;
|
|
53
32
|
readonly paths: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
54
|
-
readonly type: v.LiteralSchema<"
|
|
33
|
+
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
55
34
|
readonly id: v.StringSchema<undefined>;
|
|
56
35
|
readonly name: v.StringSchema<undefined>;
|
|
57
36
|
}, undefined>, v.ReadonlyAction<{
|
|
58
|
-
type: "
|
|
37
|
+
type: "parameter";
|
|
59
38
|
id: string;
|
|
60
39
|
name: string;
|
|
61
|
-
}>]>, v.InstanceSchema<typeof import("../..").
|
|
62
|
-
type: "
|
|
40
|
+
}>]>, v.InstanceSchema<typeof import("../..").BuilderParameter, undefined>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>, undefined>, v.ReadonlyAction<(readonly (string | number)[])[]>]>], undefined>, v.MetadataAction<readonly (readonly (string | number)[])[] | Readonly<{
|
|
41
|
+
type: "parameter";
|
|
63
42
|
id: string;
|
|
64
43
|
name: string;
|
|
65
|
-
}>, {
|
|
66
|
-
readonly
|
|
44
|
+
}> | import("../..").BuilderParameter<string>, {
|
|
45
|
+
readonly paramable: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>, undefined>, v.ReadonlyAction<(readonly (string | number)[])[]>]>;
|
|
67
46
|
}>]>;
|
|
68
47
|
}, undefined>, v.MetadataAction<{
|
|
69
48
|
type: "describe";
|
|
70
|
-
label:
|
|
71
|
-
type: "
|
|
49
|
+
label: string | Readonly<{
|
|
50
|
+
type: "parameter";
|
|
72
51
|
id: string;
|
|
73
52
|
name: string;
|
|
74
|
-
}> |
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
paths: readonly (readonly (string | number)[])[] | import("../..").BuilderRef | Readonly<{
|
|
78
|
-
type: "ref";
|
|
53
|
+
}> | import("../..").BuilderParameter<string>;
|
|
54
|
+
paths: readonly (readonly (string | number)[])[] | Readonly<{
|
|
55
|
+
type: "parameter";
|
|
79
56
|
id: string;
|
|
80
57
|
name: string;
|
|
81
|
-
}>;
|
|
58
|
+
}> | import("../..").BuilderParameter<string>;
|
|
82
59
|
}, {
|
|
83
60
|
readonly serialisable: typeof BuilderUIDescribe;
|
|
84
61
|
readonly instance: v.InstanceSchema<typeof BuilderUIDescribe, undefined>;
|
|
85
62
|
}>, v.ReadonlyAction<{
|
|
86
63
|
type: "describe";
|
|
87
|
-
label:
|
|
88
|
-
type: "
|
|
64
|
+
label: string | Readonly<{
|
|
65
|
+
type: "parameter";
|
|
89
66
|
id: string;
|
|
90
67
|
name: string;
|
|
91
|
-
}> |
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
paths: readonly (readonly (string | number)[])[] | import("../..").BuilderRef | Readonly<{
|
|
95
|
-
type: "ref";
|
|
68
|
+
}> | import("../..").BuilderParameter<string>;
|
|
69
|
+
paths: readonly (readonly (string | number)[])[] | Readonly<{
|
|
70
|
+
type: "parameter";
|
|
96
71
|
id: string;
|
|
97
72
|
name: string;
|
|
98
|
-
}>;
|
|
73
|
+
}> | import("../..").BuilderParameter<string>;
|
|
99
74
|
}>]>;
|
|
100
75
|
export type BuilderUIDescribeSerialised = v.InferOutput<typeof BuilderUIDescribeSerialisedSchema>;
|
|
@@ -1,8 +1,7 @@
|
|
|
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 { BuilderUILabelSerialisedSchema } from './label.js';
|
|
6
5
|
export const BuilderDescriptionItemSchema = v.pipe(v.tuple([v.string(), v.string()]), v.readonly());
|
|
7
6
|
export const BuilderDescriptionSchema = v.pipe(v.array(BuilderDescriptionItemSchema), v.readonly());
|
|
8
7
|
export class BuilderUIDescribe {
|
|
@@ -17,6 +16,6 @@ export class BuilderUIDescribe {
|
|
|
17
16
|
export const BuilderUIDescribeSchema = v.instance(BuilderUIDescribe);
|
|
18
17
|
export const BuilderUIDescribeSerialisedSchema = serialisable(BuilderUIDescribe, v.object({
|
|
19
18
|
type: v.literal('describe'),
|
|
20
|
-
label:
|
|
21
|
-
paths:
|
|
19
|
+
label: paramable(v.string()),
|
|
20
|
+
paths: paramable(BuilderPathsSchema)
|
|
22
21
|
}));
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
export type { BuilderDescription, BuilderDescriptionItem, BuilderUIDescribeSerialised } from './describe';
|
|
2
|
-
export type { BuilderUILabelSerialised } from './label';
|
|
3
2
|
export type { BuilderUIPageSerialised } from './page';
|
|
4
|
-
export type { BuilderUIItem, BuilderUIItems, BuilderUIItemsSerialised, BuilderUIPagesSerialised } from './pages';
|
|
5
|
-
export type { BuilderUIBindings } from './
|
|
6
|
-
export type { BuilderUIGeneric,
|
|
3
|
+
export type { BuilderUIItem, BuilderUIItems, BuilderUIItemSerialised, BuilderUIItemsSerialised, BuilderUIPagesSerialised } from './pages';
|
|
4
|
+
export type { BuilderUIBindings } from './bind';
|
|
5
|
+
export type { BuilderUIGeneric, BuilderUIPart, BuilderUIParts, BuilderUISerialised } from './ui';
|
|
7
6
|
export type { BuilderErrorPagesUnknownCollection } from './validate';
|
|
8
7
|
export { BuilderDescriptionItemSchema, BuilderDescriptionSchema, BuilderUIDescribe, BuilderUIDescribeSchema, BuilderUIDescribeSerialisedSchema } from './describe.js';
|
|
9
|
-
export { BuilderUILabel, BuilderUILabelSchema, BuilderUILabelSerialisedSchema } from './label.js';
|
|
10
8
|
export { BuilderUIPage, BuilderUIPageSchema, BuilderUIPageSerialisedSchema } from './page.js';
|
|
11
|
-
export { BuilderUIItemsSerialisedSchema, BuilderUIPages, BuilderUIPagesSchema, BuilderUIPagesSerialisedSchema } from './pages.js';
|
|
12
|
-
export { bindUI } from './
|
|
9
|
+
export { BuilderUIItemSerialisedSchema, BuilderUIItemsSerialisedSchema, BuilderUIPages, BuilderUIPagesSchema, BuilderUIPagesSerialisedSchema } from './pages.js';
|
|
10
|
+
export { bindUI } from './bind.js';
|
|
13
11
|
export { BuilderUI, BuilderUISchema, BuilderUISerialisedSchema } from './ui.js';
|
|
14
12
|
export { mergeUIParts, uis } from './uis.js';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { BuilderDescriptionItemSchema, BuilderDescriptionSchema, BuilderUIDescribe, BuilderUIDescribeSchema, BuilderUIDescribeSerialisedSchema } from './describe.js';
|
|
2
|
-
export { BuilderUILabel, BuilderUILabelSchema, BuilderUILabelSerialisedSchema } from './label.js';
|
|
3
2
|
export { BuilderUIPage, BuilderUIPageSchema, BuilderUIPageSerialisedSchema } from './page.js';
|
|
4
|
-
export { BuilderUIItemsSerialisedSchema, BuilderUIPages, BuilderUIPagesSchema, BuilderUIPagesSerialisedSchema } from './pages.js';
|
|
5
|
-
export { bindUI } from './
|
|
3
|
+
export { BuilderUIItemSerialisedSchema, BuilderUIItemsSerialisedSchema, BuilderUIPages, BuilderUIPagesSchema, BuilderUIPagesSerialisedSchema } from './pages.js';
|
|
4
|
+
export { bindUI } from './bind.js';
|
|
6
5
|
export { BuilderUI, BuilderUISchema, BuilderUISerialisedSchema } from './ui.js';
|
|
7
6
|
export { mergeUIParts, uis } from './uis.js';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { BuilderPaths } from '../../paths';
|
|
2
|
-
import type {
|
|
3
|
-
import type { BuilderUILabel } from './label';
|
|
2
|
+
import type { Paramable } from '../../references';
|
|
4
3
|
import * as v from 'valibot';
|
|
5
|
-
export declare class BuilderUIPage<const Label extends
|
|
4
|
+
export declare class BuilderUIPage<const Label extends Paramable<string> = Paramable<string>, const Paths extends Paramable<BuilderPaths> = Paramable<BuilderPaths>> {
|
|
6
5
|
readonly type: "page";
|
|
7
6
|
readonly label: Label;
|
|
8
7
|
readonly paths: Paths;
|
|
@@ -12,85 +11,61 @@ export declare const BuilderUIPageSchema: v.InstanceSchema<typeof BuilderUIPage,
|
|
|
12
11
|
export declare const BuilderUIPageSerialisedSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
13
12
|
readonly type: v.LiteralSchema<"page", undefined>;
|
|
14
13
|
readonly label: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
15
|
-
readonly type: v.LiteralSchema<"
|
|
14
|
+
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
16
15
|
readonly id: v.StringSchema<undefined>;
|
|
17
16
|
readonly name: v.StringSchema<undefined>;
|
|
18
17
|
}, undefined>, v.ReadonlyAction<{
|
|
19
|
-
type: "
|
|
18
|
+
type: "parameter";
|
|
20
19
|
id: string;
|
|
21
20
|
name: string;
|
|
22
|
-
}>]>, v.InstanceSchema<typeof import("../..").
|
|
23
|
-
|
|
24
|
-
}, undefined>, v.MetadataAction<{
|
|
25
|
-
label: string;
|
|
26
|
-
}, {
|
|
27
|
-
readonly serialisable: typeof BuilderUILabel;
|
|
28
|
-
readonly instance: v.InstanceSchema<typeof BuilderUILabel, undefined>;
|
|
29
|
-
}>, v.ReadonlyAction<{
|
|
30
|
-
label: string;
|
|
31
|
-
}>]>], undefined>, v.MetadataAction<import("../..").BuilderRef | Readonly<{
|
|
32
|
-
type: "ref";
|
|
21
|
+
}>]>, v.InstanceSchema<typeof import("../..").BuilderParameter, undefined>, v.StringSchema<undefined>], undefined>, v.MetadataAction<string | Readonly<{
|
|
22
|
+
type: "parameter";
|
|
33
23
|
id: string;
|
|
34
24
|
name: string;
|
|
35
|
-
}> |
|
|
36
|
-
|
|
37
|
-
}>, {
|
|
38
|
-
readonly refable: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
39
|
-
readonly label: v.StringSchema<undefined>;
|
|
40
|
-
}, undefined>, v.MetadataAction<{
|
|
41
|
-
label: string;
|
|
42
|
-
}, {
|
|
43
|
-
readonly serialisable: typeof BuilderUILabel;
|
|
44
|
-
readonly instance: v.InstanceSchema<typeof BuilderUILabel, undefined>;
|
|
45
|
-
}>, v.ReadonlyAction<{
|
|
46
|
-
label: string;
|
|
47
|
-
}>]>;
|
|
25
|
+
}> | import("../..").BuilderParameter<string>, {
|
|
26
|
+
readonly paramable: v.StringSchema<undefined>;
|
|
48
27
|
}>]>;
|
|
49
28
|
readonly paths: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
50
|
-
readonly type: v.LiteralSchema<"
|
|
29
|
+
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
51
30
|
readonly id: v.StringSchema<undefined>;
|
|
52
31
|
readonly name: v.StringSchema<undefined>;
|
|
53
32
|
}, undefined>, v.ReadonlyAction<{
|
|
54
|
-
type: "
|
|
33
|
+
type: "parameter";
|
|
55
34
|
id: string;
|
|
56
35
|
name: string;
|
|
57
|
-
}>]>, v.InstanceSchema<typeof import("../..").
|
|
58
|
-
type: "
|
|
36
|
+
}>]>, v.InstanceSchema<typeof import("../..").BuilderParameter, undefined>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>, undefined>, v.ReadonlyAction<(readonly (string | number)[])[]>]>], undefined>, v.MetadataAction<readonly (readonly (string | number)[])[] | Readonly<{
|
|
37
|
+
type: "parameter";
|
|
59
38
|
id: string;
|
|
60
39
|
name: string;
|
|
61
|
-
}>, {
|
|
62
|
-
readonly
|
|
40
|
+
}> | import("../..").BuilderParameter<string>, {
|
|
41
|
+
readonly paramable: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>, undefined>, v.ReadonlyAction<(readonly (string | number)[])[]>]>;
|
|
63
42
|
}>]>;
|
|
64
43
|
}, undefined>, v.MetadataAction<{
|
|
65
44
|
type: "page";
|
|
66
|
-
label:
|
|
67
|
-
type: "
|
|
45
|
+
label: string | Readonly<{
|
|
46
|
+
type: "parameter";
|
|
68
47
|
id: string;
|
|
69
48
|
name: string;
|
|
70
|
-
}> |
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
paths: readonly (readonly (string | number)[])[] | import("../..").BuilderRef | Readonly<{
|
|
74
|
-
type: "ref";
|
|
49
|
+
}> | import("../..").BuilderParameter<string>;
|
|
50
|
+
paths: readonly (readonly (string | number)[])[] | Readonly<{
|
|
51
|
+
type: "parameter";
|
|
75
52
|
id: string;
|
|
76
53
|
name: string;
|
|
77
|
-
}>;
|
|
54
|
+
}> | import("../..").BuilderParameter<string>;
|
|
78
55
|
}, {
|
|
79
56
|
readonly serialisable: typeof BuilderUIPage;
|
|
80
57
|
readonly instance: v.InstanceSchema<typeof BuilderUIPage, undefined>;
|
|
81
58
|
}>, v.ReadonlyAction<{
|
|
82
59
|
type: "page";
|
|
83
|
-
label:
|
|
84
|
-
type: "
|
|
60
|
+
label: string | Readonly<{
|
|
61
|
+
type: "parameter";
|
|
85
62
|
id: string;
|
|
86
63
|
name: string;
|
|
87
|
-
}> |
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
paths: readonly (readonly (string | number)[])[] | import("../..").BuilderRef | Readonly<{
|
|
91
|
-
type: "ref";
|
|
64
|
+
}> | import("../..").BuilderParameter<string>;
|
|
65
|
+
paths: readonly (readonly (string | number)[])[] | Readonly<{
|
|
66
|
+
type: "parameter";
|
|
92
67
|
id: string;
|
|
93
68
|
name: string;
|
|
94
|
-
}>;
|
|
69
|
+
}> | import("../..").BuilderParameter<string>;
|
|
95
70
|
}>]>;
|
|
96
71
|
export type BuilderUIPageSerialised = v.InferOutput<typeof BuilderUIPageSerialisedSchema>;
|
package/dist/entities/ui/page.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
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 { BuilderUILabelSerialisedSchema } from './label.js';
|
|
6
5
|
export class BuilderUIPage {
|
|
7
6
|
type = 'page';
|
|
8
7
|
label;
|
|
@@ -15,6 +14,6 @@ export class BuilderUIPage {
|
|
|
15
14
|
export const BuilderUIPageSchema = v.instance(BuilderUIPage);
|
|
16
15
|
export const BuilderUIPageSerialisedSchema = serialisable(BuilderUIPage, v.object({
|
|
17
16
|
type: v.literal('page'),
|
|
18
|
-
label:
|
|
19
|
-
paths:
|
|
17
|
+
label: paramable(v.string()),
|
|
18
|
+
paths: paramable(BuilderPathsSchema)
|
|
20
19
|
}));
|