@builder-builder/builder 0.0.7 → 0.0.9

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 (220) hide show
  1. package/dist/check.d.ts +2 -1
  2. package/dist/check.js +6 -2
  3. package/dist/entities/builder/builder.d.ts +494 -0
  4. package/dist/entities/builder/builder.js +84 -0
  5. package/dist/entities/builder/builders.d.ts +20 -0
  6. package/dist/entities/builder/builders.js +18 -0
  7. package/dist/entities/builder/expectation.d.ts +12 -0
  8. package/dist/entities/builder/index.d.ts +7 -0
  9. package/dist/entities/builder/index.js +3 -0
  10. package/dist/entities/builder/methods.d.ts +58 -0
  11. package/dist/entities/builder/methods.js +30 -0
  12. package/dist/entities/builder/parameter.d.ts +62 -0
  13. package/dist/entities/builder/parameter.js +18 -0
  14. package/dist/entities/builder/state.d.ts +26 -0
  15. package/dist/entities/builder/validate.d.ts +3 -0
  16. package/dist/entities/builder/validate.js +108 -0
  17. package/dist/entities/collection/collection.d.ts +37 -0
  18. package/dist/entities/collection/collection.js +42 -0
  19. package/dist/entities/collection/config.d.ts +1094 -0
  20. package/dist/entities/collection/config.js +23 -0
  21. package/dist/entities/collection/expectation.d.ts +7 -0
  22. package/dist/entities/collection/expectation.js +4 -0
  23. package/dist/entities/collection/index.d.ts +8 -0
  24. package/dist/entities/collection/index.js +4 -0
  25. package/dist/entities/collection/when.d.ts +9 -0
  26. package/dist/entities/collection/when.js +2 -0
  27. package/dist/entities/component/component.d.ts +403 -0
  28. package/dist/entities/component/component.js +24 -0
  29. package/dist/entities/component/details.d.ts +82 -0
  30. package/dist/entities/component/details.js +17 -0
  31. package/dist/entities/component/expectation.d.ts +8 -0
  32. package/dist/entities/component/expectation.js +7 -0
  33. package/dist/entities/component/index.d.ts +8 -0
  34. package/dist/entities/component/index.js +4 -0
  35. package/dist/entities/component/when.d.ts +11 -0
  36. package/dist/entities/component/when.js +20 -0
  37. package/dist/entities/errors.d.ts +21 -0
  38. package/dist/entities/expectation.d.ts +44 -0
  39. package/dist/entities/expectation.js +23 -0
  40. package/dist/entities/index.d.ts +18 -0
  41. package/dist/entities/index.js +9 -0
  42. package/dist/entities/option/expectation.d.ts +2 -0
  43. package/dist/entities/option/expectation.js +4 -0
  44. package/dist/entities/option/index.d.ts +11 -0
  45. package/dist/entities/option/index.js +6 -0
  46. package/dist/entities/option/option.d.ts +347 -0
  47. package/dist/entities/option/option.js +24 -0
  48. package/dist/entities/option/select.d.ts +49 -0
  49. package/dist/entities/option/select.js +40 -0
  50. package/dist/entities/option/toggle.d.ts +39 -0
  51. package/dist/entities/option/toggle.js +42 -0
  52. package/dist/entities/option/values.d.ts +63 -0
  53. package/dist/entities/option/values.js +8 -0
  54. package/dist/entities/option/when.d.ts +9 -0
  55. package/dist/entities/option/when.js +2 -0
  56. package/dist/entities/serialise.d.ts +3801 -0
  57. package/dist/entities/serialise.js +41 -0
  58. package/dist/entities/ui/describe.d.ts +100 -0
  59. package/dist/entities/ui/describe.js +22 -0
  60. package/dist/entities/ui/index.d.ts +14 -0
  61. package/dist/entities/ui/index.js +7 -0
  62. package/dist/entities/ui/label.d.ts +18 -0
  63. package/dist/entities/ui/label.js +12 -0
  64. package/dist/entities/ui/page.d.ts +96 -0
  65. package/dist/entities/ui/page.js +20 -0
  66. package/dist/entities/ui/pages.d.ts +431 -0
  67. package/dist/entities/ui/pages.js +29 -0
  68. package/dist/entities/ui/parameter.d.ts +7 -0
  69. package/dist/entities/ui/parameter.js +29 -0
  70. package/dist/entities/ui/ui.d.ts +1582 -0
  71. package/dist/entities/ui/ui.js +53 -0
  72. package/dist/entities/ui/uis.d.ts +10 -0
  73. package/dist/entities/ui/uis.js +20 -0
  74. package/dist/entities/ui/validate.d.ts +8 -0
  75. package/dist/entities/ui/validate.js +21 -0
  76. package/dist/entities/validate.d.ts +28 -0
  77. package/dist/entities/validate.js +1 -0
  78. package/dist/entities/when.d.ts +176 -0
  79. package/dist/entities/when.js +47 -0
  80. package/dist/exception.d.ts +8 -0
  81. package/dist/exception.js +7 -0
  82. package/dist/index.d.ts +38 -13
  83. package/dist/index.js +23 -5
  84. package/dist/mappers/assert/builder.d.ts +2 -0
  85. package/dist/mappers/assert/builder.js +46 -0
  86. package/dist/mappers/assert/expectation.d.ts +2 -0
  87. package/dist/mappers/assert/expectation.js +23 -0
  88. package/dist/mappers/assert/index.d.ts +6 -0
  89. package/dist/mappers/assert/index.js +4 -0
  90. package/dist/mappers/assert/model.d.ts +13 -0
  91. package/dist/mappers/assert/model.js +47 -0
  92. package/dist/mappers/assert/models.d.ts +33 -0
  93. package/dist/mappers/assert/models.js +74 -0
  94. package/dist/mappers/assert/ui.d.ts +2 -0
  95. package/dist/mappers/assert/ui.js +22 -0
  96. package/dist/mappers/index.d.ts +7 -0
  97. package/dist/mappers/index.js +4 -0
  98. package/dist/mappers/instance/index.d.ts +1 -0
  99. package/dist/mappers/instance/index.js +1 -0
  100. package/dist/mappers/instance/instance.d.ts +4 -0
  101. package/dist/mappers/instance/instance.js +33 -0
  102. package/dist/mappers/models/component-graph.d.ts +9 -0
  103. package/dist/{core/component/graph.js → mappers/models/component-graph.js} +3 -3
  104. package/dist/{core → mappers/models}/graph.d.ts +4 -1
  105. package/dist/mappers/models/graph.js +17 -0
  106. package/dist/mappers/models/index.d.ts +1 -0
  107. package/dist/mappers/models/index.js +1 -0
  108. package/dist/mappers/models/models.d.ts +3 -0
  109. package/dist/mappers/models/models.js +37 -0
  110. package/dist/mappers/models/option-graph.d.ts +9 -0
  111. package/dist/mappers/models/option-graph.js +77 -0
  112. package/dist/mappers/order/index.d.ts +2 -0
  113. package/dist/mappers/order/index.js +1 -0
  114. package/dist/mappers/order/order.d.ts +14 -0
  115. package/dist/mappers/order/order.js +31 -0
  116. package/dist/mappers/render/index.d.ts +4 -0
  117. package/dist/mappers/render/index.js +2 -0
  118. package/dist/mappers/render/ordinal.d.ts +1 -0
  119. package/dist/mappers/render/ordinal.js +20 -0
  120. package/dist/mappers/render/pages.d.ts +15 -0
  121. package/dist/mappers/render/pages.js +1 -0
  122. package/dist/mappers/render/render.d.ts +8 -0
  123. package/dist/mappers/render/render.js +124 -0
  124. package/dist/mappers/resolve.d.ts +9 -0
  125. package/dist/mappers/resolve.js +57 -0
  126. package/dist/model.d.ts +8 -8
  127. package/dist/paths.d.ts +5 -16
  128. package/dist/paths.js +3 -0
  129. package/dist/primitive.d.ts +5 -0
  130. package/dist/{schemas/primitives.js → primitive.js} +0 -2
  131. package/dist/references.d.ts +60 -0
  132. package/dist/references.js +26 -0
  133. package/dist/serialisable.d.ts +10 -0
  134. package/dist/serialisable.js +5 -0
  135. package/dist/walker/index.d.ts +2 -0
  136. package/dist/walker/index.js +1 -0
  137. package/dist/walker/walkable.d.ts +4 -0
  138. package/dist/walker/walkable.js +4 -0
  139. package/dist/walker/walker.d.ts +18 -0
  140. package/dist/walker/walker.js +103 -0
  141. package/dist/walker/walkers.d.ts +8 -0
  142. package/dist/walker/walkers.js +51 -0
  143. package/package.json +8 -2
  144. package/dist/core/builder.d.ts +0 -74
  145. package/dist/core/builder.js +0 -109
  146. package/dist/core/collection/collection.d.ts +0 -32
  147. package/dist/core/collection/collection.js +0 -37
  148. package/dist/core/collection/index.d.ts +0 -4
  149. package/dist/core/collection/index.js +0 -2
  150. package/dist/core/collection/method.d.ts +0 -30
  151. package/dist/core/collection/method.js +0 -11
  152. package/dist/core/component/component.d.ts +0 -9
  153. package/dist/core/component/component.js +0 -10
  154. package/dist/core/component/graph.d.ts +0 -9
  155. package/dist/core/component/index.d.ts +0 -4
  156. package/dist/core/component/index.js +0 -2
  157. package/dist/core/component/method.d.ts +0 -11
  158. package/dist/core/expectation.d.ts +0 -42
  159. package/dist/core/expectation.js +0 -18
  160. package/dist/core/graph.js +0 -3
  161. package/dist/core/index.d.ts +0 -14
  162. package/dist/core/index.js +0 -7
  163. package/dist/core/option/graph.d.ts +0 -10
  164. package/dist/core/option/graph.js +0 -78
  165. package/dist/core/option/index.d.ts +0 -10
  166. package/dist/core/option/index.js +0 -5
  167. package/dist/core/option/method.d.ts +0 -70
  168. package/dist/core/option/method.js +0 -13
  169. package/dist/core/option/option.d.ts +0 -30
  170. package/dist/core/option/option.js +0 -42
  171. package/dist/core/option/select.d.ts +0 -22
  172. package/dist/core/option/select.js +0 -34
  173. package/dist/core/option/toggle.d.ts +0 -16
  174. package/dist/core/option/toggle.js +0 -29
  175. package/dist/core/parameter.d.ts +0 -48
  176. package/dist/core/parameter.js +0 -31
  177. package/dist/core/validate.d.ts +0 -26
  178. package/dist/core/validate.js +0 -43
  179. package/dist/core/when/config.d.ts +0 -20
  180. package/dist/core/when/config.js +0 -4
  181. package/dist/core/when/constrain.d.ts +0 -14
  182. package/dist/core/when/index.d.ts +0 -5
  183. package/dist/core/when/index.js +0 -2
  184. package/dist/core/when/nullability.d.ts +0 -18
  185. package/dist/core/when/resolve.d.ts +0 -18
  186. package/dist/core/when/resolve.js +0 -22
  187. package/dist/resolve/index.d.ts +0 -10
  188. package/dist/resolve/index.js +0 -5
  189. package/dist/resolve/instance.d.ts +0 -35
  190. package/dist/resolve/instance.js +0 -80
  191. package/dist/resolve/models.d.ts +0 -3
  192. package/dist/resolve/models.js +0 -20
  193. package/dist/resolve/order.d.ts +0 -21
  194. package/dist/resolve/order.js +0 -27
  195. package/dist/resolve/render.d.ts +0 -23
  196. package/dist/resolve/render.js +0 -171
  197. package/dist/resolve/validate.d.ts +0 -37
  198. package/dist/resolve/validate.js +0 -47
  199. package/dist/schemas/description.d.ts +0 -5
  200. package/dist/schemas/description.js +0 -3
  201. package/dist/schemas/index.d.ts +0 -6
  202. package/dist/schemas/index.js +0 -3
  203. package/dist/schemas/primitives.d.ts +0 -9
  204. package/dist/schemas/ui.d.ts +0 -96
  205. package/dist/schemas/ui.js +0 -23
  206. package/dist/serialise/deserialise.d.ts +0 -14
  207. package/dist/serialise/deserialise.js +0 -119
  208. package/dist/serialise/index.d.ts +0 -6
  209. package/dist/serialise/index.js +0 -4
  210. package/dist/serialise/schemas.d.ts +0 -1946
  211. package/dist/serialise/schemas.js +0 -150
  212. package/dist/serialise/serialise.d.ts +0 -13
  213. package/dist/serialise/serialise.js +0 -147
  214. package/dist/serialise/validate.d.ts +0 -26
  215. package/dist/serialise/validate.js +0 -148
  216. package/dist/ui.d.ts +0 -19
  217. package/dist/ui.js +0 -44
  218. /package/dist/{core/component/method.js → entities/builder/expectation.js} +0 -0
  219. /package/dist/{core/when/constrain.js → entities/builder/state.js} +0 -0
  220. /package/dist/{core/when/nullability.js → entities/errors.js} +0 -0
@@ -0,0 +1,23 @@
1
+ import * as v from 'valibot';
2
+ import { refable } from '../../references.js';
3
+ import { serialisable } from '../../serialisable.js';
4
+ import { BuilderSerialisedSchema } from '../builder/index.js';
5
+ export class BuilderCollectionConfig {
6
+ builder;
7
+ min;
8
+ max;
9
+ constructor(builder, min, max) {
10
+ this.builder = builder;
11
+ this.min = min;
12
+ this.max = max;
13
+ }
14
+ }
15
+ export const BuilderCollectionConfigSchema = v.instance(BuilderCollectionConfig);
16
+ export const BuilderCollectionConfigSerialisedSchema = serialisable(BuilderCollectionConfig, v.object({
17
+ builder: refable(v.lazy(() => BuilderSerialisedSchema)),
18
+ min: refable(v.number()),
19
+ max: refable(v.number())
20
+ }));
21
+ export function collectionConfig(builder, min, max) {
22
+ return new BuilderCollectionConfig(builder, min, max);
23
+ }
@@ -0,0 +1,7 @@
1
+ import type { BuilderState } from '../builder/index';
2
+ import type { BuilderExpectations } from '../expectation';
3
+ import type { BuilderCollection } from './collection';
4
+ import { BuilderExpectation } from '../expectation.js';
5
+ export declare function collectionExpectation<const Name extends string>(name: Name): BuilderExpectation<Name, unknown, "collection">;
6
+ export type CollectionsExpected<Expectations extends BuilderExpectations> = Expectations extends readonly [infer Head, ...infer Tail extends BuilderExpectations] ? Head extends BuilderExpectation<infer Name, any, 'collection'> ? [BuilderCollection<Name>, ...CollectionsExpected<Tail>] : CollectionsExpected<Tail> : [];
7
+ export type CollectionsAsserted<State extends BuilderState, Expectations extends BuilderExpectations, Current extends State['collections'] = State['collections'], Asserted extends CollectionsExpected<Expectations> = CollectionsExpected<Expectations>> = Current extends [] ? CollectionsExpected<Expectations> : number extends Asserted['length'] ? Asserted : [...Current, ...Asserted];
@@ -0,0 +1,4 @@
1
+ import { BuilderExpectation } from '../expectation.js';
2
+ export function collectionExpectation(name) {
3
+ return new BuilderExpectation(name, 'collection');
4
+ }
@@ -0,0 +1,8 @@
1
+ export type { BuilderCollectionPayload, BuilderCollections, BuilderCollectionSerialised, BuilderCollectionsSerialised, BuilderCollectionWhenSerialised, BuilderErrorInvalidCollectionBounds, CollectionNamesOf, CollectionShape } from './collection';
2
+ export type { BuilderCollectionConfigSerialised } from './config';
3
+ export type { CollectionsAsserted, CollectionsExpected } from './expectation';
4
+ export type { BuilderCollectionWhen } from './when';
5
+ export { BuilderCollection, BuilderCollectionSchema, BuilderCollectionSerialisedSchema, BuilderCollectionsSerialisedSchema, BuilderCollectionWhenSerialisedSchema } from './collection.js';
6
+ export { BuilderCollectionConfig, BuilderCollectionConfigSchema, BuilderCollectionConfigSerialisedSchema, collectionConfig } from './config.js';
7
+ export { collectionExpectation } from './expectation.js';
8
+ export { collectionWhen } from './when.js';
@@ -0,0 +1,4 @@
1
+ export { BuilderCollection, BuilderCollectionSchema, BuilderCollectionSerialisedSchema, BuilderCollectionsSerialisedSchema, BuilderCollectionWhenSerialisedSchema } from './collection.js';
2
+ export { BuilderCollectionConfig, BuilderCollectionConfigSchema, BuilderCollectionConfigSerialisedSchema, collectionConfig } from './config.js';
3
+ export { collectionExpectation } from './expectation.js';
4
+ export { collectionWhen } from './when.js';
@@ -0,0 +1,9 @@
1
+ import type { Refable } from '../../references';
2
+ import type { BuilderWhen } from '../when';
3
+ import type { BuilderCollectionConfig } from './config';
4
+ export type BuilderCollectionWhen = BuilderWhen<Refable<BuilderCollectionConfig>>;
5
+ export declare const collectionWhen: {
6
+ enable: <const Values extends Refable<BuilderCollectionConfig<Refable<import("..").BuilderGeneric>, Refable<number>, Refable<number>>>>(values: Values) => import("../when").BuilderEnableConfig<Values>;
7
+ match: <const MatchPayload extends Refable<BuilderCollectionConfig<Refable<import("..").BuilderGeneric>, Refable<number>, Refable<number>>>, const MatchPath extends Refable<import("../..").BuilderPath>, const SelectMap extends Refable<import("../when").BuilderMatchSelectMap<Refable<BuilderCollectionConfig<Refable<import("..").BuilderGeneric>, Refable<number>, Refable<number>>>>>>(matchPath: MatchPath, selectMap: SelectMap) => import("../when").BuilderMatchConfig<MatchPayload, MatchPath, SelectMap>;
8
+ unless: <const Values extends Refable<BuilderCollectionConfig<Refable<import("..").BuilderGeneric>, Refable<number>, Refable<number>>>, const UnlessPath extends Refable<import("../..").BuilderPath>>(unlessPath: UnlessPath, disabledValues: import("../..").BuilderPrimitives, values: Values) => import("../when").BuilderUnlessConfig<Values, UnlessPath>;
9
+ };
@@ -0,0 +1,2 @@
1
+ import { createWhenFactories } from '../when.js';
2
+ export const collectionWhen = createWhenFactories();
@@ -0,0 +1,403 @@
1
+ import type { BuilderPaths } from '../../paths';
2
+ import type { Refable } from '../../references';
3
+ import type { BuilderWhen, WhenSerialised } from '../when';
4
+ import type { BuilderComponentDetails, BuilderComponentDetailsSerialised } from './details';
5
+ import * as v from 'valibot';
6
+ export type BuilderComponentPayload = BuilderComponentDetails | BuilderWhen<Refable<BuilderComponentDetails>>;
7
+ export declare class BuilderComponent<const Name extends string = string, const Payload extends Refable<BuilderComponentPayload> = Refable<BuilderComponentPayload>, const GatePaths extends Refable<BuilderPaths> = Refable<BuilderPaths>> {
8
+ readonly type: 'component';
9
+ readonly name: Name;
10
+ readonly payload: Payload;
11
+ readonly gatePaths?: GatePaths;
12
+ constructor(name: Name, payload: Payload, gatePaths?: GatePaths);
13
+ }
14
+ export declare const BuilderComponentSchema: v.InstanceSchema<typeof BuilderComponent, undefined>;
15
+ export type BuilderComponents = ReadonlyArray<BuilderComponent>;
16
+ export declare const BuilderComponentWhenSerialisedSchema: v.GenericSchema;
17
+ export type BuilderComponentWhenSerialised = WhenSerialised<BuilderComponentDetailsSerialised>;
18
+ export declare const BuilderComponentSerialisedSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
19
+ readonly name: v.StringSchema<undefined>;
20
+ readonly payload: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
21
+ readonly type: v.LiteralSchema<"ref", undefined>;
22
+ readonly id: v.StringSchema<undefined>;
23
+ readonly name: v.StringSchema<undefined>;
24
+ }, undefined>, v.ReadonlyAction<{
25
+ type: "ref";
26
+ id: string;
27
+ name: string;
28
+ }>]>, v.InstanceSchema<typeof import("../..").BuilderRef, undefined>, v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
29
+ readonly expectations: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
30
+ readonly type: v.LiteralSchema<"ref", undefined>;
31
+ readonly id: v.StringSchema<undefined>;
32
+ readonly name: v.StringSchema<undefined>;
33
+ }, undefined>, v.ReadonlyAction<{
34
+ type: "ref";
35
+ id: string;
36
+ name: string;
37
+ }>]>, v.InstanceSchema<typeof import("../..").BuilderRef, undefined>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
38
+ readonly name: v.StringSchema<undefined>;
39
+ readonly kind: v.PicklistSchema<["option", "component", "collection", "detail"], undefined>;
40
+ }, undefined>, v.MetadataAction<{
41
+ name: string;
42
+ kind: "option" | "component" | "collection" | "detail";
43
+ }, {
44
+ readonly serialisable: typeof import("..").BuilderExpectation;
45
+ readonly instance: v.InstanceSchema<typeof import("..").BuilderExpectation, undefined>;
46
+ }>, v.ReadonlyAction<{
47
+ name: string;
48
+ kind: "option" | "component" | "collection" | "detail";
49
+ }>]>, undefined>, v.ReadonlyAction<Readonly<{
50
+ name: string;
51
+ kind: "option" | "component" | "collection" | "detail";
52
+ }>[]>]>], undefined>, v.MetadataAction<import("../..").BuilderRef | Readonly<{
53
+ type: "ref";
54
+ id: string;
55
+ name: string;
56
+ }> | readonly Readonly<{
57
+ name: string;
58
+ kind: "option" | "component" | "collection" | "detail";
59
+ }>[], {
60
+ readonly refable: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
61
+ readonly name: v.StringSchema<undefined>;
62
+ readonly kind: v.PicklistSchema<["option", "component", "collection", "detail"], undefined>;
63
+ }, undefined>, v.MetadataAction<{
64
+ name: string;
65
+ kind: "option" | "component" | "collection" | "detail";
66
+ }, {
67
+ readonly serialisable: typeof import("..").BuilderExpectation;
68
+ readonly instance: v.InstanceSchema<typeof import("..").BuilderExpectation, undefined>;
69
+ }>, v.ReadonlyAction<{
70
+ name: string;
71
+ kind: "option" | "component" | "collection" | "detail";
72
+ }>]>, undefined>, v.ReadonlyAction<Readonly<{
73
+ name: string;
74
+ kind: "option" | "component" | "collection" | "detail";
75
+ }>[]>]>;
76
+ }>]>;
77
+ }, undefined>, v.MetadataAction<{
78
+ expectations: import("../..").BuilderRef | Readonly<{
79
+ type: "ref";
80
+ id: string;
81
+ name: string;
82
+ }> | readonly Readonly<{
83
+ name: string;
84
+ kind: "option" | "component" | "collection" | "detail";
85
+ }>[];
86
+ }, {
87
+ readonly serialisable: typeof BuilderComponentDetails;
88
+ readonly instance: v.InstanceSchema<typeof BuilderComponentDetails, undefined>;
89
+ }>, v.ReadonlyAction<{
90
+ expectations: import("../..").BuilderRef | Readonly<{
91
+ type: "ref";
92
+ id: string;
93
+ name: string;
94
+ }> | readonly Readonly<{
95
+ name: string;
96
+ kind: "option" | "component" | "collection" | "detail";
97
+ }>[];
98
+ }>]>, v.GenericSchema], undefined>], undefined>, v.MetadataAction<unknown, {
99
+ readonly refable: v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
100
+ readonly expectations: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
101
+ readonly type: v.LiteralSchema<"ref", undefined>;
102
+ readonly id: v.StringSchema<undefined>;
103
+ readonly name: v.StringSchema<undefined>;
104
+ }, undefined>, v.ReadonlyAction<{
105
+ type: "ref";
106
+ id: string;
107
+ name: string;
108
+ }>]>, v.InstanceSchema<typeof import("../..").BuilderRef, undefined>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
109
+ readonly name: v.StringSchema<undefined>;
110
+ readonly kind: v.PicklistSchema<["option", "component", "collection", "detail"], undefined>;
111
+ }, undefined>, v.MetadataAction<{
112
+ name: string;
113
+ kind: "option" | "component" | "collection" | "detail";
114
+ }, {
115
+ readonly serialisable: typeof import("..").BuilderExpectation;
116
+ readonly instance: v.InstanceSchema<typeof import("..").BuilderExpectation, undefined>;
117
+ }>, v.ReadonlyAction<{
118
+ name: string;
119
+ kind: "option" | "component" | "collection" | "detail";
120
+ }>]>, undefined>, v.ReadonlyAction<Readonly<{
121
+ name: string;
122
+ kind: "option" | "component" | "collection" | "detail";
123
+ }>[]>]>], undefined>, v.MetadataAction<import("../..").BuilderRef | Readonly<{
124
+ type: "ref";
125
+ id: string;
126
+ name: string;
127
+ }> | readonly Readonly<{
128
+ name: string;
129
+ kind: "option" | "component" | "collection" | "detail";
130
+ }>[], {
131
+ readonly refable: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
132
+ readonly name: v.StringSchema<undefined>;
133
+ readonly kind: v.PicklistSchema<["option", "component", "collection", "detail"], undefined>;
134
+ }, undefined>, v.MetadataAction<{
135
+ name: string;
136
+ kind: "option" | "component" | "collection" | "detail";
137
+ }, {
138
+ readonly serialisable: typeof import("..").BuilderExpectation;
139
+ readonly instance: v.InstanceSchema<typeof import("..").BuilderExpectation, undefined>;
140
+ }>, v.ReadonlyAction<{
141
+ name: string;
142
+ kind: "option" | "component" | "collection" | "detail";
143
+ }>]>, undefined>, v.ReadonlyAction<Readonly<{
144
+ name: string;
145
+ kind: "option" | "component" | "collection" | "detail";
146
+ }>[]>]>;
147
+ }>]>;
148
+ }, undefined>, v.MetadataAction<{
149
+ expectations: import("../..").BuilderRef | Readonly<{
150
+ type: "ref";
151
+ id: string;
152
+ name: string;
153
+ }> | readonly Readonly<{
154
+ name: string;
155
+ kind: "option" | "component" | "collection" | "detail";
156
+ }>[];
157
+ }, {
158
+ readonly serialisable: typeof BuilderComponentDetails;
159
+ readonly instance: v.InstanceSchema<typeof BuilderComponentDetails, undefined>;
160
+ }>, v.ReadonlyAction<{
161
+ expectations: import("../..").BuilderRef | Readonly<{
162
+ type: "ref";
163
+ id: string;
164
+ name: string;
165
+ }> | readonly Readonly<{
166
+ name: string;
167
+ kind: "option" | "component" | "collection" | "detail";
168
+ }>[];
169
+ }>]>, v.GenericSchema], undefined>;
170
+ }>]>;
171
+ readonly gatePaths: v.OptionalSchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
172
+ readonly type: v.LiteralSchema<"ref", undefined>;
173
+ readonly id: v.StringSchema<undefined>;
174
+ readonly name: v.StringSchema<undefined>;
175
+ }, undefined>, v.ReadonlyAction<{
176
+ type: "ref";
177
+ id: string;
178
+ name: string;
179
+ }>]>, v.InstanceSchema<typeof import("../..").BuilderRef, 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)[])[] | import("../..").BuilderRef | Readonly<{
180
+ type: "ref";
181
+ id: string;
182
+ name: string;
183
+ }>, {
184
+ readonly refable: 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)[])[]>]>;
185
+ }>]>, undefined>;
186
+ }, undefined>, v.MetadataAction<{
187
+ name: string;
188
+ payload: unknown;
189
+ gatePaths?: readonly (readonly (string | number)[])[] | import("../..").BuilderRef | Readonly<{
190
+ type: "ref";
191
+ id: string;
192
+ name: string;
193
+ }> | undefined;
194
+ }, {
195
+ readonly serialisable: typeof BuilderComponent;
196
+ readonly instance: v.InstanceSchema<typeof BuilderComponent, undefined>;
197
+ }>, v.ReadonlyAction<{
198
+ name: string;
199
+ payload: unknown;
200
+ gatePaths?: readonly (readonly (string | number)[])[] | import("../..").BuilderRef | Readonly<{
201
+ type: "ref";
202
+ id: string;
203
+ name: string;
204
+ }> | undefined;
205
+ }>]>;
206
+ export type BuilderComponentSerialised = v.InferOutput<typeof BuilderComponentSerialisedSchema>;
207
+ export declare const BuilderComponentsSerialisedSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
208
+ readonly name: v.StringSchema<undefined>;
209
+ readonly payload: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
210
+ readonly type: v.LiteralSchema<"ref", undefined>;
211
+ readonly id: v.StringSchema<undefined>;
212
+ readonly name: v.StringSchema<undefined>;
213
+ }, undefined>, v.ReadonlyAction<{
214
+ type: "ref";
215
+ id: string;
216
+ name: string;
217
+ }>]>, v.InstanceSchema<typeof import("../..").BuilderRef, undefined>, v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
218
+ readonly expectations: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
219
+ readonly type: v.LiteralSchema<"ref", undefined>;
220
+ readonly id: v.StringSchema<undefined>;
221
+ readonly name: v.StringSchema<undefined>;
222
+ }, undefined>, v.ReadonlyAction<{
223
+ type: "ref";
224
+ id: string;
225
+ name: string;
226
+ }>]>, v.InstanceSchema<typeof import("../..").BuilderRef, undefined>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
227
+ readonly name: v.StringSchema<undefined>;
228
+ readonly kind: v.PicklistSchema<["option", "component", "collection", "detail"], undefined>;
229
+ }, undefined>, v.MetadataAction<{
230
+ name: string;
231
+ kind: "option" | "component" | "collection" | "detail";
232
+ }, {
233
+ readonly serialisable: typeof import("..").BuilderExpectation;
234
+ readonly instance: v.InstanceSchema<typeof import("..").BuilderExpectation, undefined>;
235
+ }>, v.ReadonlyAction<{
236
+ name: string;
237
+ kind: "option" | "component" | "collection" | "detail";
238
+ }>]>, undefined>, v.ReadonlyAction<Readonly<{
239
+ name: string;
240
+ kind: "option" | "component" | "collection" | "detail";
241
+ }>[]>]>], undefined>, v.MetadataAction<import("../..").BuilderRef | Readonly<{
242
+ type: "ref";
243
+ id: string;
244
+ name: string;
245
+ }> | readonly Readonly<{
246
+ name: string;
247
+ kind: "option" | "component" | "collection" | "detail";
248
+ }>[], {
249
+ readonly refable: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
250
+ readonly name: v.StringSchema<undefined>;
251
+ readonly kind: v.PicklistSchema<["option", "component", "collection", "detail"], undefined>;
252
+ }, undefined>, v.MetadataAction<{
253
+ name: string;
254
+ kind: "option" | "component" | "collection" | "detail";
255
+ }, {
256
+ readonly serialisable: typeof import("..").BuilderExpectation;
257
+ readonly instance: v.InstanceSchema<typeof import("..").BuilderExpectation, undefined>;
258
+ }>, v.ReadonlyAction<{
259
+ name: string;
260
+ kind: "option" | "component" | "collection" | "detail";
261
+ }>]>, undefined>, v.ReadonlyAction<Readonly<{
262
+ name: string;
263
+ kind: "option" | "component" | "collection" | "detail";
264
+ }>[]>]>;
265
+ }>]>;
266
+ }, undefined>, v.MetadataAction<{
267
+ expectations: import("../..").BuilderRef | Readonly<{
268
+ type: "ref";
269
+ id: string;
270
+ name: string;
271
+ }> | readonly Readonly<{
272
+ name: string;
273
+ kind: "option" | "component" | "collection" | "detail";
274
+ }>[];
275
+ }, {
276
+ readonly serialisable: typeof BuilderComponentDetails;
277
+ readonly instance: v.InstanceSchema<typeof BuilderComponentDetails, undefined>;
278
+ }>, v.ReadonlyAction<{
279
+ expectations: import("../..").BuilderRef | Readonly<{
280
+ type: "ref";
281
+ id: string;
282
+ name: string;
283
+ }> | readonly Readonly<{
284
+ name: string;
285
+ kind: "option" | "component" | "collection" | "detail";
286
+ }>[];
287
+ }>]>, v.GenericSchema], undefined>], undefined>, v.MetadataAction<unknown, {
288
+ readonly refable: v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
289
+ readonly expectations: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
290
+ readonly type: v.LiteralSchema<"ref", undefined>;
291
+ readonly id: v.StringSchema<undefined>;
292
+ readonly name: v.StringSchema<undefined>;
293
+ }, undefined>, v.ReadonlyAction<{
294
+ type: "ref";
295
+ id: string;
296
+ name: string;
297
+ }>]>, v.InstanceSchema<typeof import("../..").BuilderRef, undefined>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
298
+ readonly name: v.StringSchema<undefined>;
299
+ readonly kind: v.PicklistSchema<["option", "component", "collection", "detail"], undefined>;
300
+ }, undefined>, v.MetadataAction<{
301
+ name: string;
302
+ kind: "option" | "component" | "collection" | "detail";
303
+ }, {
304
+ readonly serialisable: typeof import("..").BuilderExpectation;
305
+ readonly instance: v.InstanceSchema<typeof import("..").BuilderExpectation, undefined>;
306
+ }>, v.ReadonlyAction<{
307
+ name: string;
308
+ kind: "option" | "component" | "collection" | "detail";
309
+ }>]>, undefined>, v.ReadonlyAction<Readonly<{
310
+ name: string;
311
+ kind: "option" | "component" | "collection" | "detail";
312
+ }>[]>]>], undefined>, v.MetadataAction<import("../..").BuilderRef | Readonly<{
313
+ type: "ref";
314
+ id: string;
315
+ name: string;
316
+ }> | readonly Readonly<{
317
+ name: string;
318
+ kind: "option" | "component" | "collection" | "detail";
319
+ }>[], {
320
+ readonly refable: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
321
+ readonly name: v.StringSchema<undefined>;
322
+ readonly kind: v.PicklistSchema<["option", "component", "collection", "detail"], undefined>;
323
+ }, undefined>, v.MetadataAction<{
324
+ name: string;
325
+ kind: "option" | "component" | "collection" | "detail";
326
+ }, {
327
+ readonly serialisable: typeof import("..").BuilderExpectation;
328
+ readonly instance: v.InstanceSchema<typeof import("..").BuilderExpectation, undefined>;
329
+ }>, v.ReadonlyAction<{
330
+ name: string;
331
+ kind: "option" | "component" | "collection" | "detail";
332
+ }>]>, undefined>, v.ReadonlyAction<Readonly<{
333
+ name: string;
334
+ kind: "option" | "component" | "collection" | "detail";
335
+ }>[]>]>;
336
+ }>]>;
337
+ }, undefined>, v.MetadataAction<{
338
+ expectations: import("../..").BuilderRef | Readonly<{
339
+ type: "ref";
340
+ id: string;
341
+ name: string;
342
+ }> | readonly Readonly<{
343
+ name: string;
344
+ kind: "option" | "component" | "collection" | "detail";
345
+ }>[];
346
+ }, {
347
+ readonly serialisable: typeof BuilderComponentDetails;
348
+ readonly instance: v.InstanceSchema<typeof BuilderComponentDetails, undefined>;
349
+ }>, v.ReadonlyAction<{
350
+ expectations: import("../..").BuilderRef | Readonly<{
351
+ type: "ref";
352
+ id: string;
353
+ name: string;
354
+ }> | readonly Readonly<{
355
+ name: string;
356
+ kind: "option" | "component" | "collection" | "detail";
357
+ }>[];
358
+ }>]>, v.GenericSchema], undefined>;
359
+ }>]>;
360
+ readonly gatePaths: v.OptionalSchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
361
+ readonly type: v.LiteralSchema<"ref", undefined>;
362
+ readonly id: v.StringSchema<undefined>;
363
+ readonly name: v.StringSchema<undefined>;
364
+ }, undefined>, v.ReadonlyAction<{
365
+ type: "ref";
366
+ id: string;
367
+ name: string;
368
+ }>]>, v.InstanceSchema<typeof import("../..").BuilderRef, 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)[])[] | import("../..").BuilderRef | Readonly<{
369
+ type: "ref";
370
+ id: string;
371
+ name: string;
372
+ }>, {
373
+ readonly refable: 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)[])[]>]>;
374
+ }>]>, undefined>;
375
+ }, undefined>, v.MetadataAction<{
376
+ name: string;
377
+ payload: unknown;
378
+ gatePaths?: readonly (readonly (string | number)[])[] | import("../..").BuilderRef | Readonly<{
379
+ type: "ref";
380
+ id: string;
381
+ name: string;
382
+ }> | undefined;
383
+ }, {
384
+ readonly serialisable: typeof BuilderComponent;
385
+ readonly instance: v.InstanceSchema<typeof BuilderComponent, undefined>;
386
+ }>, v.ReadonlyAction<{
387
+ name: string;
388
+ payload: unknown;
389
+ gatePaths?: readonly (readonly (string | number)[])[] | import("../..").BuilderRef | Readonly<{
390
+ type: "ref";
391
+ id: string;
392
+ name: string;
393
+ }> | undefined;
394
+ }>]>, undefined>, v.ReadonlyAction<Readonly<{
395
+ name: string;
396
+ payload: unknown;
397
+ gatePaths?: readonly (readonly (string | number)[])[] | import("../..").BuilderRef | Readonly<{
398
+ type: "ref";
399
+ id: string;
400
+ name: string;
401
+ }> | undefined;
402
+ }>[]>]>;
403
+ export type BuilderComponentsSerialised = v.InferOutput<typeof BuilderComponentsSerialisedSchema>;
@@ -0,0 +1,24 @@
1
+ import * as v from 'valibot';
2
+ import { BuilderPathsSchema } from '../../paths.js';
3
+ import { refable } from '../../references.js';
4
+ import { serialisable } from '../../serialisable.js';
5
+ import { createWhenSerialisedSchema } from '../when.js';
6
+ import { BuilderComponentDetailsSerialisedSchema } from './details.js';
7
+ export class BuilderComponent {
8
+ name;
9
+ payload;
10
+ gatePaths;
11
+ constructor(name, payload, gatePaths) {
12
+ this.name = name;
13
+ this.payload = payload;
14
+ this.gatePaths = gatePaths;
15
+ }
16
+ }
17
+ export const BuilderComponentSchema = v.instance(BuilderComponent);
18
+ export const BuilderComponentWhenSerialisedSchema = createWhenSerialisedSchema(BuilderComponentDetailsSerialisedSchema);
19
+ export const BuilderComponentSerialisedSchema = serialisable(BuilderComponent, v.object({
20
+ name: v.string(),
21
+ payload: refable(v.union([BuilderComponentDetailsSerialisedSchema, BuilderComponentWhenSerialisedSchema])),
22
+ gatePaths: v.optional(refable(BuilderPathsSchema))
23
+ }));
24
+ export const BuilderComponentsSerialisedSchema = v.pipe(v.array(BuilderComponentSerialisedSchema), v.readonly());
@@ -0,0 +1,82 @@
1
+ import type { Refable } from '../../references';
2
+ import type { BuilderExpectations } from '../expectation';
3
+ import * as v from 'valibot';
4
+ export declare class BuilderComponentDetails<Expectations extends Refable<BuilderExpectations> = Refable<BuilderExpectations>> {
5
+ readonly type: 'component-details';
6
+ expectations: Expectations;
7
+ constructor(expectations: Expectations);
8
+ }
9
+ export declare const BuilderComponentDetailsSchema: v.InstanceSchema<typeof BuilderComponentDetails, undefined>;
10
+ export declare const BuilderComponentDetailsSerialisedSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
11
+ readonly expectations: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
12
+ readonly type: v.LiteralSchema<"ref", undefined>;
13
+ readonly id: v.StringSchema<undefined>;
14
+ readonly name: v.StringSchema<undefined>;
15
+ }, undefined>, v.ReadonlyAction<{
16
+ type: "ref";
17
+ id: string;
18
+ name: string;
19
+ }>]>, v.InstanceSchema<typeof import("../..").BuilderRef, undefined>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
20
+ readonly name: v.StringSchema<undefined>;
21
+ readonly kind: v.PicklistSchema<["option", "component", "collection", "detail"], undefined>;
22
+ }, undefined>, v.MetadataAction<{
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<{
35
+ type: "ref";
36
+ id: string;
37
+ name: string;
38
+ }> | readonly Readonly<{
39
+ name: string;
40
+ kind: "option" | "component" | "collection" | "detail";
41
+ }>[], {
42
+ readonly refable: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
43
+ readonly name: v.StringSchema<undefined>;
44
+ readonly kind: v.PicklistSchema<["option", "component", "collection", "detail"], undefined>;
45
+ }, undefined>, v.MetadataAction<{
46
+ name: string;
47
+ kind: "option" | "component" | "collection" | "detail";
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";
62
+ id: string;
63
+ name: string;
64
+ }> | readonly Readonly<{
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<{
73
+ type: "ref";
74
+ id: string;
75
+ name: string;
76
+ }> | readonly Readonly<{
77
+ name: string;
78
+ kind: "option" | "component" | "collection" | "detail";
79
+ }>[];
80
+ }>]>;
81
+ export type BuilderComponentDetailsSerialised = v.InferOutput<typeof BuilderComponentDetailsSerialisedSchema>;
82
+ export declare function componentDetails<const Expectations extends Refable<BuilderExpectations> = Refable<BuilderExpectations>>(expectations?: Expectations): BuilderComponentDetails;
@@ -0,0 +1,17 @@
1
+ import * as v from 'valibot';
2
+ import { BuilderExpectationsSerialisedSchema } from '../expectation.js';
3
+ import { refable } from '../../references.js';
4
+ import { serialisable } from '../../serialisable.js';
5
+ export class BuilderComponentDetails {
6
+ expectations;
7
+ constructor(expectations) {
8
+ this.expectations = expectations;
9
+ }
10
+ }
11
+ export const BuilderComponentDetailsSchema = v.instance(BuilderComponentDetails);
12
+ export const BuilderComponentDetailsSerialisedSchema = serialisable(BuilderComponentDetails, v.object({
13
+ expectations: refable(BuilderExpectationsSerialisedSchema)
14
+ }));
15
+ export function componentDetails(expectations) {
16
+ return new BuilderComponentDetails((expectations ?? []));
17
+ }
@@ -0,0 +1,8 @@
1
+ import type { BuilderState } from '../builder/index';
2
+ import type { BuilderExpectations } from '../expectation';
3
+ import type { BuilderComponent } from './component';
4
+ import { BuilderExpectation } from '../expectation.js';
5
+ export declare function componentExpectation<const Name extends string>(name: Name): BuilderExpectation<Name, never, "component">;
6
+ export declare function detailExpectation<const Name extends string>(name: Name): BuilderExpectation<Name, string, "detail">;
7
+ export type ComponentsExpected<Expectations extends BuilderExpectations> = Expectations extends readonly [infer Head, ...infer Tail extends BuilderExpectations] ? Head extends BuilderExpectation<infer Name, any, 'component'> ? [BuilderComponent<Name>, ...ComponentsExpected<Tail>] : ComponentsExpected<Tail> : [];
8
+ export type ComponentAsserted<State extends BuilderState, 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];
@@ -0,0 +1,7 @@
1
+ import { BuilderExpectation } from '../expectation.js';
2
+ export function componentExpectation(name) {
3
+ return new BuilderExpectation(name, 'component');
4
+ }
5
+ export function detailExpectation(name) {
6
+ return new BuilderExpectation(name, 'detail');
7
+ }
@@ -0,0 +1,8 @@
1
+ export type { BuilderComponentPayload, BuilderComponents, BuilderComponentSerialised, BuilderComponentsSerialised, BuilderComponentWhenSerialised } from './component';
2
+ export type { BuilderComponentDetailsSerialised } from './details';
3
+ export type { ComponentAsserted, ComponentsExpected } from './expectation';
4
+ export type { BuilderComponentWhen } from './when';
5
+ export { BuilderComponent, BuilderComponentSchema, BuilderComponentSerialisedSchema, BuilderComponentsSerialisedSchema, BuilderComponentWhenSerialisedSchema } from './component.js';
6
+ export { BuilderComponentDetails, BuilderComponentDetailsSchema, BuilderComponentDetailsSerialisedSchema, componentDetails } from './details.js';
7
+ export { componentExpectation, detailExpectation } from './expectation.js';
8
+ export { componentWhen } from './when.js';
@@ -0,0 +1,4 @@
1
+ export { BuilderComponent, BuilderComponentSchema, BuilderComponentSerialisedSchema, BuilderComponentsSerialisedSchema, BuilderComponentWhenSerialisedSchema } from './component.js';
2
+ export { BuilderComponentDetails, BuilderComponentDetailsSchema, BuilderComponentDetailsSerialisedSchema, componentDetails } from './details.js';
3
+ export { componentExpectation, detailExpectation } from './expectation.js';
4
+ export { componentWhen } from './when.js';