foldkit-bundle-surface 0.1.3 → 0.2.1
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/index.d.mts +224 -97
- package/dist/index.d.mts.map +1 -1
- package/package.json +10 -8
package/dist/index.d.mts
CHANGED
|
@@ -8,6 +8,124 @@ import * as Update from "foldkit/update";
|
|
|
8
8
|
import { CallableTaggedStruct } from "foldkit/schema";
|
|
9
9
|
import { Html, HtmlBuilder } from "foldkit/html";
|
|
10
10
|
import "foldkit/url";
|
|
11
|
+
import "foldkit/message";
|
|
12
|
+
//#region ../bundle/src/placed.d.ts
|
|
13
|
+
declare const PlacedTypeId: unique symbol;
|
|
14
|
+
/**
|
|
15
|
+
* Args for a placement: a static value, or a factory deriving them from the
|
|
16
|
+
* parent seed — the fields `assembly.initial(rest)` was given, before any
|
|
17
|
+
* placement initialised. A factory runs once per initialization and its result
|
|
18
|
+
* is retained for the placement's `init`, `update`, helpers, Subscriptions,
|
|
19
|
+
* and resources; it never re-runs against changing parent state, so keep it
|
|
20
|
+
* pure of its seed.
|
|
21
|
+
*
|
|
22
|
+
* When no initialization ran — a hand-built Model in a test, which never went
|
|
23
|
+
* through `initial` — `update` derives from the given parent per use, without
|
|
24
|
+
* retaining, so each Model is folded with its own seed.
|
|
25
|
+
*
|
|
26
|
+
* Read only seed fields (route, auth, workspace, ...), never sibling
|
|
27
|
+
* placement fields: every factory sees the same base seed, so a sibling read
|
|
28
|
+
* is consistently absent rather than order-dependent.
|
|
29
|
+
*/
|
|
30
|
+
type ArgsSource<Seed, Args> = Args | ((seed: Seed) => Args);
|
|
31
|
+
interface PlaceConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, ParentSeed = Parent> {
|
|
32
|
+
/**
|
|
33
|
+
* The bundle's args: a static value, or a factory from the parent seed (the
|
|
34
|
+
* fields `assembly.initial(rest)` was given, minus this placement's own
|
|
35
|
+
* field). A factory is computed once per initialization and retained for
|
|
36
|
+
* `init`, `update`, and helpers. Subscriptions and resources built from it
|
|
37
|
+
* require `initial`/`config` to have run first; a bundle with neither
|
|
38
|
+
* contributes empty records either way.
|
|
39
|
+
*/
|
|
40
|
+
readonly args?: ArgsSource<ParentSeed, Args>;
|
|
41
|
+
/** Handles the child's OutMessage in parent terms, with the child already written back. */
|
|
42
|
+
readonly onOut?: (outMessage: OutMessage, context: Update.FoldContext<Message, LinkMessage>) => Update.Step<NoInfer<Parent>, OutStepMessage, R2>;
|
|
43
|
+
/**
|
|
44
|
+
* Observes each of the child's Messages in parent terms, after the child has
|
|
45
|
+
* handled it and its `onOut` has run, so the parent's own update needs no arm
|
|
46
|
+
* for the wrapper. Helpers are not Messages and do not reach it.
|
|
47
|
+
*/
|
|
48
|
+
readonly onMessage?: (message: Message) => Update.Step<NoInfer<Parent>, OutStepMessage, R2>;
|
|
49
|
+
/** Prefix for the placement's Subscription and resource keys. Defaults to `Name@path`. */
|
|
50
|
+
readonly key?: string;
|
|
51
|
+
/** A gate beside the Link's own: Subscriptions and resources run only while both hold. */
|
|
52
|
+
readonly when?: (parent: Parent) => boolean;
|
|
53
|
+
}
|
|
54
|
+
/** A lifted resource record: each child entry in parent terms, keyed by the placement. */
|
|
55
|
+
type PlacedResources<Parent, ParentMessage, Resources> = Readonly<Record<string, { readonly [K in keyof Resources]: Resources[K] extends ManagedResource.Entry<any, any, infer Requirements, infer Value, infer Service, infer OnAcquired extends (...args: ReadonlyArray<any>) => any> ? ManagedResource.Entry<Parent, ParentMessage, Requirements, Value, Service, (...args: Parameters<OnAcquired>) => ParentMessage> : never; }[keyof Resources]>>;
|
|
56
|
+
type PlacedHelpers<Parent, ParentMessage, R, Helpers> = { readonly [K in keyof Helpers]: Helpers[K] extends ((model: any, ...input: infer Input) => any) ? (...input: Input) => Update.Step<Parent, ParentMessage, R> : never; };
|
|
57
|
+
interface Placed<Name extends string, Parent, ParentMessage, Model, Message, R, S, ViewInputs, Resources, Helpers, Field extends string = string, Claimed extends string = string> {
|
|
58
|
+
readonly [PlacedTypeId]: typeof PlacedTypeId;
|
|
59
|
+
/** Types only: the top-level Model field this placement owns, or `string` when unknown. */
|
|
60
|
+
readonly field?: Field;
|
|
61
|
+
/** Types only: the parent Message tag this placement routes, or `string` when unknown. */
|
|
62
|
+
readonly claims?: Claimed;
|
|
63
|
+
readonly name: Name;
|
|
64
|
+
/** `Name@path`, or the configured `key`: the prefix of every Subscription and resource key. */
|
|
65
|
+
readonly key: string;
|
|
66
|
+
/** The encoded args as text, when the bundle has an args Schema. */
|
|
67
|
+
readonly argsSummary: string | undefined;
|
|
68
|
+
/** Whether `args` was given as a seed factory; resolved once per initialization. */
|
|
69
|
+
readonly hasDynamicArgs: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Derives the factory's args from `seed`, validates them against the
|
|
72
|
+
* bundle's args Schema, and retains them for `init`, `update`, helpers,
|
|
73
|
+
* Subscriptions, and resources. A no-op for static args. The assembly calls
|
|
74
|
+
* this with the base seed before running inits, so every factory sees the
|
|
75
|
+
* same parent state whatever the placement order.
|
|
76
|
+
*/
|
|
77
|
+
readonly resolveArgs: (seed: unknown) => void;
|
|
78
|
+
/**
|
|
79
|
+
* Assembly use: marks the placement skipped because `rest` provides its
|
|
80
|
+
* top-level field, so its factory never runs and its records contribute
|
|
81
|
+
* nothing while the child is absent. Cleared by the next `resolveArgs`.
|
|
82
|
+
*/
|
|
83
|
+
readonly skipArgs: () => void;
|
|
84
|
+
readonly link: Link$1<Parent, ParentMessage, Model, Message>;
|
|
85
|
+
/** Writes the child's initial Model and starts its `init` Commands. */
|
|
86
|
+
readonly init: Update.Step<Parent, ParentMessage, R>;
|
|
87
|
+
/** Folds the Message when it belongs to this placement; `None` otherwise. */
|
|
88
|
+
readonly update: (parent: Parent, message: AnyMessage$1) => Option.Option<Update.Return<Parent, ParentMessage, R>>;
|
|
89
|
+
readonly subscriptions: Subscription.Subscriptions<Parent, ParentMessage, S>;
|
|
90
|
+
readonly resources: PlacedResources<Parent, ParentMessage, Resources>;
|
|
91
|
+
/**
|
|
92
|
+
* Renders the child through `h.submodel`; nothing while the child is absent.
|
|
93
|
+
* Generic over the parent's whole Message, which must include this placement's.
|
|
94
|
+
*/
|
|
95
|
+
readonly view: PlacedView<Parent, ParentMessage, ViewInputs>;
|
|
96
|
+
/**
|
|
97
|
+
* The same view in another slot, for rendering one placement in two DOM
|
|
98
|
+
* positions (desktop and mobile). `h.submodel` throws on a repeated slot.
|
|
99
|
+
*/
|
|
100
|
+
readonly viewIn: (slot: string) => PlacedView<Parent, ParentMessage, ViewInputs>;
|
|
101
|
+
readonly helpers: PlacedHelpers<Parent, ParentMessage, R, Helpers>;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* What a placement's view needs of a builder: `submodel`, and `OnClick` to
|
|
105
|
+
* read its Message from. A wrapper of Foldkit's builder that keeps both, such
|
|
106
|
+
* as `foldkit-ssr`'s resumable builder, is one.
|
|
107
|
+
*/
|
|
108
|
+
type BuilderLike = Pick<HtmlBuilder<any>, 'submodel' | 'OnClick'>;
|
|
109
|
+
type PlacedView<Parent, ParentMessage, ViewInputs> = [ViewInputs] extends [void] ? <H extends BuilderLike>(parent: Parent, h: ViewBuilder<H, ParentMessage>) => Html : <H extends BuilderLike>(parent: Parent, h: ViewBuilder<H, ParentMessage>, viewInputs: ViewInputs) => Html;
|
|
110
|
+
/** A readable type error: intersected onto a parameter, its message names the fix. */
|
|
111
|
+
interface Invalid<Message extends string> {
|
|
112
|
+
readonly invalid: Message;
|
|
113
|
+
}
|
|
114
|
+
type BuilderMessage<H> = H extends {
|
|
115
|
+
readonly OnClick: (message: infer M, ...rest: any) => any;
|
|
116
|
+
} ? M : never;
|
|
117
|
+
/**
|
|
118
|
+
* The parent's `h`, checked to accept this placement's Messages. Generic over the
|
|
119
|
+
* whole builder rather than its Message: inferring a Message through
|
|
120
|
+
* `HtmlBuilder` costs thousands of type instantiations per call, while the
|
|
121
|
+
* builder infers as itself and its Message is extracted once per builder type.
|
|
122
|
+
*/
|
|
123
|
+
type ViewBuilder<H, ParentMessage> = H & ([ParentMessage] extends [BuilderMessage<H>] ? unknown : Invalid<"The parent Message does not include this placement's wrapper variant; spread its Link.wrapper(...).cases into defineMessageUnion">);
|
|
124
|
+
/** The tag of a Link's parent variant, or `string` when it cannot be read. */
|
|
125
|
+
type TagOf<LinkMessage> = LinkMessage extends {
|
|
126
|
+
readonly _tag: infer Tag extends string;
|
|
127
|
+
} ? Tag : string;
|
|
128
|
+
//#endregion
|
|
11
129
|
//#region ../bundle/src/link.d.ts
|
|
12
130
|
declare const LinkTypeId: unique symbol;
|
|
13
131
|
/** The parent Message variant `Tag({ message })` that carries a child's Messages. */
|
|
@@ -36,8 +154,14 @@ interface Wrapper$1<Tag extends string, ChildMessage> {
|
|
|
36
154
|
type AnyMessage$1 = {
|
|
37
155
|
readonly _tag: string;
|
|
38
156
|
};
|
|
39
|
-
|
|
157
|
+
/**
|
|
158
|
+
* `Field` is the parent's top-level field the child is written into, when the
|
|
159
|
+
* Link is one: `never` for a child nested deeper, and `string` when unknown.
|
|
160
|
+
*/
|
|
161
|
+
interface Link$1<Parent, ParentMessage, Child, ChildMessage, Field extends string = string> extends Pipeable.Pipeable {
|
|
40
162
|
readonly [LinkTypeId]: typeof LinkTypeId;
|
|
163
|
+
/** Types only: the top-level field, so `placements.initial` knows who writes it. */
|
|
164
|
+
readonly field?: Field;
|
|
41
165
|
readonly read: (parent: Parent) => Option.Option<Child>;
|
|
42
166
|
readonly write: (parent: Parent, child: Child) => Parent;
|
|
43
167
|
readonly toParentMessage: (message: ChildMessage) => ParentMessage;
|
|
@@ -52,14 +176,35 @@ interface Link$1<Parent, ParentMessage, Child, ChildMessage> extends Pipeable.Pi
|
|
|
52
176
|
/** The application a Link built from a Surface field ref belongs to, for its Module contract. */
|
|
53
177
|
readonly owner?: object | undefined;
|
|
54
178
|
}
|
|
55
|
-
|
|
179
|
+
/** A Message union's variant `Tag({ message })`, as `defineMessageUnion` declares it. */
|
|
180
|
+
type Variant = {
|
|
181
|
+
readonly fields: {
|
|
182
|
+
readonly _tag: Schema.tag<string>;
|
|
183
|
+
readonly message: Schema.Top;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
type VariantTag<V extends Variant> = V['fields']['_tag'] extends Schema.tag<infer Tag extends string> ? Tag : never;
|
|
187
|
+
type OnlyMessage<V extends Variant> = [Exclude<keyof V['fields'], '_tag' | 'message'>] extends [never] ? unknown : Invalid<'A wrapper variant carries only `message`; this variant has other fields'>;
|
|
188
|
+
/**
|
|
189
|
+
* The parent variant `Tag({ message })` for a child's Messages: from a tag and
|
|
190
|
+
* the child's Message Schema, whose `cases` then go into the parent's union, or
|
|
191
|
+
* from a variant the parent's union already declares.
|
|
192
|
+
*/
|
|
193
|
+
declare function wrapper<const Tag extends string, ChildMessage>(tag: Tag, childMessage: Schema.Codec<ChildMessage, unknown>): Wrapper$1<Tag, ChildMessage>;
|
|
194
|
+
declare function wrapper<V extends Variant>(variant: V & OnlyMessage<V>): Wrapper$1<VariantTag<V>, V['fields']['message']['Type']>;
|
|
195
|
+
interface MakeConfig<Parent, Tag extends string, Child, ChildMessage, Path> {
|
|
56
196
|
readonly read: (parent: Parent) => Option.Option<Child>;
|
|
57
197
|
readonly write: (parent: Parent, child: Child) => Parent;
|
|
58
198
|
readonly wrapper: Wrapper$1<Tag, ChildMessage>;
|
|
59
199
|
readonly when?: (parent: Parent) => boolean;
|
|
60
|
-
readonly path:
|
|
200
|
+
readonly path: Path;
|
|
61
201
|
readonly owner?: object | undefined;
|
|
62
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* The top-level field a path names. `initial` treats a one-segment path as the
|
|
205
|
+
* field the placement writes, so a longer one names none.
|
|
206
|
+
*/
|
|
207
|
+
type FieldOfPath<Path> = Path extends readonly [infer Field extends string] ? Field : Path extends readonly [string, ...ReadonlyArray<string>] ? never : string;
|
|
63
208
|
type OptionKeys<Parent> = { [K in keyof Parent]: Parent[K] extends Option.Option<unknown> ? K : never; }[keyof Parent] & string;
|
|
64
209
|
type OptionValue<A> = A extends Option.Option<infer Value> ? Value : never;
|
|
65
210
|
/** The parent Message variant `Tag({ key, message })` that carries one collection item's Messages. */
|
|
@@ -85,7 +230,9 @@ interface KeyedWrapper<Tag extends string, ChildMessage, Key extends string = st
|
|
|
85
230
|
* business: a record by key, an array identified by id, or anything with these
|
|
86
231
|
* operations. `entries` is the order views and Subscriptions follow.
|
|
87
232
|
*/
|
|
88
|
-
interface CollectionLink<Parent, ParentMessage, Child, ChildMessage, Key extends string = string> {
|
|
233
|
+
interface CollectionLink<Parent, ParentMessage, Child, ChildMessage, Key extends string = string, Field extends string = string> {
|
|
234
|
+
/** Types only: the top-level field holding the items, or `string` when unknown. */
|
|
235
|
+
readonly field?: Field;
|
|
89
236
|
/** The storage with no items, for a parent's initial Model. */
|
|
90
237
|
readonly empty: unknown;
|
|
91
238
|
readonly entries: (parent: Parent) => ReadonlyArray<readonly [key: Key, child: Child]>;
|
|
@@ -105,111 +252,75 @@ type RecordValue<A> = A extends Readonly<Record<string, infer Value>> ? Value :
|
|
|
105
252
|
type ArrayKeys<Parent> = { [K in keyof Parent]: Parent[K] extends ReadonlyArray<unknown> ? K : never; }[keyof Parent] & string;
|
|
106
253
|
type ArrayItem<A> = A extends ReadonlyArray<infer Item> ? Item : never;
|
|
107
254
|
declare const Link$1: {
|
|
108
|
-
readonly wrapper:
|
|
109
|
-
readonly make: <Parent, const Tag extends string, Child, ChildMessage>(config: MakeConfig<Parent, Tag, Child, ChildMessage>) => Link$1<Parent, Wrapped<Tag, ChildMessage>, Child, ChildMessage
|
|
255
|
+
readonly wrapper: typeof wrapper;
|
|
256
|
+
readonly make: <Parent, const Tag extends string, Child, ChildMessage, const Path extends ReadonlyArray<string> = readonly string[]>(config: MakeConfig<Parent, Tag, Child, ChildMessage, Path>) => Link$1<Parent, Wrapped<Tag, ChildMessage>, Child, ChildMessage, FieldOfPath<Path>>;
|
|
110
257
|
readonly field: <Parent>() => <const Key extends keyof Parent & string, const Tag extends string, ChildMessage>(key: Key, wrap: Wrapper$1<Tag, ChildMessage>, options?: {
|
|
111
258
|
readonly when?: (parent: Parent) => boolean;
|
|
112
|
-
}) => Link$1<Parent, Wrapped<Tag, ChildMessage>, Parent[Key], ChildMessage>;
|
|
259
|
+
}) => Link$1<Parent, Wrapped<Tag, ChildMessage>, Parent[Key], ChildMessage, Key>;
|
|
113
260
|
readonly optional: <Parent>() => <const Key extends OptionKeys<Parent>, const Tag extends string, ChildMessage>(key: Key, wrap: Wrapper$1<Tag, ChildMessage>, options?: {
|
|
114
261
|
readonly when?: (parent: Parent) => boolean;
|
|
115
|
-
}) => Link$1<Parent, Wrapped<Tag, ChildMessage>, OptionValue<Parent[Key]>, ChildMessage>;
|
|
116
|
-
readonly compose: <A, AMessage, B, BMessage extends AnyMessage$1, C, CMessage>(outer: Link$1<A, AMessage, B, BMessage>, inner: Link$1<B, BMessage, C, CMessage>) => Link$1<A, AMessage, C, CMessage>;
|
|
262
|
+
}) => Link$1<Parent, Wrapped<Tag, ChildMessage>, OptionValue<Parent[Key]>, ChildMessage, Key>;
|
|
263
|
+
readonly compose: <A, AMessage, B, BMessage extends AnyMessage$1, C, CMessage>(outer: Link$1<A, AMessage, B, BMessage, string>, inner: Link$1<B, BMessage, C, CMessage, string>) => Link$1<A, AMessage, C, CMessage, never>;
|
|
117
264
|
readonly andThen: {
|
|
118
|
-
<B, BMessage extends AnyMessage$1, C, CMessage>(inner: Link$1<B, BMessage, C, CMessage>): <A, AMessage>(outer: Link$1<A, AMessage, B, BMessage>) => Link$1<A, AMessage, C, CMessage>;
|
|
119
|
-
<A, AMessage, B, BMessage extends AnyMessage$1, C, CMessage>(outer: Link$1<A, AMessage, B, BMessage>, inner: Link$1<B, BMessage, C, CMessage>): Link$1<A, AMessage, C, CMessage>;
|
|
265
|
+
<B, BMessage extends AnyMessage$1, C, CMessage>(inner: Link$1<B, BMessage, C, CMessage, string>): <A, AMessage>(outer: Link$1<A, AMessage, B, BMessage, string>) => Link$1<A, AMessage, C, CMessage, never>;
|
|
266
|
+
<A, AMessage, B, BMessage extends AnyMessage$1, C, CMessage>(outer: Link$1<A, AMessage, B, BMessage, string>, inner: Link$1<B, BMessage, C, CMessage, string>): Link$1<A, AMessage, C, CMessage, never>;
|
|
120
267
|
};
|
|
121
268
|
readonly when: {
|
|
122
|
-
<Parent>(predicate: (parent: Parent) => boolean): <ParentMessage, Child, ChildMessage>(self: Link$1<Parent, ParentMessage, Child, ChildMessage>) => Link$1<Parent, ParentMessage, Child, ChildMessage>;
|
|
123
|
-
<Parent, ParentMessage, Child, ChildMessage>(self: Link$1<Parent, ParentMessage, Child, ChildMessage>, predicate: (parent: Parent) => boolean): Link$1<Parent, ParentMessage, Child, ChildMessage>;
|
|
269
|
+
<Parent>(predicate: (parent: Parent) => boolean): <ParentMessage, Child, ChildMessage, Field extends string>(self: Link$1<Parent, ParentMessage, Child, ChildMessage, Field>) => Link$1<Parent, ParentMessage, Child, ChildMessage, Field>;
|
|
270
|
+
<Parent, ParentMessage, Child, ChildMessage, Field extends string>(self: Link$1<Parent, ParentMessage, Child, ChildMessage, Field>, predicate: (parent: Parent) => boolean): Link$1<Parent, ParentMessage, Child, ChildMessage, Field>;
|
|
271
|
+
};
|
|
272
|
+
readonly foldInit: <Parent, ParentMessage, Child, ChildMessage, Field extends string>(link: Link$1<Parent, ParentMessage, Child, ChildMessage, Field>, rest: Omit<Parent, Field>) => {
|
|
273
|
+
readonly toParentModel: (child: Child) => Parent;
|
|
274
|
+
readonly toParentMessage: (message: ChildMessage) => ParentMessage;
|
|
124
275
|
};
|
|
125
276
|
readonly keyedWrapper: <const Tag extends string, ChildMessage, Key extends string = string>(tag: Tag, childMessage: Schema.Codec<ChildMessage, unknown>, key?: Schema.Codec<Key, string>) => KeyedWrapper<Tag, ChildMessage, Key>;
|
|
126
277
|
readonly collection: <Parent>() => <const Field extends RecordKeys<Parent>, const Tag extends string, ChildMessage, Key extends string>(field: Field, wrap: KeyedWrapper<Tag, ChildMessage, Key>, options?: {
|
|
127
278
|
readonly when?: (parent: Parent, key: Key) => boolean;
|
|
128
|
-
}) => CollectionLink<Parent, KeyedWrapped<Tag, ChildMessage, Key>, RecordValue<Parent[Field]>, ChildMessage, Key>;
|
|
279
|
+
}) => CollectionLink<Parent, KeyedWrapped<Tag, ChildMessage, Key>, RecordValue<Parent[Field]>, ChildMessage, Key, Field>;
|
|
129
280
|
readonly collectionById: <Parent>() => <const Field extends ArrayKeys<Parent>, const Tag extends string, ChildMessage, Key extends string>(field: Field, wrap: KeyedWrapper<Tag, ChildMessage, Key>, options: {
|
|
130
281
|
readonly id: (item: ArrayItem<Parent[Field]>) => Key;
|
|
131
282
|
readonly when?: (parent: Parent, key: Key) => boolean;
|
|
132
|
-
}) => CollectionLink<Parent, KeyedWrapped<Tag, ChildMessage, Key>, ArrayItem<Parent[Field]>, ChildMessage, Key>;
|
|
283
|
+
}) => CollectionLink<Parent, KeyedWrapped<Tag, ChildMessage, Key>, ArrayItem<Parent[Field]>, ChildMessage, Key, Field>;
|
|
133
284
|
};
|
|
134
285
|
//#endregion
|
|
135
|
-
//#region ../bundle/src/placed.d.ts
|
|
136
|
-
declare const PlacedTypeId: unique symbol;
|
|
137
|
-
interface PlaceConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2> {
|
|
138
|
-
readonly args?: Args;
|
|
139
|
-
/** Handles the child's OutMessage in parent terms, with the child already written back. */
|
|
140
|
-
readonly onOut?: (outMessage: OutMessage, context: Update.FoldContext<Message, LinkMessage>) => Update.Step<NoInfer<Parent>, OutStepMessage, R2>;
|
|
141
|
-
/** Prefix for the placement's Subscription and resource keys. Defaults to `Name@path`. */
|
|
142
|
-
readonly key?: string;
|
|
143
|
-
/** A gate beside the Link's own: Subscriptions and resources run only while both hold. */
|
|
144
|
-
readonly when?: (parent: Parent) => boolean;
|
|
145
|
-
}
|
|
146
|
-
/** A lifted resource record: each child entry in parent terms, keyed by the placement. */
|
|
147
|
-
type PlacedResources<Parent, ParentMessage, Resources> = Readonly<Record<string, { readonly [K in keyof Resources]: Resources[K] extends ManagedResource.Entry<any, any, infer Requirements, infer Value, infer Service, any> ? ManagedResource.Entry<Parent, ParentMessage, Requirements, Value, Service> : never; }[keyof Resources]>>;
|
|
148
|
-
type PlacedHelpers<Parent, ParentMessage, R, Helpers> = { readonly [K in keyof Helpers]: Helpers[K] extends ((model: any, ...input: infer Input) => any) ? (...input: Input) => Update.Step<Parent, ParentMessage, R> : never; };
|
|
149
|
-
interface Placed<Name extends string, Parent, ParentMessage, Model, Message, R, S, ViewInputs, Resources, Helpers, Field extends string = string> {
|
|
150
|
-
readonly [PlacedTypeId]: typeof PlacedTypeId;
|
|
151
|
-
/** Types only: the top-level Model field this placement owns, or `string` when unknown. */
|
|
152
|
-
readonly field?: Field;
|
|
153
|
-
readonly name: Name;
|
|
154
|
-
/** `Name@path`, or the configured `key`: the prefix of every Subscription and resource key. */
|
|
155
|
-
readonly key: string;
|
|
156
|
-
/** The encoded args as text, when the bundle has an args Schema. */
|
|
157
|
-
readonly argsSummary: string | undefined;
|
|
158
|
-
readonly link: Link$1<Parent, ParentMessage, Model, Message>;
|
|
159
|
-
/** Writes the child's initial Model and starts its `init` Commands. */
|
|
160
|
-
readonly init: Update.Step<Parent, ParentMessage, R>;
|
|
161
|
-
/** Folds the Message when it belongs to this placement; `None` otherwise. */
|
|
162
|
-
readonly update: (parent: Parent, message: AnyMessage$1) => Option.Option<Update.Return<Parent, ParentMessage, R>>;
|
|
163
|
-
readonly subscriptions: Subscription.Subscriptions<Parent, ParentMessage, S>;
|
|
164
|
-
readonly resources: PlacedResources<Parent, ParentMessage, Resources>;
|
|
165
|
-
/**
|
|
166
|
-
* Renders the child through `h.submodel`; nothing while the child is absent.
|
|
167
|
-
* Generic over the parent's whole Message, which must include this placement's.
|
|
168
|
-
*/
|
|
169
|
-
readonly view: PlacedView<Parent, ParentMessage, ViewInputs>;
|
|
170
|
-
/**
|
|
171
|
-
* The same view in another slot, for rendering one placement in two DOM
|
|
172
|
-
* positions (desktop and mobile). `h.submodel` throws on a repeated slot.
|
|
173
|
-
*/
|
|
174
|
-
readonly viewIn: (slot: string) => PlacedView<Parent, ParentMessage, ViewInputs>;
|
|
175
|
-
readonly helpers: PlacedHelpers<Parent, ParentMessage, R, Helpers>;
|
|
176
|
-
}
|
|
177
|
-
type PlacedView<Parent, ParentMessage, ViewInputs> = [ViewInputs] extends [void] ? <H extends HtmlBuilder<any>>(parent: Parent, h: ViewBuilder<H, ParentMessage>) => Html : <H extends HtmlBuilder<any>>(parent: Parent, h: ViewBuilder<H, ParentMessage>, viewInputs: ViewInputs) => Html;
|
|
178
|
-
/** A readable type error: intersected onto a parameter, its message names the fix. */
|
|
179
|
-
interface Invalid<Message extends string> {
|
|
180
|
-
readonly invalid: Message;
|
|
181
|
-
}
|
|
182
|
-
type BuilderMessage<H> = H extends HtmlBuilder<infer M> ? M : never;
|
|
183
|
-
/**
|
|
184
|
-
* The parent's `h`, checked to accept this placement's Messages. Generic over the
|
|
185
|
-
* whole builder rather than its Message: inferring a Message through
|
|
186
|
-
* `HtmlBuilder` costs thousands of type instantiations per call, while the
|
|
187
|
-
* builder infers as itself and its Message is extracted once per builder type.
|
|
188
|
-
*/
|
|
189
|
-
type ViewBuilder<H, ParentMessage> = H & ([ParentMessage] extends [BuilderMessage<H>] ? unknown : Invalid<"The parent Message does not include this placement's wrapper variant; spread its Link.wrapper(...).cases into defineMessageUnion">);
|
|
190
|
-
//#endregion
|
|
191
286
|
//#region ../bundle/src/collection.d.ts
|
|
192
287
|
declare const PlacedCollectionTypeId: unique symbol;
|
|
193
|
-
interface EachConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key extends string = string> {
|
|
194
|
-
/**
|
|
195
|
-
|
|
288
|
+
interface EachConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key extends string = string, ParentSeed = Parent> {
|
|
289
|
+
/**
|
|
290
|
+
* The args every item's `init` and `update` receive: a static value, or a
|
|
291
|
+
* factory from the parent seed, computed once per initialization and
|
|
292
|
+
* retained. Adding items requires `initial`/`config` to have run; `update`
|
|
293
|
+
* on a Model no initialization produced derives per use instead.
|
|
294
|
+
*/
|
|
295
|
+
readonly args?: ArgsSource<ParentSeed, Args>;
|
|
196
296
|
/** Handles an item's OutMessage in parent terms, with the item already written back. */
|
|
197
297
|
readonly onOut?: (outMessage: OutMessage, key: Key, context: Update.FoldContext<Message, LinkMessage>) => Update.Step<NoInfer<Parent>, OutStepMessage, R2>;
|
|
298
|
+
/** Observes each item's Messages in parent terms, after the item has handled it and its `onOut` has run. */
|
|
299
|
+
readonly onMessage?: (message: Message, key: Key) => Update.Step<NoInfer<Parent>, OutStepMessage, R2>;
|
|
198
300
|
/** Prefix for the collection's Subscription keys. Defaults to `Name@path[]`. */
|
|
199
301
|
readonly key?: string;
|
|
200
302
|
readonly when?: (parent: Parent, key: Key) => boolean;
|
|
201
303
|
}
|
|
202
|
-
type CollectionView<Parent, ParentMessage, ViewInputs, Key extends string = string> = [ViewInputs] extends [void] ? <H extends
|
|
304
|
+
type CollectionView<Parent, ParentMessage, ViewInputs, Key extends string = string> = [ViewInputs] extends [void] ? <H extends BuilderLike>(parent: Parent, h: ViewBuilder<H, ParentMessage>, key: Key) => Html : <H extends BuilderLike>(parent: Parent, h: ViewBuilder<H, ParentMessage>, key: Key, viewInputs: ViewInputs) => Html;
|
|
203
305
|
type CollectionHelpers<Parent, ParentMessage, R, Helpers, Key extends string = string> = { readonly [K in keyof Helpers]: Helpers[K] extends ((model: any, ...input: infer Input) => any) ? (key: Key, ...input: Input) => Update.Step<Parent, ParentMessage, R> : never; };
|
|
204
|
-
interface PlacedCollection<Name extends string, Parent, ParentMessage, Model, Message, R, S, ViewInputs, Helpers, Field extends string = string, Key extends string = string> {
|
|
306
|
+
interface PlacedCollection<Name extends string, Parent, ParentMessage, Model, Message, R, S, ViewInputs, Helpers, Field extends string = string, Key extends string = string, Claimed extends string = string> {
|
|
205
307
|
readonly [PlacedCollectionTypeId]: typeof PlacedCollectionTypeId;
|
|
206
308
|
/** Types only: the record field this collection owns, or `string` when unknown. */
|
|
207
309
|
readonly field?: Field;
|
|
310
|
+
/** Types only: the parent Message tag this collection routes, or `string` when unknown. */
|
|
311
|
+
readonly claims?: Claimed;
|
|
208
312
|
readonly name: Name;
|
|
209
313
|
/** `Name@path[]`, or the configured `key`: the prefix of every Subscription key. */
|
|
210
314
|
readonly key: string;
|
|
211
315
|
/** The encoded args as text, when the bundle has an args Schema. */
|
|
212
316
|
readonly argsSummary: string | undefined;
|
|
317
|
+
/** Whether `args` was given as a seed factory; resolved once per initialization. */
|
|
318
|
+
readonly hasDynamicArgs: boolean;
|
|
319
|
+
/**
|
|
320
|
+
* Derives the factory's args from `seed` and retains them for `add`,
|
|
321
|
+
* `update`, and Subscriptions. A no-op for static args.
|
|
322
|
+
*/
|
|
323
|
+
readonly resolveArgs: (seed: unknown) => void;
|
|
213
324
|
readonly link: CollectionLink<Parent, ParentMessage, Model, Message, Key>;
|
|
214
325
|
/** Folds the Message into its item; `None` when it is not this collection's. A missing key leaves the parent unchanged. */
|
|
215
326
|
readonly update: (parent: Parent, message: AnyMessage$1) => Option.Option<Update.Return<Parent, ParentMessage, R>>;
|
|
@@ -225,7 +336,7 @@ interface PlacedCollection<Name extends string, Parent, ParentMessage, Model, Me
|
|
|
225
336
|
/** One item's view; nothing when the key is missing. */
|
|
226
337
|
readonly view: CollectionView<Parent, ParentMessage, ViewInputs, Key>;
|
|
227
338
|
/** Every item's view, in the order of the Link's `entries`. */
|
|
228
|
-
readonly viewAll: <H extends
|
|
339
|
+
readonly viewAll: <H extends BuilderLike>(parent: Parent, h: ViewBuilder<H, ParentMessage>, ...viewInputs: [ViewInputs] extends [void] ? [] : [viewInputs: ViewInputs]) => ReadonlyArray<Html>;
|
|
229
340
|
readonly helpers: CollectionHelpers<Parent, ParentMessage, R, Helpers, Key>;
|
|
230
341
|
}
|
|
231
342
|
//#endregion
|
|
@@ -245,6 +356,11 @@ type BundleParts<B> = B extends Bundle$1<infer Name, infer Args, infer Model, in
|
|
|
245
356
|
} : never;
|
|
246
357
|
//#endregion
|
|
247
358
|
//#region ../bundle/src/bundle.d.ts
|
|
359
|
+
/**
|
|
360
|
+
* The parent seed a factory observes: the parent without the placement's own
|
|
361
|
+
* field, or the whole parent where the field is unknown (`string`).
|
|
362
|
+
*/
|
|
363
|
+
type SeedFor<Parent, Field extends string> = string extends Field ? Parent : Omit<Parent, Field>;
|
|
248
364
|
declare const BundleTypeId: unique symbol;
|
|
249
365
|
/** A child Managed Resource entry: its requirements are an `Option`, so the entry can release. */
|
|
250
366
|
type ResourceEntry<Model, Message> = ManagedResource.Entry<Model, Message, Option.Option<any>, any, any>;
|
|
@@ -278,49 +394,60 @@ interface Bundle$1<Name extends string, Args, Model, Message extends AnyMessage$
|
|
|
278
394
|
*/
|
|
279
395
|
readonly with: (args: Args) => Bundle$1<Name, void, Model, Message, OutMessage, R, S, ViewInputs, Resources, Helpers>;
|
|
280
396
|
/** Places the bundle where `link` points. */
|
|
281
|
-
readonly at: <Parent, LinkMessage, OutStepMessage = never, R2 = never>(link: Link$1<Parent, LinkMessage, Model, Message>, ...config: PlaceConfigParam<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2
|
|
397
|
+
readonly at: <Parent, LinkMessage, Field extends string, OutStepMessage = never, R2 = never>(link: Link$1<Parent, LinkMessage, Model, Message, Field>, ...config: PlaceConfigParam<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, SeedFor<Parent, Field>>) => Placed<Name, Parent, LinkMessage | OutStepMessage, Model, Message, R | R2, S, ViewInputs, Resources, Helpers, Field, TagOf<LinkMessage>>;
|
|
282
398
|
/** Places the bundle once per key of the collection `link` points at. */
|
|
283
|
-
readonly each: [keyof Resources] extends [never] ? <Parent, LinkMessage, Key extends string, OutStepMessage = never, R2 = never>(link: CollectionLink<Parent, LinkMessage, Model, Message, Key>, ...config: EachConfigParam<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key
|
|
399
|
+
readonly each: [keyof Resources] extends [never] ? <Parent, LinkMessage, Key extends string, Field extends string, OutStepMessage = never, R2 = never>(link: CollectionLink<Parent, LinkMessage, Model, Message, Key, Field>, ...config: EachConfigParam<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key, SeedFor<Parent, Field>>) => PlacedCollection<Name, Parent, LinkMessage | OutStepMessage, Model, Message, R | R2, S, ViewInputs, Helpers, Field, Key, TagOf<LinkMessage>> : Invalid<'Bundle.each does not support Managed Resources yet: the runtime provides a resource by one tag, so items would share it'>;
|
|
284
400
|
}
|
|
285
401
|
/**
|
|
286
402
|
* What placing needs: `args` when `init` takes them, and `onOut` when the
|
|
287
403
|
* bundle has an OutMessage, so an OutMessage is never dropped by omission.
|
|
404
|
+
* `args` is a static value or a factory from the parent seed (the parent
|
|
405
|
+
* without this placement's own field); the seed type defaults to the whole
|
|
406
|
+
* parent where the field is unknown.
|
|
288
407
|
*/
|
|
289
|
-
type PlacementConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2> = {
|
|
408
|
+
type PlacementConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, ParentSeed = Parent> = {
|
|
290
409
|
/** Prefix for the placement's Subscription and resource keys. Defaults to `Name@path`. */
|
|
291
410
|
readonly key?: string;
|
|
292
411
|
/** A gate beside the Link's own: the child's Subscriptions and resources run only while both hold. */
|
|
293
412
|
readonly when?: (parent: Parent) => boolean;
|
|
413
|
+
/** Observes each of the child's Messages in parent terms, after the child handled it. */
|
|
414
|
+
readonly onMessage?: Required<PlaceConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, ParentSeed>>['onMessage'];
|
|
294
415
|
} & ([Args] extends [void] ? {
|
|
295
416
|
readonly args?: never;
|
|
296
417
|
} : {
|
|
297
|
-
readonly args: Args
|
|
418
|
+
readonly args: ArgsSource<ParentSeed, Args>;
|
|
298
419
|
}) & ([OutMessage] extends [never] ? {
|
|
299
420
|
readonly onOut?: never;
|
|
300
421
|
} : {
|
|
301
|
-
readonly onOut: Required<PlaceConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2>>['onOut'];
|
|
422
|
+
readonly onOut: Required<PlaceConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, ParentSeed>>['onOut'];
|
|
302
423
|
});
|
|
303
424
|
/** The config argument is optional only when it would be empty. */
|
|
304
|
-
type PlaceConfigParam<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2> = [Args] extends [void] ? [OutMessage] extends [never] ? [config?: PlacementConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2>] : [config: PlacementConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2>] : [config: PlacementConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2>];
|
|
305
|
-
type EachOptions<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key extends string = string> = {
|
|
425
|
+
type PlaceConfigParam<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, ParentSeed = Parent> = [Args] extends [void] ? [OutMessage] extends [never] ? [config?: PlacementConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, ParentSeed>] : [config: PlacementConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, ParentSeed>] : [config: PlacementConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, ParentSeed>];
|
|
426
|
+
type EachOptions<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key extends string = string, ParentSeed = Parent> = {
|
|
306
427
|
readonly key?: string;
|
|
307
428
|
/** A gate per item beside the Link's own: an item's Subscriptions run only while both hold. */
|
|
308
429
|
readonly when?: (parent: Parent, key: Key) => boolean;
|
|
430
|
+
/** Observes each item's Messages in parent terms, after the item handled it. */
|
|
431
|
+
readonly onMessage?: Required<EachConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key, ParentSeed>>['onMessage'];
|
|
309
432
|
} & ([Args] extends [void] ? {
|
|
310
433
|
readonly args?: never;
|
|
311
434
|
} : {
|
|
312
|
-
readonly args: Args
|
|
435
|
+
readonly args: ArgsSource<ParentSeed, Args>;
|
|
313
436
|
}) & ([OutMessage] extends [never] ? {
|
|
314
437
|
readonly onOut?: never;
|
|
315
438
|
} : {
|
|
316
|
-
readonly onOut: Required<EachConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key>>['onOut'];
|
|
439
|
+
readonly onOut: Required<EachConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key, ParentSeed>>['onOut'];
|
|
317
440
|
});
|
|
318
|
-
type EachConfigParam<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key extends string = string> = [Args] extends [void] ? [OutMessage] extends [never] ? [config?: EachOptions<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key>] : [config: EachOptions<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key>] : [config: EachOptions<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key>];
|
|
441
|
+
type EachConfigParam<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key extends string = string, ParentSeed = Parent> = [Args] extends [void] ? [OutMessage] extends [never] ? [config?: EachOptions<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key, ParentSeed>] : [config: EachOptions<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key, ParentSeed>] : [config: EachOptions<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key, ParentSeed>];
|
|
442
|
+
/** Any bundle, for APIs that accept one without caring about its types. */
|
|
443
|
+
type AnyBundle = Bundle$1<string, any, any, any, any, any, any, any, any, any>;
|
|
319
444
|
//#endregion
|
|
320
445
|
//#region ../bundle/src/parent.d.ts
|
|
321
446
|
type P<B> = BundleParts<B>;
|
|
322
447
|
/** Collections cannot place a bundle with Managed Resources; reported at the bundle. */
|
|
323
448
|
type WithoutResources<B> = [keyof P<B>['Resources']] extends [never] ? unknown : Invalid<'A collection cannot place a bundle with Managed Resources: the runtime provides a resource by one tag, so every item would share it'>;
|
|
449
|
+
type PlacedBy<B extends AnyBundle, Model, LinkMessage, OutStepMessage, R2, Field extends string> = Placed<P<B>['Name'], Model, LinkMessage | OutStepMessage, P<B>['Model'], P<B>['Message'], P<B>['R'] | R2, P<B>['S'], P<B>['ViewInputs'], P<B>['Resources'], P<B>['Helpers'], Field, TagOf<LinkMessage>>;
|
|
450
|
+
type CollectionBy<B extends AnyBundle, Model, LinkMessage, OutStepMessage, R2, Field extends string> = PlacedCollection<P<B>['Name'], Model, LinkMessage | OutStepMessage, P<B>['Model'], P<B>['Message'], P<B>['R'] | R2, P<B>['S'], P<B>['ViewInputs'], P<B>['Helpers'], Field, string, TagOf<LinkMessage>>;
|
|
324
451
|
//#endregion
|
|
325
452
|
//#region src/index.d.ts
|
|
326
453
|
type AnyPlacement = AnyPlaced | AnyPlacedCollection;
|
|
@@ -331,7 +458,7 @@ type AssemblyItems = {
|
|
|
331
458
|
export declare const BundleSurface: {
|
|
332
459
|
readonly link: <Root, Value, const Tag extends string, ChildMessage>(ref: FieldRef<Root, Value>, wrapper: Wrapper<Tag, ChildMessage>, options?: {
|
|
333
460
|
readonly when?: (parent: Root) => boolean;
|
|
334
|
-
}) => Link<Root, import("foldkit-bundle").Wrapped<Tag, ChildMessage>, Value, ChildMessage>;
|
|
461
|
+
}) => Link<Root, import("foldkit-bundle").Wrapped<Tag, ChildMessage>, Value, ChildMessage, string>;
|
|
335
462
|
readonly contract: <Root, F extends Schema.Struct.Fields, Cases extends Record<string, Schema.Struct.Fields>>(app: AppScope<Root, F, Cases>, placement: AnyPlacement) => Contract;
|
|
336
463
|
readonly module: <Root, F extends Schema.Struct.Fields, Cases extends Record<string, Schema.Struct.Fields>>(app: AppScope<Root, F, Cases>, assembly: AssemblyItems, items?: readonly ModuleItem<Root>[]) => Module<Root, F, Cases>;
|
|
337
464
|
readonly parent: <Root, F extends Schema.Struct.Fields, Cases extends Record<string, Schema.Struct.Fields>>(app: AppScope<Root, F, Cases>) => {
|
|
@@ -340,25 +467,25 @@ export declare const BundleSurface: {
|
|
|
340
467
|
Model: Schema.Codec<Root, unknown, never, never>;
|
|
341
468
|
Message: Schema.Codec<Schema.Schema.Type<import("foldkit/message").MessageUnion<Cases>> & AnyMessage, unknown, never, never>;
|
|
342
469
|
withServices: <S>() => Bundle.Parent<Root, Schema.Schema.Type<import("foldkit/message").MessageUnion<Cases>> & AnyMessage, S>;
|
|
343
|
-
at: <B extends Bundle.AnyBundle, const Field extends { [K in keyof Root]: [Root[K]] extends [Bundle.BundleParts<B>["Model"]] ? [Bundle.BundleParts<B>["Model"]] extends [Root[K]] ? K : never : never; }[keyof Root] & string, OutStepMessage = never, R2 = never>(declared: Bundle.Declared<B, Field>, ...config: Bundle.PlaceConfigParam<Bundle.BundleParts<B>["Args"], Root, import("foldkit-bundle").Wrapped<`Got${Capitalize<Field>}Message`, Bundle.BundleParts<B>["Message"]>, Bundle.BundleParts<B>["Message"], Bundle.BundleParts<B>["OutMessage"], OutStepMessage, R2
|
|
344
|
-
place: <B extends Bundle.AnyBundle, const Field_1 extends { [K in keyof Root]: [Root[K]] extends [Bundle.BundleParts<B>["Model"]] ? [Bundle.BundleParts<B>["Model"]] extends [Root[K]] ? K : never : never; }[keyof Root] & string, OutStepMessage_1 = never, R2_1 = never>(bundle: B, field: Field_1, ...config: Bundle.PlaceConfigParam<Bundle.BundleParts<B>["Args"], Root, import("foldkit-bundle").Wrapped<`Got${Capitalize<Field_1>}Message`, Bundle.BundleParts<B>["Message"]>, Bundle.BundleParts<B>["Message"], Bundle.BundleParts<B>["OutMessage"], OutStepMessage_1, R2_1
|
|
345
|
-
each: <B extends Bundle.AnyBundle, const Field_2 extends { [K in keyof Root]: Root[K] extends Readonly<Record<string, infer V>> ? [V] extends [Bundle.BundleParts<B>["Model"]] ? [Bundle.BundleParts<B>["Model"]] extends [V] ? K : never : never : never; }[keyof Root] & string, OutStepMessage_2 = never, R2_2 = never>(declared: Bundle.DeclaredEach<B, Field_2>, ...config: Bundle.EachConfigParam<Bundle.BundleParts<B>["Args"], Root, import("foldkit-bundle").KeyedWrapped<`Got${Capitalize<Field_2>}Message`, Bundle.BundleParts<B>["Message"]>, Bundle.BundleParts<B>["Message"], Bundle.BundleParts<B>["OutMessage"], OutStepMessage_2, R2_2, string
|
|
346
|
-
placeEach: <B extends Bundle.AnyBundle, const Field_3 extends { [K in keyof Root]: Root[K] extends Readonly<Record<string, infer V>> ? [V] extends [Bundle.BundleParts<B>["Model"]] ? [Bundle.BundleParts<B>["Model"]] extends [V] ? K : never : never : never; }[keyof Root] & string, OutStepMessage_3 = never, R2_3 = never>(bundle: B & WithoutResources<B>, field: Field_3, ...config: Bundle.EachConfigParam<Bundle.BundleParts<B>["Args"], Root, import("foldkit-bundle").KeyedWrapped<`Got${Capitalize<Field_3>}Message`, Bundle.BundleParts<B>["Message"]>, Bundle.BundleParts<B>["Message"], Bundle.BundleParts<B>["OutMessage"], OutStepMessage_3, R2_3, string
|
|
347
|
-
assemble: <const Ps extends readonly (import("foldkit-bundle").Placed<string, Root, Schema.Schema.Type<import("foldkit/message").MessageUnion<Cases>> & AnyMessage, any, any, any, any, any, any, any, string> | import("foldkit-bundle").PlacedCollection<string, Root, Schema.Schema.Type<import("foldkit/message").MessageUnion<Cases>> & AnyMessage, any, any, any, any, any, any, any, any> | import("foldkit-bundle").Wiring<Root, Schema.Schema.Type<import("foldkit/message").MessageUnion<Cases>> & AnyMessage, any>)[]>(...items: Ps) => Bundle.Assembly<Root, Schema.Schema.Type<import("foldkit/message").MessageUnion<Cases>> & AnyMessage, Ps, never>;
|
|
470
|
+
at: <B extends Bundle.AnyBundle, const Field extends { [K in keyof Root]: [Root[K]] extends [Bundle.BundleParts<B>["Model"]] ? [Bundle.BundleParts<B>["Model"]] extends [Root[K]] ? K : never : never; }[keyof Root] & string, OutStepMessage = never, R2 = never>(declared: Bundle.Declared<B, Field>, ...config: Bundle.PlaceConfigParam<Bundle.BundleParts<B>["Args"], Root, import("foldkit-bundle").Wrapped<`Got${Capitalize<Field>}Message`, Bundle.BundleParts<B>["Message"]>, Bundle.BundleParts<B>["Message"], Bundle.BundleParts<B>["OutMessage"], OutStepMessage, R2, Omit<Root, Field>> & ([import("foldkit-bundle").Wrapped<`Got${Capitalize<Field>}Message`, Bundle.BundleParts<B>["Message"]>] extends [Schema.Schema.Type<import("foldkit/message").MessageUnion<Cases>> & AnyMessage] ? unknown : import("foldkit-bundle").Invalid<"The parent Message does not include this placement's wrapper variant; spread its cases into defineMessageUnion">)) => PlacedBy<B, Root, import("foldkit-bundle").Wrapped<`Got${Capitalize<Field>}Message`, Bundle.BundleParts<B>["Message"]>, OutStepMessage, R2, Field>;
|
|
471
|
+
place: <B extends Bundle.AnyBundle, const Field_1 extends { [K in keyof Root]: [Root[K]] extends [Bundle.BundleParts<B>["Model"]] ? [Bundle.BundleParts<B>["Model"]] extends [Root[K]] ? K : never : never; }[keyof Root] & string, OutStepMessage_1 = never, R2_1 = never>(bundle: B, field: Field_1, ...config: Bundle.PlaceConfigParam<Bundle.BundleParts<B>["Args"], Root, import("foldkit-bundle").Wrapped<`Got${Capitalize<Field_1>}Message`, Bundle.BundleParts<B>["Message"]>, Bundle.BundleParts<B>["Message"], Bundle.BundleParts<B>["OutMessage"], OutStepMessage_1, R2_1, Omit<Root, Field_1>> & ([import("foldkit-bundle").Wrapped<`Got${Capitalize<Field_1>}Message`, Bundle.BundleParts<B>["Message"]>] extends [Schema.Schema.Type<import("foldkit/message").MessageUnion<Cases>> & AnyMessage] ? unknown : import("foldkit-bundle").Invalid<"The parent Message does not include this placement's wrapper variant; spread its cases into defineMessageUnion">)) => PlacedBy<B, Root, import("foldkit-bundle").Wrapped<`Got${Capitalize<Field_1>}Message`, Bundle.BundleParts<B>["Message"]>, OutStepMessage_1, R2_1, Field_1>;
|
|
472
|
+
each: <B extends Bundle.AnyBundle, const Field_2 extends { [K in keyof Root]: Root[K] extends Readonly<Record<string, infer V>> ? [V] extends [Bundle.BundleParts<B>["Model"]] ? [Bundle.BundleParts<B>["Model"]] extends [V] ? K : never : never : never; }[keyof Root] & string, OutStepMessage_2 = never, R2_2 = never>(declared: Bundle.DeclaredEach<B, Field_2>, ...config: Bundle.EachConfigParam<Bundle.BundleParts<B>["Args"], Root, import("foldkit-bundle").KeyedWrapped<`Got${Capitalize<Field_2>}Message`, Bundle.BundleParts<B>["Message"]>, Bundle.BundleParts<B>["Message"], Bundle.BundleParts<B>["OutMessage"], OutStepMessage_2, R2_2, string, Omit<Root, Field_2>> & ([import("foldkit-bundle").KeyedWrapped<`Got${Capitalize<Field_2>}Message`, Bundle.BundleParts<B>["Message"]>] extends [Schema.Schema.Type<import("foldkit/message").MessageUnion<Cases>> & AnyMessage] ? unknown : import("foldkit-bundle").Invalid<"The parent Message does not include this placement's wrapper variant; spread its cases into defineMessageUnion">)) => CollectionBy<B, Root, import("foldkit-bundle").KeyedWrapped<`Got${Capitalize<Field_2>}Message`, Bundle.BundleParts<B>["Message"]>, OutStepMessage_2, R2_2, Field_2>;
|
|
473
|
+
placeEach: <B extends Bundle.AnyBundle, const Field_3 extends { [K in keyof Root]: Root[K] extends Readonly<Record<string, infer V>> ? [V] extends [Bundle.BundleParts<B>["Model"]] ? [Bundle.BundleParts<B>["Model"]] extends [V] ? K : never : never : never; }[keyof Root] & string, OutStepMessage_3 = never, R2_3 = never>(bundle: B & WithoutResources<B>, field: Field_3, ...config: Bundle.EachConfigParam<Bundle.BundleParts<B>["Args"], Root, import("foldkit-bundle").KeyedWrapped<`Got${Capitalize<Field_3>}Message`, Bundle.BundleParts<B>["Message"]>, Bundle.BundleParts<B>["Message"], Bundle.BundleParts<B>["OutMessage"], OutStepMessage_3, R2_3, string, Omit<Root, Field_3>> & ([import("foldkit-bundle").KeyedWrapped<`Got${Capitalize<Field_3>}Message`, Bundle.BundleParts<B>["Message"]>] extends [Schema.Schema.Type<import("foldkit/message").MessageUnion<Cases>> & AnyMessage] ? unknown : import("foldkit-bundle").Invalid<"The parent Message does not include this placement's wrapper variant; spread its cases into defineMessageUnion">)) => CollectionBy<B, Root, import("foldkit-bundle").KeyedWrapped<`Got${Capitalize<Field_3>}Message`, Bundle.BundleParts<B>["Message"]>, OutStepMessage_3, R2_3, Field_3>;
|
|
474
|
+
assemble: <const Ps extends readonly (import("foldkit-bundle").Placed<string, Root, Schema.Schema.Type<import("foldkit/message").MessageUnion<Cases>> & AnyMessage, any, any, any, any, any, any, any, string, string> | import("foldkit-bundle").PlacedCollection<string, Root, Schema.Schema.Type<import("foldkit/message").MessageUnion<Cases>> & AnyMessage, any, any, any, any, any, any, any, any, string> | import("foldkit-bundle").Wiring<Root, Schema.Schema.Type<import("foldkit/message").MessageUnion<Cases>> & AnyMessage, any>)[]>(...items: Ps) => Bundle.Assembly<Root, Schema.Schema.Type<import("foldkit/message").MessageUnion<Cases>> & AnyMessage, Ps, never>;
|
|
348
475
|
link: {
|
|
349
476
|
readonly field: <const Key extends keyof Root & string, const Tag extends string, ChildMessage>(key: Key, wrapper: Wrapper<Tag, ChildMessage>, options?: {
|
|
350
477
|
readonly when?: (parent: Root) => boolean;
|
|
351
|
-
} | undefined) => Link<Root, import("foldkit-bundle").Wrapped<Tag, ChildMessage>, Root[Key], ChildMessage>;
|
|
478
|
+
} | undefined) => Link<Root, import("foldkit-bundle").Wrapped<Tag, ChildMessage>, Root[Key], ChildMessage, Key>;
|
|
352
479
|
readonly optional: <const Key extends { [K in keyof Root]: Root[K] extends Option.Option<unknown> ? K : never; }[keyof Root] & string, const Tag_1 extends string, ChildMessage_1>(key: Key, wrap: Wrapper<Tag_1, ChildMessage_1>, options?: {
|
|
353
480
|
readonly when?: (parent: Root) => boolean;
|
|
354
|
-
} | undefined) => Link<Root, import("foldkit-bundle").Wrapped<Tag_1, ChildMessage_1>, Root[Key] extends (infer T) ? T extends Root[Key] ? T extends Option.Option<infer Value> ? Value : never : never : never, ChildMessage_1>;
|
|
481
|
+
} | undefined) => Link<Root, import("foldkit-bundle").Wrapped<Tag_1, ChildMessage_1>, Root[Key] extends (infer T) ? T extends Root[Key] ? T extends Option.Option<infer Value> ? Value : never : never : never, ChildMessage_1, Key>;
|
|
355
482
|
readonly collection: <const Field_4 extends { [K in keyof Root]: Root[K] extends Readonly<Record<string, unknown>> ? K : never; }[keyof Root] & string, const Tag_2 extends string, ChildMessage_2, Key extends string>(field: Field_4, wrap: import("foldkit-bundle").KeyedWrapper<Tag_2, ChildMessage_2, Key>, options?: {
|
|
356
483
|
readonly when?: (parent: Root, key: Key) => boolean;
|
|
357
|
-
} | undefined) => import("foldkit-bundle").CollectionLink<Root, import("foldkit-bundle").KeyedWrapped<Tag_2, ChildMessage_2, Key>, Root[Field_4] extends (infer T) ? T extends Root[Field_4] ? T extends Readonly<Record<string, infer Value>> ? Value : never : never : never, ChildMessage_2, Key>;
|
|
484
|
+
} | undefined) => import("foldkit-bundle").CollectionLink<Root, import("foldkit-bundle").KeyedWrapped<Tag_2, ChildMessage_2, Key>, Root[Field_4] extends (infer T) ? T extends Root[Field_4] ? T extends Readonly<Record<string, infer Value>> ? Value : never : never : never, ChildMessage_2, Key, Field_4>;
|
|
358
485
|
readonly collectionById: <const Field_4 extends { [K in keyof Root]: Root[K] extends readonly unknown[] ? K : never; }[keyof Root] & string, const Tag_3 extends string, ChildMessage_3, Key_1 extends string>(field: Field_4, wrap: import("foldkit-bundle").KeyedWrapper<Tag_3, ChildMessage_3, Key_1>, options: {
|
|
359
486
|
readonly id: (item: Root[Field_4] extends (infer T) ? T extends Root[Field_4] ? T extends readonly (infer Item)[] ? Item : never : never : never) => Key_1;
|
|
360
487
|
readonly when?: (parent: Root, key: Key_1) => boolean;
|
|
361
|
-
}) => import("foldkit-bundle").CollectionLink<Root, import("foldkit-bundle").KeyedWrapped<Tag_3, ChildMessage_3, Key_1>, Root[Field_4] extends (infer T) ? T extends Root[Field_4] ? T extends readonly (infer Item)[] ? Item : never : never : never, ChildMessage_3, Key_1>;
|
|
488
|
+
}) => import("foldkit-bundle").CollectionLink<Root, import("foldkit-bundle").KeyedWrapped<Tag_3, ChildMessage_3, Key_1>, Root[Field_4] extends (infer T) ? T extends Root[Field_4] ? T extends readonly (infer Item)[] ? Item : never : never : never, ChildMessage_3, Key_1, Field_4>;
|
|
362
489
|
};
|
|
363
490
|
};
|
|
364
491
|
};
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../bundle/src/
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../bundle/src/placed.d.ts","../../bundle/src/link.d.ts","../../bundle/src/collection.d.ts","../../bundle/src/declare.d.ts","../../bundle/src/bundle.d.ts","../../bundle/src/parent.d.ts","../src/index.ts"],"mappings":";;;;;;;;;;;;cAYc;;;;;;;;;;;;;;;;;KAwBF,WAAW,MAAM,QAAQ,SAAS,MAAM,SAAS;UA2B5C,YAAY,MAAM,QAAQ,aAAa,SAAS,YAAY,gBAAgB,IAAI,aAAa;;;;;;;;;WASjG,OAAO,WAAW,YAAY;;WAE9B,SAAS,YAAY,YAAY,SAAS,OAAO,YAAY,SAAS,iBAAiB,OAAO,KAAK,QAAQ,SAAS,gBAAgB;;;;;;WAMpI,aAAa,SAAS,YAAY,OAAO,KAAK,QAAQ,SAAS,gBAAgB;;WAE/E;;WAEA,QAAQ,QAAQ;;;KAGjB,gBAAgB,QAAQ,eAAe,aAAa,SAAS,2BAC3D,WAAW,YAAY,UAAU,WAAW,gBAAgB,sBAAsB,oBAAoB,aAAa,eAAe,uBAAuB,MAAM,8BAA8B,gBAAgB,MAAM,QAAQ,eAAe,cAAc,OAAO,aAAa,MAAM,WAAW,gBAAgB,gCACnT;KACI,cAAc,QAAQ,eA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wBAAwB,OAAO,EAAE,YAAY,OAAO,cAAc,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,UAAU,IAAI,EAAE,SAAS,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,OAAO,MAAM;KACxR,aAAa,UAAU,WAAW,OAAO,aAAa,gBAAgB,IAAI,wBAAwB,iBAAiB,EAAE,YAAY,OAAO,cAAc,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,UAAU,IAAI,EAAE,SAAS,EAAE,kBAAkB,EAAE,eAAe,eAAe,MAAM;;;KCKlS,eAAe,YAAY;;KAG3B;WAA2B,YAAY,cAAc,eAAe;;qBA+F5D;WAjFC,OAAA,MAAM,aAAa,oBAAoB,cAAY,KAC1D,SAAS,MAAM,QAAM,SACjB,QAAQ,KAAK,eAAa;aACf,QAAQ,QAAQ;QAAkB,KAAA,+BAAA,QAAA,KAAA,eAAA,OAAA;WAkBtD,WAAA,MACA,UAAU,OAAO,OAAO,QACxB,cAAc,eAAe,OAAO,OAAO,SAAO,KAE7C,SAAS,MAAM,GAAG,QAAM,WAClB,iBACV;WAaD,SAAA,MACA,UAAU,OAAO,OAAO,QACxB,cAAc,eAAe,OAAO,OAAO,SAAO,KAE7C,SAAS,MAAM,GAAG,QAAM,UACnB,eAAa,iBACP,WAAW,YAAO,OAAA,MAAA,GAAA;WAclC,SAAA,MACA,UAAU,OAAO,OAAO,QACxB,cAAc,eAAe,OAAO,OAAO,SAAO,KAE7C,SAAS,MAAM,GAAG;;IAYF,SAAA,UAAA,eAAa,iBAAkB,WAAW,YAAO,OAAA,MAAA,GAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "foldkit-bundle-surface",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "foldkit-bundle placements as foldkit-surface Module contracts: each placement owns its Model path, validated with every other owner.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"foldkit",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"exports": {
|
|
28
28
|
".": {
|
|
29
|
+
"foldkit-plus:source": "./src/index.ts",
|
|
29
30
|
"types": "./dist/index.d.mts",
|
|
30
31
|
"import": "./dist/index.mjs"
|
|
31
32
|
}
|
|
@@ -36,20 +37,21 @@
|
|
|
36
37
|
"LICENSE"
|
|
37
38
|
],
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"foldkit-
|
|
40
|
-
"foldkit-
|
|
40
|
+
"foldkit-bundle": "0.4.0",
|
|
41
|
+
"foldkit-surface": "0.5.1"
|
|
41
42
|
},
|
|
42
43
|
"peerDependencies": {
|
|
43
|
-
"effect": "
|
|
44
|
-
"foldkit": "^0.
|
|
44
|
+
"effect": ">=4.0.0-rc.116 <4.0.0-rc.118",
|
|
45
|
+
"foldkit": "^0.163.0"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
|
-
"effect": "4.0.0-rc.
|
|
48
|
-
"
|
|
48
|
+
"@effect/platform-browser": "4.0.0-rc.116",
|
|
49
|
+
"effect": "4.0.0-rc.116",
|
|
50
|
+
"foldkit": "0.163.0",
|
|
49
51
|
"jsdom": "26.1.0",
|
|
50
52
|
"tsdown": "^0.23.0",
|
|
51
53
|
"typescript": "5.9.3",
|
|
52
|
-
"foldkit-mirror": "0.
|
|
54
|
+
"foldkit-mirror": "0.4.0"
|
|
53
55
|
},
|
|
54
56
|
"scripts": {
|
|
55
57
|
"build": "tsdown",
|