@markless/router 0.4.0 → 0.6.0

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.
@@ -1,31 +1,1093 @@
1
+ //#region ../serializer/src/async-boundary-arm.d.ts
2
+ declare const ASYNC_BOUNDARY_ARM: {
3
+ readonly try: 0;
4
+ readonly pending: 1;
5
+ readonly catch: 2;
6
+ };
7
+ //#endregion
8
+ //#region ../serializer/src/protocol-constants.d.ts
9
+ declare const ASYNC_PROTOCOL_VERSION = 1;
10
+ declare const STORAGE_PROTOCOL_VERSION = 2;
11
+ declare const PROTOCOL_EVENT_ACTION_KIND: {
12
+ readonly event: "event";
13
+ readonly externalDelegate: "external-delegate";
14
+ };
15
+ //#endregion
16
+ //#region ../serializer/src/protocol.d.ts
17
+ type ProtocolAsyncBoundaryArm = (typeof ASYNC_BOUNDARY_ARM)[keyof typeof ASYNC_BOUNDARY_ARM];
18
+ type ProtocolSyncPolicyCondition = {
19
+ readonly type: 'and';
20
+ readonly conditions: ReadonlyArray<ProtocolSyncPolicyCondition>;
21
+ } | {
22
+ readonly type: 'or';
23
+ readonly conditions: ReadonlyArray<ProtocolSyncPolicyCondition>;
24
+ } | {
25
+ readonly type: 'not';
26
+ readonly condition: ProtocolSyncPolicyCondition;
27
+ } | {
28
+ readonly type: 'graph-truthy';
29
+ readonly graphNodeId: string;
30
+ readonly path?: ReadonlyArray<string>;
31
+ } | {
32
+ readonly type: 'constant-truthy';
33
+ readonly value: unknown;
34
+ } | {
35
+ readonly type: 'event-equals';
36
+ readonly field: string;
37
+ readonly value: unknown;
38
+ };
39
+ type ProtocolSyncPolicyBranch = {
40
+ readonly when: ProtocolSyncPolicyCondition;
41
+ readonly actions: ReadonlyArray<'preventDefault' | 'stopPropagation'>;
42
+ };
43
+ type ProtocolSyncPolicy = ProtocolSyncPolicyBranch | {
44
+ readonly branches: ReadonlyArray<ProtocolSyncPolicyBranch>;
45
+ };
46
+ type ProtocolEventActionKind = (typeof PROTOCOL_EVENT_ACTION_KIND)[keyof typeof PROTOCOL_EVENT_ACTION_KIND];
47
+ type ProtocolEventAction = {
48
+ readonly kind: typeof PROTOCOL_EVENT_ACTION_KIND.externalDelegate;
49
+ readonly owner: string;
50
+ };
51
+ type ProtocolEventRecord = {
52
+ readonly hostNodeId: string;
53
+ readonly eventName: string;
54
+ readonly syncPolicy?: ProtocolSyncPolicy;
55
+ readonly symbolIds: ReadonlyArray<string>;
56
+ readonly action?: ProtocolEventAction;
57
+ };
58
+ type ProtocolStatePayload = {
59
+ readonly version: typeof ASYNC_PROTOCOL_VERSION | typeof STORAGE_PROTOCOL_VERSION;
60
+ readonly cells: ReadonlyArray<{
61
+ readonly graphNodeId: string;
62
+ readonly name: string;
63
+ readonly valueKind: 'scalar' | 'object' | 'array' | 'unknown';
64
+ readonly value?: unknown;
65
+ readonly directValue?: unknown;
66
+ }>;
67
+ readonly computed: ReadonlyArray<{
68
+ readonly graphNodeId: string;
69
+ readonly name: string;
70
+ readonly async: boolean;
71
+ readonly deriveSymbolId?: string;
72
+ readonly value?: unknown;
73
+ readonly directValue?: unknown;
74
+ readonly dependencies?: ReadonlyArray<{
75
+ readonly graphNodeId: string;
76
+ readonly path: ReadonlyArray<string>;
77
+ }>;
78
+ readonly snapshot?: {
79
+ readonly status: 'idle';
80
+ readonly version: 0;
81
+ } | {
82
+ readonly status: 'pending';
83
+ readonly version: number;
84
+ readonly key: unknown;
85
+ } | {
86
+ readonly status: 'fulfilled';
87
+ readonly version: number;
88
+ readonly key: unknown;
89
+ readonly value: unknown;
90
+ } | {
91
+ readonly status: 'rejected';
92
+ readonly version: number;
93
+ readonly key: unknown;
94
+ readonly error: unknown;
95
+ };
96
+ }>;
97
+ readonly sharedSeeds?: ReadonlyArray<{
98
+ readonly graphNodeId: string;
99
+ readonly deriveSymbolId: string;
100
+ readonly dependencies: ReadonlyArray<{
101
+ readonly graphNodeId: string;
102
+ readonly path: ReadonlyArray<string>;
103
+ readonly reads: {
104
+ readonly graphNodeId: string;
105
+ readonly path: ReadonlyArray<string>;
106
+ };
107
+ }>;
108
+ }>;
109
+ readonly sharedDefinitions?: ReadonlyArray<{
110
+ readonly id: string;
111
+ readonly name: string;
112
+ readonly exportedName: string;
113
+ readonly scope?: 'request' | 'container' | 'page' | 'widget';
114
+ readonly version: number;
115
+ readonly graphNodeIds: ReadonlyArray<string>;
116
+ readonly projectionIds?: ReadonlyArray<string>;
117
+ readonly dependencies?: ReadonlyArray<{
118
+ readonly definitionId: string;
119
+ readonly definitionName: string;
120
+ }>;
121
+ readonly returnProperties?: ReadonlyArray<{
122
+ readonly kind: 'graph';
123
+ readonly name: string;
124
+ readonly graphNodeId: string;
125
+ readonly path: ReadonlyArray<string>;
126
+ } | {
127
+ readonly kind: 'method';
128
+ readonly name: string;
129
+ }>;
130
+ }>;
131
+ readonly storage?: ReadonlyArray<{
132
+ readonly graphNodeId: string;
133
+ readonly key: string;
134
+ }>;
135
+ };
136
+ type ProtocolBranchContentRead = {
137
+ readonly graphNodeId: string;
138
+ readonly path: ReadonlyArray<string>;
139
+ readonly source: string;
140
+ };
141
+ /**
142
+ * One prop a composed part's own arm-update symbol can read: the name the part
143
+ * spells and the graph node the caller passed it. Only props with a live route
144
+ * are listed; a name missing from the table was passed statically, so the value
145
+ * the part mounted with is already its final one.
146
+ */
147
+ type ProtocolComposedGraphProp = {
148
+ readonly name: string;
149
+ readonly graphNodeId: string;
150
+ readonly path?: ReadonlyArray<string>;
151
+ };
152
+ /**
153
+ * One IDREF position naming a handle some branch arm binds. `armIndex` is the
154
+ * arm that binds it: the attribute is earned exactly while that arm is the
155
+ * painted one, which is the only test that also answers for an arm the render
156
+ * already served and no flip ever re-materializes. `handleReadId` is the same
157
+ * key the branch record's `elementHandleIds` uses.
158
+ */
159
+ type ProtocolBranchIdrefSite = {
160
+ readonly hostNodeId: string;
161
+ readonly attributeName: string;
162
+ readonly handleReadId: string;
163
+ readonly armIndex: number;
164
+ };
165
+ type ProtocolArmBranchRecord = {
166
+ readonly id: string;
167
+ readonly testReads: ReadonlyArray<{
168
+ readonly source: string;
169
+ readonly graphNodeId: string;
170
+ readonly path: ReadonlyArray<string>;
171
+ }>;
172
+ readonly contentReads?: ReadonlyArray<ProtocolBranchContentRead>;
173
+ readonly symbolId?: string;
174
+ readonly armTests?: ReadonlyArray<unknown>;
175
+ readonly declaredEmptyArms?: ReadonlyArray<number>;
176
+ readonly startAnchor?: {
177
+ readonly strategy: 'arm-branch-comment' | 'dom-order-comment';
178
+ readonly index: number;
179
+ };
180
+ readonly endAnchor?: {
181
+ readonly strategy: 'arm-branch-comment' | 'dom-order-comment';
182
+ readonly index: number;
183
+ };
184
+ readonly armRecords?: NonNullable<ProtocolViewPayload['branches']>[number]['armRecords'];
185
+ readonly composedInstancePath?: string;
186
+ readonly composedGraphProps?: ReadonlyArray<ProtocolComposedGraphProp>;
187
+ };
188
+ type ProtocolArmRecordSet = {
189
+ readonly locators: ReadonlyArray<{
190
+ readonly hostNodeId: string;
191
+ readonly index: number;
192
+ readonly tagName: string;
193
+ }>;
194
+ readonly events: ProtocolViewPayload['events'];
195
+ readonly domUpdates?: ProtocolViewPayload['domUpdates'];
196
+ readonly behaviors: ProtocolViewPayload['behaviors'];
197
+ readonly elementHandles: ProtocolViewPayload['elementHandles'];
198
+ readonly keyedRepeats?: ProtocolViewPayload['keyedRepeats'];
199
+ readonly branches?: ReadonlyArray<ProtocolArmBranchRecord>;
200
+ };
201
+ /**
202
+ * Where one row-template slot's value comes from: the repeated item, a graph
203
+ * node the page already holds, or an authored expression.
204
+ *
205
+ * Exactly one of the three. `itemPath` is a property path off the item the mint
206
+ * was handed. The `graphNodeId`/`graphPath` pair is a read of the page's own
207
+ * state - a row spelling `name={list.name}`. `source` is an authored expression
208
+ * - `\`Edit ${row.name}\``, `format(row.at)` - that the owning component's
209
+ * render-data reader answers for the row, under the same key the server render
210
+ * used; `reads` names the graph nodes outside the row it reads, omitted when none.
211
+ *
212
+ * A row rebuilds when any slot value moves: its item changed under its key, or a
213
+ * graph node a slot reads was written.
214
+ */
215
+ type ProtocolRowTemplateSlotValue = {
216
+ readonly itemPath: ReadonlyArray<string>;
217
+ } | {
218
+ readonly graphNodeId: string;
219
+ readonly graphPath: ReadonlyArray<string>;
220
+ } | {
221
+ readonly source: string;
222
+ readonly reads?: ReadonlyArray<{
223
+ readonly graphNodeId: string;
224
+ readonly path: ReadonlyArray<string>;
225
+ }>;
226
+ };
227
+ type ProtocolViewPayload = {
228
+ readonly version: typeof ASYNC_PROTOCOL_VERSION;
229
+ readonly asyncRunners?: Readonly<Record<string, string>>;
230
+ readonly locators: ReadonlyArray<{
231
+ readonly hostNodeId: string;
232
+ readonly strategy: 'dom-order';
233
+ readonly index: number;
234
+ readonly tagName: string;
235
+ }>;
236
+ readonly events: ReadonlyArray<ProtocolEventRecord>;
237
+ readonly domUpdates: ReadonlyArray<{
238
+ readonly hostNodeId: string;
239
+ readonly source: string;
240
+ readonly graphNodeId: string;
241
+ readonly path: ReadonlyArray<string>;
242
+ readonly target?: {
243
+ readonly kind: 'text';
244
+ readonly prefix?: string;
245
+ readonly suffix?: string;
246
+ readonly trueValue?: string;
247
+ readonly falseValue?: string;
248
+ /**
249
+ * The host's child-node position of the one text node this write owns,
250
+ * present only when the text shares its element with other children.
251
+ * Negative counts back from the end: -1 is the last child node.
252
+ */
253
+ readonly textNode?: number;
254
+ } | {
255
+ readonly kind: 'attribute';
256
+ readonly name: string;
257
+ } | {
258
+ readonly kind: 'property';
259
+ readonly name: string;
260
+ } | {
261
+ readonly kind: 'class';
262
+ readonly trueValue?: string;
263
+ readonly falseValue?: string;
264
+ /** Class names every write must keep — the module's style scope, which the runtime would otherwise overwrite. */
265
+ readonly constantClass?: string;
266
+ /** Class names every write keeps in front of the value — a part's own style scope, which its markup writes before the class its consumer handed it. */
267
+ readonly leadingClass?: string;
268
+ } | {
269
+ readonly kind: 'style';
270
+ };
271
+ readonly symbolId?: string;
272
+ }>;
273
+ readonly behaviors: ReadonlyArray<{
274
+ readonly hostNodeId: string;
275
+ readonly source: string;
276
+ readonly functionSource: string;
277
+ readonly inputSources: ReadonlyArray<string>;
278
+ readonly inputValues?: ReadonlyArray<unknown>;
279
+ readonly inputGraphReads?: ReadonlyArray<{
280
+ readonly inputIndex: number;
281
+ readonly source: string;
282
+ readonly graphNodeId: string;
283
+ readonly path: ReadonlyArray<string>;
284
+ }>;
285
+ readonly symbolId?: string;
286
+ /** The behavior reads or writes page state, so it runs against the page's graph. */
287
+ readonly usesGraph?: true;
288
+ }>;
289
+ readonly elementHandles: ReadonlyArray<{
290
+ readonly hostNodeId: string;
291
+ readonly handleId: string;
292
+ readonly name: string;
293
+ /** Declared `element<T[]>()`: this handle names an ordered set, and a read answers an array. */
294
+ readonly plural?: boolean;
295
+ }>;
296
+ readonly keyedRepeats?: ReadonlyArray<{
297
+ readonly id: string;
298
+ readonly parentHostNodeId: string;
299
+ /**
300
+ * Where the OWNER's own markup put the rows, when `parentHostNodeId` names
301
+ * an element the owner never wrote: a `@for` inside a child's `{children}`
302
+ * renders into the element that child wraps its hole in, so the parent above
303
+ * is the child's, and this is the host the projecting markup sat in. Only a
304
+ * reader that needs the owner's own id space reads it.
305
+ */
306
+ readonly ownerHostNodeId?: string;
307
+ /**
308
+ * The graph instance path of the component that AUTHORED this `@for`, as
309
+ * composition spells it (`c<n>:`/`p<n>:` segments, outermost first).
310
+ *
311
+ * A row key is only unique within one rendered repeat, and the repeat's own
312
+ * path is the only thing that tells two renderings of one `@for` apart: two
313
+ * family roots over ONE page-level collection read a collection node in page
314
+ * space, so a row keyed off the collection is spelled the same by both. The
315
+ * mint keys a minted row's segment on this plus the row key.
316
+ *
317
+ * Pay-per-use: a repeat the root module authored itself stands at no
318
+ * instance and omits the field, so its record is byte-identical to what it
319
+ * was before this existed. Only composition writes it.
320
+ */
321
+ readonly instancePath?: string;
322
+ /**
323
+ * Present on a `@for` written inside another `@for`'s row. Its rows render
324
+ * once per enclosing row, so the browser wires one instance of this record in
325
+ * each enclosing row. Its own parent has no single host, so `parentHostNodeId`
326
+ * names the outermost enclosing repeat's parent: whatever keeps or moves that
327
+ * repeat's record by host keeps or moves this one with it.
328
+ *
329
+ * `parentHostPath` walks from an enclosing row's root to this repeat's parent,
330
+ * ROW-ROOT-relative like `rowEvents[].hostPath`. `itemPath` is present when
331
+ * the collection is a path on the enclosing row's item (`group.items`); the
332
+ * collection then reads the outermost enclosing collection with a `'*'`
333
+ * segment for each enclosing row (`['*', 'items']`), which reads nothing on
334
+ * its own and which each instance replaces with its enclosing row's index.
335
+ * `repeatId` is spelled as the authoring module spells it: composition
336
+ * prefixes a record's `id` but not this, so it resolves under the record's
337
+ * own prefix.
338
+ *
339
+ * Pay-per-use: a repeat inside no other repeat omits the field.
340
+ */
341
+ readonly enclosingRow?: {
342
+ readonly repeatId: string;
343
+ readonly parentHostPath: ReadonlyArray<number>;
344
+ readonly itemPath?: ReadonlyArray<string>;
345
+ };
346
+ readonly collectionGraphNodeId?: string;
347
+ readonly collectionPath: ReadonlyArray<string>;
348
+ readonly keyPath: ReadonlyArray<string>;
349
+ /**
350
+ * `key i`: a row's key is its position, not a value read off the item.
351
+ * Pay-per-use: a repeat keyed by item data omits the field.
352
+ */
353
+ readonly indexKey?: true;
354
+ /**
355
+ * Rows written straight into an `@if`/`@switch` arm or an `@try`/`@pending`/
356
+ * `@catch` arm, with no element of the arm around them: they stand between
357
+ * that range's anchors, and only while `arm` is the one shown. `branchId` is
358
+ * the branch site or async boundary id as the authoring module spells it;
359
+ * composition prefixes it the way it prefixes this record's `id`.
360
+ */
361
+ readonly branchArm?: {
362
+ readonly branchId: string;
363
+ readonly arm: number;
364
+ };
365
+ readonly itemName: string;
366
+ readonly rowElementCount: number;
367
+ /**
368
+ * Element children of the parent that stand before the rows. Rows occupy
369
+ * `[rowStartOffset, rowStartOffset + items.length)` among the parent's child
370
+ * elements; a repeat whose rows begin at 0 omits the field. A repeat whose
371
+ * prefix has no compile-time element count says `rowEndOffset` instead, or
372
+ * ships no record at all when its suffix has none either.
373
+ */
374
+ readonly rowStartOffset?: number;
375
+ /**
376
+ * Element children of the parent that stand after the rows, set only when
377
+ * the prefix has no compile-time element count. Rows then occupy the
378
+ * `items.length` element children ending `rowEndOffset` before the last.
379
+ */
380
+ readonly rowEndOffset?: number;
381
+ /**
382
+ * The browser can never change these rows: the collection and every value a
383
+ * row shows are fixed once the page is served, so the record carries no row
384
+ * markup and resume neither follows the collection nor loads row-building
385
+ * code. Pay-per-use: a repeat whose rows can change omits the field.
386
+ */
387
+ readonly fixed?: true;
388
+ /**
389
+ * The `@empty` arm's finished markup, for the mint that raises it when the
390
+ * collection empties after resume and takes it back out when a row returns.
391
+ * Carried only for a repeat that HAS an `@empty` arm whose markup is fully
392
+ * static and whose elements no record names: everything else would need
393
+ * wiring the mint cannot do, so it ships nothing and the served behaviour
394
+ * stands. A repeat with no `@empty` arm omits the field entirely.
395
+ */
396
+ readonly emptyArm?: {
397
+ readonly html: string;
398
+ };
399
+ /**
400
+ * One row's compiled markup, for the mint that builds a row the server never
401
+ * rendered - an item appended to the collection after resume.
402
+ *
403
+ * `html` is the row chunk's statics joined, slot markers KEPT: the marker
404
+ * comments are where the row's own text lives, so the mint finds each text
405
+ * position by walking to it rather than by re-parsing. `textSlots` names
406
+ * those positions - `path` is FRAGMENT-relative (`[0]` is the row root),
407
+ * the value channel is `ProtocolRowTemplateSlotValue` - and is omitted
408
+ * when the row has none, which is the fully static row.
409
+ *
410
+ * `attributeSlots` names the row's dynamic attributes the same way, with the
411
+ * attribute `name` to write and a `path` addressing the ELEMENT that carries
412
+ * it. The attribute's value is not in the html at all: the statics join
413
+ * around it, and the mint writes it under the presence rule every other
414
+ * render path uses (absent for null, undefined and false).
415
+ *
416
+ * Carried only for a row the client can finish alone: static markup, or
417
+ * markup whose every slot - text or attribute - reads off the repeated item,
418
+ * off the items of the rows enclosing it, off a graph node the page already
419
+ * holds, or off an authored expression over those and the owning
420
+ * component's props (a `source` slot, `class` and `style` included; the
421
+ * html keeps a slot attribute's static part, such as the scope class). A row
422
+ * holding anything else - an element handle's id, a value only the render
423
+ * produces, a nested construct - needs wiring the mint cannot do, so it
424
+ * ships nothing and the served behaviour stands. One child component is the exception: a
425
+ * row element wrapping one is markup here plus identity in `rowComponent`,
426
+ * whose `slotPath` names the marker in this html the child's rendered nodes
427
+ * replace.
428
+ *
429
+ * Pay-per-use: a repeat whose row is not mintable emits no field at all, so
430
+ * its record is byte-identical to what it was before this existed, and a row
431
+ * with no dynamic attributes omits `attributeSlots` for the same reason.
432
+ */
433
+ readonly rowTemplate?: {
434
+ readonly html: string;
435
+ /** The component whose render-data reader answers `source` slots; present exactly when one is. */
436
+ readonly componentName?: string;
437
+ readonly textSlots?: ReadonlyArray<{
438
+ readonly path: ReadonlyArray<number>;
439
+ } & ProtocolRowTemplateSlotValue>;
440
+ readonly attributeSlots?: ReadonlyArray<{
441
+ readonly path: ReadonlyArray<number>;
442
+ readonly name: string;
443
+ } & ProtocolRowTemplateSlotValue>;
444
+ };
445
+ /**
446
+ * The parent graph node each prop a `rowTemplate` source slot reads follows,
447
+ * by prop name. The owning component's reader reads a prop under the
448
+ * child's own id, which holds the served value; the row reads the node the
449
+ * parent passed instead. Only composition writes it, and only for a prop
450
+ * passed as a live graph reference.
451
+ *
452
+ * Pay-per-use: a row reading no routed prop omits the field.
453
+ */
454
+ readonly propRoutes?: ReadonlyArray<{
455
+ readonly name: string;
456
+ readonly graphNodeId: string;
457
+ readonly path: ReadonlyArray<string>;
458
+ }>;
459
+ /**
460
+ * The component a row of this repeat roots, named by identity alone.
461
+ *
462
+ * A child component cannot ship markup the way `rowTemplate` does: it has a
463
+ * graph, not a template, and one instance per rendered row. So this carries
464
+ * identifiers and nothing else - the client builds the row by running the
465
+ * same one-edge render the server ran, under ids qualified by the row's key.
466
+ *
467
+ * `componentName` is the component that OWNS the edge (the one whose markup
468
+ * holds the `@for`), not the child: the child's name already rides on the
469
+ * edge. `itemPropName` is the prop the row's item crosses under, carried
470
+ * only when exactly one prop is the bare `@for` binding.
471
+ *
472
+ * `slotPath` appears when a row ELEMENT wraps the component rather than the
473
+ * row being the component. The wrapper's markup then rides in `rowTemplate`,
474
+ * and this FRAGMENT-relative path (`[0]` is the row root) names the marker
475
+ * comment inside it that the child's rendered nodes replace. Its absence is
476
+ * the row that IS the component, which has no wrapper and ships no
477
+ * `rowTemplate` - the shape this field had before wrappers were minted, so
478
+ * such a record stays byte-identical.
479
+ *
480
+ * Carried only for a key-identified repeat whose row start is known and
481
+ * whose child is declared in the same module; anything else is refused, so
482
+ * the served behaviour stands and the record is byte-identical.
483
+ *
484
+ * `rowChunkId` replaces `componentEdgeId` for a row whose markup an @if or
485
+ * @switch over the row item picks: the client renders that owner chunk
486
+ * whole, the way the server did, instead of one edge.
487
+ */
488
+ readonly rowComponent?: {
489
+ readonly componentEdgeId?: string;
490
+ readonly componentName: string;
491
+ readonly itemPropName?: string;
492
+ readonly slotPath?: ReadonlyArray<number>;
493
+ readonly rowChunkId?: string;
494
+ };
495
+ readonly rowElementHandles?: ReadonlyArray<{
496
+ readonly hostPath: ReadonlyArray<number>;
497
+ readonly handleId: string;
498
+ readonly name: string;
499
+ readonly plural?: boolean;
500
+ }>;
501
+ readonly rowEvents: ReadonlyArray<{
502
+ readonly hostPath: ReadonlyArray<number>;
503
+ readonly eventName: string;
504
+ readonly symbolIds: ReadonlyArray<string>;
505
+ readonly syncPolicy?: ProtocolSyncPolicy;
506
+ }>;
507
+ }>;
508
+ readonly branches?: ReadonlyArray<{
509
+ readonly id: string;
510
+ readonly startAnchor: {
511
+ readonly strategy: 'dom-order-comment';
512
+ readonly index: number;
513
+ };
514
+ readonly endAnchor: {
515
+ readonly strategy: 'dom-order-comment';
516
+ readonly index: number;
517
+ };
518
+ readonly symbolId?: string;
519
+ readonly armTests?: ReadonlyArray<unknown>;
520
+ readonly armRecords?: ReadonlyArray<{
521
+ readonly events: ReadonlyArray<{
522
+ readonly hostPath: ReadonlyArray<number>;
523
+ readonly eventName: string;
524
+ readonly symbolIds: ReadonlyArray<string>;
525
+ readonly syncPolicy?: ProtocolSyncPolicy;
526
+ readonly action?: ProtocolEventAction;
527
+ }>;
528
+ readonly domUpdates: ReadonlyArray<Record<string, unknown>>;
529
+ readonly behaviors: ReadonlyArray<Record<string, unknown>>;
530
+ readonly elementHandles: ReadonlyArray<Record<string, unknown>>;
531
+ }>;
532
+ readonly testReads?: ReadonlyArray<{
533
+ readonly source: string;
534
+ readonly graphNodeId: string;
535
+ readonly path: ReadonlyArray<string>;
536
+ }>;
537
+ /**
538
+ * Reads an arm renders with no element of its own to bind to. Writing one
539
+ * through an element update would erase both arms' markers, so these
540
+ * refresh the arm's own marker range through the branch's update symbol.
541
+ */
542
+ readonly contentReads?: ReadonlyArray<ProtocolBranchContentRead>;
543
+ /**
544
+ * Marks a branch whose arms hold a component that has to run, so a flip
545
+ * re-renders the page through the prerender evaluator instead of rebuilding
546
+ * markup from `armRecords`. Absent on every branch the compiler could build
547
+ * arm parts for, which keeps those payloads byte-identical.
548
+ */
549
+ readonly escalates?: true;
550
+ /**
551
+ * Arm-relative records for the arm THIS render served, moved out of the
552
+ * page-absolute streams. Only an escalating branch carries one; `armRecords`
553
+ * above stays the compiler's per-arm plan for every other branch.
554
+ */
555
+ readonly servedArmRecords?: ProtocolArmRecordSet;
556
+ /**
557
+ * The instance path of the part that authored this branch, present on
558
+ * every branch that travelled through composition and absent on every
559
+ * branch that did not. An arm's own update symbol reads the part-local
560
+ * prop ids its module spells, and only the two fields here say which
561
+ * instance it is running as and where its props now live: the record's
562
+ * `testReads`/`contentReads` were rewritten to the caller's nodes, but
563
+ * the symbol's own read has no other route.
564
+ */
565
+ readonly composedInstancePath?: string;
566
+ readonly composedGraphProps?: ReadonlyArray<ProtocolComposedGraphProp>;
567
+ /**
568
+ * Minted element() ids for the handles this branch's arms bind, resolved by
569
+ * the render that served the branch. The token they were minted from is a
570
+ * seed-map value, so a flip has no second way to spell them. Keyed by
571
+ * `protocolElementHandleReadId`, the whole read id the arm symbol asks
572
+ * under, so the resume side answers by matching a key it was handed rather
573
+ * than re-deriving the namespace. Absent on every branch whose arms bind no
574
+ * handle an IDREF names, which keeps those payloads byte-identical.
575
+ */
576
+ readonly elementHandleIds?: Readonly<Record<string, string>>;
577
+ /**
578
+ * IDREF positions OUTSIDE the arms that name a handle an arm binds. The
579
+ * element they sit on outlives the flip, so the attribute is written when
580
+ * the arm files its handle and removed when the arm takes it away, rather
581
+ * than served naming an element that is not there.
582
+ */
583
+ readonly idrefSites?: ReadonlyArray<ProtocolBranchIdrefSite>;
584
+ }>;
585
+ readonly asyncBoundaries: ReadonlyArray<{
586
+ readonly id: string;
587
+ readonly runnerGraphNodeId: string | null;
588
+ readonly initiallyServedArm: ProtocolAsyncBoundaryArm;
589
+ readonly updateSymbolId?: string;
590
+ readonly armRecords?: ProtocolArmRecordSet | ReadonlyArray<ProtocolArmRecordSet>;
591
+ readonly startAnchor: {
592
+ readonly strategy: 'dom-order-comment';
593
+ readonly index: number;
594
+ };
595
+ readonly endAnchor: {
596
+ readonly strategy: 'dom-order-comment';
597
+ readonly index: number;
598
+ };
599
+ readonly asyncReads: ReadonlyArray<{
600
+ readonly source: string;
601
+ readonly graphNodeId: string;
602
+ readonly path: ReadonlyArray<string>;
603
+ readonly runnerSymbolId?: string;
604
+ }>;
605
+ }>;
606
+ };
607
+ //#endregion
608
+ //#region ../compiler/src/artifacts.d.ts
609
+ type RuntimeDemandMapRecordKind = ProtocolEventActionKind | 'async-boundary' | 'behavior' | 'branch' | 'dom-update' | 'element-handle' | 'keyed-repeat' | 'overlay';
610
+ type RuntimeDemandMapAction = {
611
+ readonly hostNodeId: string;
612
+ readonly eventName: string;
613
+ readonly recordKind: ProtocolEventActionKind | 'keyed-repeat-row';
614
+ readonly recordKinds: ReadonlyArray<RuntimeDemandMapRecordKind>;
615
+ readonly payloadRecordIds: ReadonlyArray<string>;
616
+ readonly runtimeModuleIds: ReadonlyArray<string>;
617
+ readonly plan?: RuntimeDemandMapActionPlan | RuntimeDemandMapClosurePlan;
618
+ /**
619
+ * Every symbol and runtime module this action's first use can load: its handlers,
620
+ * the computeds, updates, arms, rows and async settles its writes reach, the
621
+ * handlers those arms and rows wire, and the same in every child module its
622
+ * writes re-render. Complete once joined with every page module's `firstUsePage`
623
+ * for its page-space writes and calls. `'unknown'` when any consequence could
624
+ * not be classified.
625
+ */
626
+ readonly firstUse?: RuntimeDemandMapFirstUseReach;
627
+ };
628
+ type RuntimeDemandMapFirstUse = {
629
+ readonly symbolIds: ReadonlyArray<string>;
630
+ readonly runtimeModuleIds: ReadonlyArray<string>;
631
+ readonly foreign?: ReadonlyArray<{
632
+ readonly file: string;
633
+ readonly symbolIds: ReadonlyArray<string>;
634
+ }>;
635
+ readonly pageSpaceWrites?: ReadonlyArray<string>;
636
+ readonly calls?: ReadonlyArray<RuntimeDemandMapFirstUseCall>;
637
+ };
638
+ type RuntimeDemandMapFirstUseReach = RuntimeDemandMapFirstUse | 'unknown';
639
+ type RuntimeDemandMapFirstUseCall = {
640
+ readonly file?: string;
641
+ readonly prop: string;
642
+ } | {
643
+ readonly slot: string;
644
+ };
645
+ type RuntimeDemandMapActionPlan = {
646
+ readonly version: 1;
647
+ readonly kind: 'scalar' | 'row';
648
+ readonly symbolId: string;
649
+ readonly cell: string;
650
+ readonly write: {
651
+ readonly kind: 'assign' | 'update';
652
+ readonly value?: unknown;
653
+ readonly valueKind?: 'undefined';
654
+ readonly localPath?: ReadonlyArray<string>;
655
+ readonly updateOperator?: '++' | '--';
656
+ };
657
+ readonly textUpdates: ReadonlyArray<{
658
+ readonly hostNodeId: string;
659
+ readonly graphNodeId: string;
660
+ readonly symbolId: string;
661
+ readonly prefix?: string;
662
+ readonly suffix?: string;
663
+ }>;
664
+ readonly repeatId?: string;
665
+ readonly fullDecodeCells?: ReadonlyArray<string>;
666
+ };
667
+ /**
668
+ * An action whose whole write closure is synchronous and page-local: its real
669
+ * handler runs against a store holding only `cells`, the `computed` it reaches
670
+ * re-derive in the listed (dependency-first) order, and `updates` are the text
671
+ * and attribute updates reading anything the handler may change. Ids are the
672
+ * module's own; a composed instance qualifies them with its instance path.
673
+ */
674
+ type RuntimeDemandMapClosurePlan = {
675
+ readonly version: 1;
676
+ readonly kind: 'closure';
677
+ readonly symbolId: string;
678
+ readonly cells: ReadonlyArray<string>;
679
+ readonly computed: ReadonlyArray<{
680
+ readonly graphNodeId: string;
681
+ readonly deriveSymbolId: string;
682
+ }>;
683
+ readonly updates: ReadonlyArray<{
684
+ readonly hostNodeId: string;
685
+ readonly graphNodeId: string;
686
+ readonly path: ReadonlyArray<string>;
687
+ readonly symbolId: string;
688
+ }>;
689
+ };
690
+ //#endregion
691
+ //#region ../runtime/src/graph.d.ts
692
+ type RuntimeGraphAsyncSnapshot = {
693
+ readonly status: 'idle';
694
+ readonly version: 0;
695
+ } | {
696
+ readonly status: 'pending';
697
+ readonly version: number;
698
+ readonly key: unknown;
699
+ readonly value?: unknown;
700
+ } | {
701
+ readonly status: 'fulfilled';
702
+ readonly version: number;
703
+ readonly key: unknown;
704
+ readonly value: unknown;
705
+ } | {
706
+ readonly status: 'rejected';
707
+ readonly version: number;
708
+ readonly key: unknown;
709
+ readonly error: unknown;
710
+ };
711
+ type DomJournalEntry = {
712
+ readonly type: 'setText';
713
+ readonly locator: string;
714
+ readonly value: unknown;
715
+ /** The one child text node this write owns, when its element holds other children too. */
716
+ readonly node?: (host: unknown) => unknown;
717
+ } | {
718
+ readonly type: 'setAttr' | 'setProp';
719
+ readonly locator: string;
720
+ readonly name: string;
721
+ readonly value: unknown;
722
+ } | {
723
+ readonly type: 'insertRange';
724
+ readonly locator: string;
725
+ readonly fragment: unknown;
726
+ } | {
727
+ readonly type: 'removeRange';
728
+ readonly locator: string;
729
+ } | {
730
+ readonly type: 'moveRange';
731
+ readonly locator: string;
732
+ readonly before: string;
733
+ } | {
734
+ readonly type: 'runCleanup';
735
+ readonly locator: string;
736
+ };
737
+ type DomJournalResult = DomJournalEntry | ReadonlyArray<DomJournalEntry>;
738
+ type DomJournalListener = (entries: ReadonlyArray<DomJournalEntry>) => void | Promise<void>;
739
+ type RuntimeGraphWrite = {
740
+ readonly graphNodeId: string;
741
+ readonly path?: ReadonlyArray<string>;
742
+ readonly value: unknown;
743
+ };
744
+ type RuntimeGraphSharedWrite = {
745
+ readonly definitionId: string;
746
+ readonly propertyName: string;
747
+ readonly path?: ReadonlyArray<string>;
748
+ readonly value: unknown;
749
+ };
750
+ type RuntimeGraphSharedPatchOperation = readonly [operation: 'set', path: ReadonlyArray<string>, value: unknown];
751
+ type RuntimeGraphSharedPatch = {
752
+ readonly id: string;
753
+ readonly scope?: RuntimeSharedDefinition['scope'];
754
+ readonly version: number;
755
+ readonly patch: ReadonlyArray<RuntimeGraphSharedPatchOperation>;
756
+ };
757
+ type RuntimeGraphUpdate = {
758
+ readonly graphNodeId: string;
759
+ readonly path?: ReadonlyArray<string>;
760
+ readonly update: (value: unknown) => unknown;
761
+ readonly returnValue?: 'previous' | 'next';
762
+ };
763
+ type RuntimeGraphCall = {
764
+ readonly graphNodeId: string;
765
+ readonly path?: ReadonlyArray<string>;
766
+ readonly method: string;
767
+ readonly args?: ReadonlyArray<unknown>;
768
+ };
769
+ type RuntimeGraphDelete = {
770
+ readonly graphNodeId: string;
771
+ readonly path: ReadonlyArray<string>;
772
+ };
773
+ /** DOM work a subscription holds back until its whole pass has run, so it lands in one task with that pass's journal. */
774
+ type RuntimeGraphCommit = () => void | Promise<void>;
775
+ type RuntimeGraphSubscription = {
776
+ readonly id: string;
777
+ readonly graphNodeId: string;
778
+ readonly path?: ReadonlyArray<string>;
779
+ readonly run: (value: unknown) => DomJournalResult | RuntimeGraphCommit | void | Promise<DomJournalResult | RuntimeGraphCommit | void>;
780
+ };
781
+ /**
782
+ * Told about a write the moment it lands, before the flush that write schedules.
783
+ *
784
+ * The flush is a microtask behind the statement that wrote, so a handler reading
785
+ * back what its own write produced - a keyed repeat's rows most of all - reads
786
+ * the pre-write answer. An observer runs synchronously inside the write instead,
787
+ * so the next statement of the same handler sees the result.
788
+ *
789
+ * It runs for a write to `graphNodeId` under an intersecting path, and for a
790
+ * write to anything `graphNodeId` derives from, so a computed-backed collection
791
+ * is reached through the state write behind it. It never runs during a flush -
792
+ * the flush's own subscription pass is the single answer there - and never
793
+ * re-enters: a write made from inside an observer notifies nobody.
794
+ *
795
+ * `run` is handed no value and answers with none: it is a place to react, not a
796
+ * second subscription channel, and reads whatever it needs off the graph. The
797
+ * graph does not catch what it throws.
798
+ */
799
+ type RuntimeGraphWriteObserver = {
800
+ readonly graphNodeId: string;
801
+ readonly path?: ReadonlyArray<string>;
802
+ /**
803
+ * Work ALREADY in flight that this observer needs settled before it can
804
+ * answer a write synchronously - a demand-loaded module, above all. It starts
805
+ * nothing, so a caller awaiting it adds no fetch to the gesture; it only
806
+ * stops the gesture racing a load its own wiring began. `undefined` is
807
+ * nothing to wait for, and costs no microtask.
808
+ */
809
+ readonly settle?: () => Promise<void> | undefined;
810
+ readonly run: () => void;
811
+ };
812
+ type RuntimeGraph = {
813
+ readonly read: (graphNodeId: string, path?: ReadonlyArray<string>) => unknown;
814
+ /** Available only in debug-enabled builds (`__MARKLESS_DEBUG_ENABLED__`). */
815
+ readonly peekAsyncSnapshot?: (graphNodeId: string) => RuntimeGraphAsyncSnapshot | undefined;
816
+ readonly readShared: (definitionId: string, propertyName: string, path?: ReadonlyArray<string>) => unknown;
817
+ readonly writeShared: (write: RuntimeGraphSharedWrite) => boolean;
818
+ readonly getSharedDefinition: (definitionId: string) => NonNullable<ProtocolStatePayload['sharedDefinitions']>[number] | undefined;
819
+ readonly listSharedDefinitions: () => NonNullable<ProtocolStatePayload['sharedDefinitions']>;
820
+ readonly takeSharedPatches: () => RuntimeGraphSharedPatch[];
821
+ readonly applySharedPatch: (patch: RuntimeGraphSharedPatch) => boolean;
822
+ readonly write: (write: RuntimeGraphWrite) => void;
823
+ readonly update: (update: RuntimeGraphUpdate) => unknown;
824
+ readonly call: (call: RuntimeGraphCall) => unknown;
825
+ readonly delete: (deletion: RuntimeGraphDelete) => boolean;
826
+ readonly subscribe: (subscription: RuntimeGraphSubscription) => () => void;
827
+ /**
828
+ * Optional so a facade over a subset of this contract stays a `RuntimeGraph`;
829
+ * a caller without it gets the flush-time answer it always had.
830
+ */
831
+ readonly subscribeWrite?: (observer: RuntimeGraphWriteObserver) => () => void;
832
+ /**
833
+ * Settles what the write observers are already loading, so a write made after
834
+ * it is answered synchronously. `undefined` when nothing is in flight.
835
+ */
836
+ readonly settleWriteObservers?: () => Promise<void> | undefined;
837
+ /** Whether a write is waiting on a flush that has not yet reached the journal. */
838
+ readonly hasPendingFlush?: () => boolean;
839
+ /** Keeps the scheduled flush back until each returned release has run once; `flush()` itself still runs. */
840
+ readonly holdFlush?: () => () => void;
841
+ readonly subscribeJournal: (listener: DomJournalListener) => () => void;
842
+ readonly flush: () => Promise<void>;
843
+ readonly takeJournal: () => DomJournalEntry[];
844
+ };
845
+ type RuntimeSharedDefinition = NonNullable<ProtocolStatePayload['sharedDefinitions']>[number];
846
+ //#endregion
847
+ //#region ../web/src/resume-types.d.ts
848
+ type ResumeDomNode = {
849
+ readonly nodeType: number;
850
+ readonly childNodes?: ReadonlyArray<ResumeDomNode>;
851
+ };
852
+ type ResumeElementHandleValue = ResumeDomElement | ReadonlyArray<ResumeDomElement> | undefined;
853
+ type ResumeDomElement = ResumeDomNode & {
854
+ readonly nodeType: 1;
855
+ readonly tagName: string;
856
+ readonly id?: string;
857
+ readonly childNodes?: ReadonlyArray<ResumeDomNode>;
858
+ readonly parentElement?: ResumeDomElement | null;
859
+ readonly contains?: (node: ResumeDomElement) => boolean;
860
+ readonly addEventListener?: (type: string, listener: (event: ResumeDomEvent) => void | Promise<void>, options?: {
861
+ readonly capture?: boolean;
862
+ }) => void;
863
+ readonly removeEventListener?: (type: string, listener: (event: ResumeDomEvent) => void | Promise<void>, options?: {
864
+ readonly capture?: boolean;
865
+ }) => void;
866
+ readonly dispatchEvent?: (event: ResumeSharedPatchEvent) => boolean;
867
+ readonly setAttribute?: (name: string, value: string) => void;
868
+ readonly removeAttribute?: (name: string) => void;
869
+ __marklessDelegatedDispatch?: boolean;
870
+ __marklessListen?: (eventType: string) => void;
871
+ __marklessDispatch?: (input: {
872
+ readonly root: ResumeDomElement;
873
+ readonly event: ResumeDomEvent;
874
+ readonly element?: ResumeDomElement | null;
875
+ readonly eventRecord?: ResumeEventRecord | null;
876
+ readonly syncPolicyAlreadyApplied?: boolean;
877
+ }) => Promise<void>;
878
+ __marklessReleaseDispatch?: () => void;
879
+ __marklessEventOnlyGraph?: Map<string, unknown>;
880
+ __marklessCensus?: ResumeDomElement[];
881
+ __marklessBranchArms?: Map<string, ResumeBranchArmEntry>;
882
+ readonly ownerDocument?: ResumeDomOwnerDocument;
883
+ };
884
+ type ResumeDomOwnerDocument = {
885
+ readonly querySelector?: (selector: string) => ResumeDomHostElement | null;
886
+ readonly querySelectorAll?: (selector: string) => Iterable<ResumeDomHostElement>;
887
+ readonly createElement?: (tagName: string) => ResumeDomCreatedElement;
888
+ };
889
+ type ResumeDomHostElement = {
890
+ readonly getAttribute: (name: string) => string | null;
891
+ readonly textContent?: string | null;
892
+ readonly innerHTML?: string | null;
893
+ readonly text?: string | null;
894
+ };
895
+ type ResumeDomCreatedElement = {
896
+ innerHTML: string;
897
+ readonly content?: {
898
+ readonly childNodes?: ArrayLike<unknown>;
899
+ };
900
+ };
901
+ type ResumeDomComment = ResumeDomNode & {
902
+ readonly nodeType: 8;
903
+ readonly data?: string;
904
+ };
905
+ type ResumeBranchArmEntry = {
906
+ arm?: number;
907
+ start?: ResumeDomComment;
908
+ end?: ResumeDomComment;
909
+ readonly listeners: Set<() => void>;
910
+ };
911
+ type ResumeDomEvent = {
912
+ readonly type: string;
913
+ readonly target: ResumeDomElement | null;
914
+ readonly [key: string]: unknown;
915
+ readonly bubbles?: boolean;
916
+ readonly preventDefault?: () => void;
917
+ readonly stopPropagation?: () => void;
918
+ readonly composedPath?: () => ReadonlyArray<ResumeDomElement>;
919
+ __marklessPressHost?: ResumeDomElement;
920
+ };
921
+ type ResumeSharedPatchEvent = {
922
+ readonly type: 'async:shared-patch';
923
+ readonly detail: RuntimeGraphSharedPatch;
924
+ readonly bubbles: true;
925
+ readonly cancelable: false;
926
+ readonly composed: true;
927
+ };
928
+ type ResumeEventRecord = ProtocolViewPayload['events'][number];
929
+ type ResumeAsyncBoundaryRead = ProtocolViewPayload['asyncBoundaries'][number]['asyncReads'][number];
930
+ type ResumeAsyncBoundaryRecord = {
931
+ readonly id: string;
932
+ readonly runnerGraphNodeId: ProtocolViewPayload['asyncBoundaries'][number]['runnerGraphNodeId'];
933
+ readonly initiallyServedArm: ProtocolViewPayload['asyncBoundaries'][number]['initiallyServedArm'];
934
+ readonly updateSymbolId?: string;
935
+ readonly startAnchor: ResumeDomComment;
936
+ readonly endAnchor: ResumeDomComment;
937
+ readonly asyncReads: ProtocolViewPayload['asyncBoundaries'][number]['asyncReads'];
938
+ readonly armRecords?: ResumeArmRecordSet | ReadonlyArray<unknown>;
939
+ };
940
+ type ResumeBranchArmRecordSet = NonNullable<NonNullable<ProtocolViewPayload['branches']>[number]['armRecords']>[number];
941
+ type ResumeBranchRecord = {
942
+ readonly id: string;
943
+ readonly sourceId?: string;
944
+ readonly takenArm?: number;
945
+ readonly startAnchor: ResumeDomComment;
946
+ readonly endAnchor: ResumeDomComment;
947
+ readonly symbolId: string;
948
+ readonly testReads: NonNullable<NonNullable<ProtocolViewPayload['branches']>[number]['testReads']>;
949
+ readonly contentReads?: ResumeBranchRecord['testReads'];
950
+ readonly armTests?: ReadonlyArray<unknown>;
951
+ readonly declaredEmptyArms?: ReadonlyArray<number>;
952
+ readonly armRecords?: ReadonlyArray<ResumeBranchArmRecordSet>;
953
+ readonly escalates?: true;
954
+ readonly servedArmRecords?: ResumeArmRecordSet;
955
+ readonly composedInstancePath?: string;
956
+ readonly composedGraphProps?: NonNullable<NonNullable<ProtocolViewPayload['branches']>[number]['composedGraphProps']>;
957
+ readonly elementHandleIds?: NonNullable<NonNullable<ProtocolViewPayload['branches']>[number]['elementHandleIds']>;
958
+ readonly idrefSites?: NonNullable<NonNullable<ProtocolViewPayload['branches']>[number]['idrefSites']>;
959
+ };
960
+ type ResumeBranchHtml = string | ReadonlyArray<string | {
961
+ readonly text: string;
962
+ }>;
963
+ type ResumeBranchUpdate = {
964
+ readonly arm: number;
965
+ readonly html: ResumeBranchHtml;
966
+ readonly resolved?: boolean;
967
+ readonly armRecords?: ResumeArmRecordSet;
968
+ readonly computed?: ProtocolStatePayload['computed'];
969
+ readonly cells?: ReadonlyArray<{
970
+ readonly graphNodeId: string;
971
+ readonly value: unknown;
972
+ }>;
973
+ };
974
+ type ResumeArmLocator = {
975
+ readonly hostNodeId: string;
976
+ readonly index: number;
977
+ readonly tagName: string;
978
+ };
979
+ type ResumeArmBranchRecord = {
980
+ readonly id: string;
981
+ readonly sourceId?: string;
982
+ readonly testReads: NonNullable<NonNullable<ProtocolViewPayload['branches']>[number]['testReads']>;
983
+ readonly contentReads?: NonNullable<ProtocolViewPayload['branches']>[number]['contentReads'];
984
+ readonly takenArm?: number;
985
+ readonly symbolId?: string;
986
+ readonly armTests?: ReadonlyArray<unknown>;
987
+ readonly declaredEmptyArms?: ReadonlyArray<number>;
988
+ readonly startAnchor?: {
989
+ readonly strategy: 'arm-branch-comment' | 'dom-order-comment';
990
+ readonly index: number;
991
+ } | ResumeDomComment;
992
+ readonly endAnchor?: {
993
+ readonly strategy: 'arm-branch-comment' | 'dom-order-comment';
994
+ readonly index: number;
995
+ } | ResumeDomComment;
996
+ readonly armRecords?: ReadonlyArray<ResumeBranchArmRecordSet>;
997
+ readonly armBoundaryId?: string;
998
+ readonly composedInstancePath?: ResumeBranchRecord['composedInstancePath'];
999
+ readonly composedGraphProps?: ResumeBranchRecord['composedGraphProps'];
1000
+ };
1001
+ type ResumeArmRecordSet = {
1002
+ readonly locators: ReadonlyArray<ResumeArmLocator>;
1003
+ readonly events: ProtocolViewPayload['events'];
1004
+ readonly domUpdates?: ProtocolViewPayload['domUpdates'];
1005
+ readonly behaviors: ProtocolViewPayload['behaviors'];
1006
+ readonly elementHandles: ProtocolViewPayload['elementHandles'];
1007
+ readonly keyedRepeats?: NonNullable<ProtocolViewPayload['keyedRepeats']>;
1008
+ readonly branches?: ReadonlyArray<ResumeArmBranchRecord>;
1009
+ };
1010
+ type ResumeSymbolContext = {
1011
+ readonly graph?: RuntimeGraph;
1012
+ readonly read?: RuntimeGraph['read'];
1013
+ readonly key?: unknown;
1014
+ readonly signal?: AbortSignal;
1015
+ readonly event?: ResumeDomEvent;
1016
+ readonly element: ResumeDomElement;
1017
+ readonly getElementHandle: (handleIdOrName: string) => ResumeElementHandleValue;
1018
+ /** Where the part this symbol derives for stands in its family's roster. */
1019
+ readonly rosterPosition?: (rosterGraphNodeId: string, handleGraphNodeId: string) => number;
1020
+ /** How many parts this symbol's family instance has in that roster. */
1021
+ readonly rosterCount?: (rosterGraphNodeId: string) => number;
1022
+ readonly locals?: Readonly<Record<string, unknown>>;
1023
+ readonly arm?: number;
1024
+ readonly branchId?: string;
1025
+ readonly composedBranchId?: string;
1026
+ readonly behaviorInputs?: ReadonlyArray<unknown>;
1027
+ readonly domUpdate?: ProtocolViewPayload['domUpdates'][number];
1028
+ readonly value?: unknown;
1029
+ readonly asyncBoundary?: ResumeAsyncBoundaryRecord;
1030
+ readonly asyncRead?: ResumeAsyncBoundaryRead;
1031
+ readonly status?: 'fulfilled' | 'rejected';
1032
+ readonly args?: ReadonlyArray<unknown>;
1033
+ readonly invokeCallback?: (symbolId: string, args: ReadonlyArray<unknown>) => Promise<unknown>;
1034
+ readonly invokeSymbol?: (symbolId: string, context: ResumeSymbolContext) => Promise<unknown>;
1035
+ readonly releaseQueue?: () => void;
1036
+ };
1037
+ type ResumeBehaviorCleanup = () => void;
1038
+ type ResumeSymbol = (context: ResumeSymbolContext) => void | DomJournalResult | ResumeBehaviorCleanup | ResumeBranchUpdate | Promise<void | DomJournalResult | ResumeBehaviorCleanup | ResumeBranchUpdate>;
1039
+ //#endregion
1040
+ //#region src/vite/runtime/mdx-scalar.d.ts
1041
+ type MdxScalarAction = Pick<RuntimeDemandMapAction, 'hostNodeId' | 'eventName'> & {
1042
+ readonly scope: string;
1043
+ readonly plan: RuntimeDemandMapActionPlan;
1044
+ };
1045
+ type MdxScalarRoot = Element & {
1046
+ __marklessEventOnlyGraph?: Map<string, unknown>;
1047
+ __asyncResumeRuntimeStarted?: boolean;
1048
+ };
1049
+ type MdxScalarInput = {
1050
+ readonly root: MdxScalarRoot;
1051
+ readonly event: Event | 0;
1052
+ readonly element?: Element | null;
1053
+ readonly eventRecord?: ResumeEventRecord | null;
1054
+ readonly syncPolicyAlreadyApplied?: boolean;
1055
+ readonly propagationStopped?: boolean;
1056
+ };
1057
+ export declare function tryResumeMdxScalar(input: MdxScalarInput, loadPlan: (symbolId: string) => MdxScalarAction | undefined | Promise<MdxScalarAction | undefined>, loadSymbol: (symbolId: string) => ResumeSymbol | Promise<ResumeSymbol>): Promise<boolean>;
1058
+ //#endregion
1
1059
  //#region src/vite/runtime/mdx-route.d.ts
2
- type MdxRoutePart = {
1060
+ export type MdxRoutePart = {
3
1061
  readonly kind: 'html';
4
1062
  readonly elementCount: number;
1063
+ readonly commentCount?: number;
5
1064
  readonly html?: string;
6
1065
  readonly elementTags?: ReadonlyArray<string>;
7
1066
  } | {
8
1067
  readonly kind: 'component';
9
1068
  readonly componentIndex: number;
10
1069
  };
11
- type MdxRenderOutput = {
1070
+ export type MdxRenderOutput = {
12
1071
  readonly html?: string;
13
1072
  readonly root?: ChildNode;
14
1073
  readonly state?: MdxStatePayload;
15
1074
  readonly view?: MdxViewPayload;
1075
+ readonly elementCount?: number;
16
1076
  readonly loadSymbol?: (symbolId: string) => unknown;
17
1077
  };
18
- type MdxChild = {
1078
+ export type MdxChild = {
19
1079
  readonly componentIndex: number;
20
1080
  readonly hostPrefix: string;
21
1081
  readonly symbolPrefix: string;
1082
+ readonly childrenElementTags?: ReadonlyArray<string>;
22
1083
  readonly output?: MdxRenderOutput;
23
1084
  };
24
- type MdxComponentArtifact = {
25
- readonly renderSsr?: (props?: unknown) => MdxRenderOutput | Promise<MdxRenderOutput>;
1085
+ export type MdxComponentArtifact = {
1086
+ readonly renderSsr?: (props?: unknown, renderContext?: unknown) => MdxRenderOutput | Promise<MdxRenderOutput>;
26
1087
  readonly renderCsr?: (props?: unknown) => MdxRenderOutput | Promise<MdxRenderOutput>;
1088
+ readonly headInjections?: ReadonlyArray<unknown>;
27
1089
  };
28
- type MdxSymbolLoader = {
1090
+ export type MdxSymbolLoader = {
29
1091
  readonly prefix: string;
30
1092
  readonly loadSymbol: (symbolId: string) => unknown;
31
1093
  };
@@ -42,9 +1104,35 @@ type MdxRenderDataChild = {
42
1104
  readonly props: Readonly<Record<string, unknown>>;
43
1105
  readonly surface: MdxRenderDataSurface;
44
1106
  };
45
- declare function createMdxRenderDataSurface(parts: ReadonlyArray<MdxRoutePart>, children: ReadonlyArray<MdxRenderDataChild>): MdxRenderDataSurface;
1107
+ export declare function createMdxRenderDataSurface(parts: ReadonlyArray<MdxRoutePart>, children: ReadonlyArray<MdxRenderDataChild>): MdxRenderDataSurface;
1108
+ type MdxGraphRead = {
1109
+ readonly graphNodeId: string;
1110
+ readonly [key: string]: unknown;
1111
+ };
1112
+ type MdxCellRecord = {
1113
+ readonly graphNodeId?: string;
1114
+ readonly [key: string]: unknown;
1115
+ };
46
1116
  type MdxComputedRecord = {
1117
+ readonly graphNodeId?: string;
47
1118
  readonly deriveSymbolId?: string;
1119
+ readonly dependencies?: readonly MdxGraphRead[];
1120
+ readonly [key: string]: unknown;
1121
+ };
1122
+ type MdxSharedSeedRecord = {
1123
+ readonly graphNodeId: string;
1124
+ readonly deriveSymbolId: string;
1125
+ readonly dependencies?: readonly (MdxGraphRead & {
1126
+ readonly reads?: MdxGraphRead;
1127
+ })[];
1128
+ readonly [key: string]: unknown;
1129
+ };
1130
+ type MdxSharedDefinitionRecord = {
1131
+ readonly id: string;
1132
+ readonly scope?: string;
1133
+ readonly graphNodeIds?: readonly string[];
1134
+ readonly projectionIds?: readonly string[];
1135
+ readonly returnProperties?: readonly MdxCellRecord[];
48
1136
  readonly [key: string]: unknown;
49
1137
  };
50
1138
  type MdxStorageRecord = {
@@ -53,9 +1141,10 @@ type MdxStorageRecord = {
53
1141
  };
54
1142
  type MdxStatePayload = {
55
1143
  readonly version: unknown;
56
- readonly cells?: readonly unknown[];
1144
+ readonly cells?: readonly MdxCellRecord[];
57
1145
  readonly computed?: readonly MdxComputedRecord[];
58
- readonly sharedDefinitions?: readonly unknown[];
1146
+ readonly sharedSeeds?: readonly MdxSharedSeedRecord[];
1147
+ readonly sharedDefinitions?: readonly MdxSharedDefinitionRecord[];
59
1148
  readonly storage?: readonly MdxStorageRecord[];
60
1149
  };
61
1150
  type MdxLocator = {
@@ -71,20 +1160,30 @@ type MdxEventRecord = {
71
1160
  type MdxSymbolRecord = {
72
1161
  readonly hostNodeId: string;
73
1162
  readonly symbolId?: string;
1163
+ readonly graphNodeId?: string;
1164
+ readonly inputGraphReads?: readonly MdxGraphRead[];
1165
+ readonly [key: string]: unknown;
1166
+ };
1167
+ type MdxHandleRecord = {
1168
+ readonly hostNodeId: string;
1169
+ readonly handleId: string;
74
1170
  readonly [key: string]: unknown;
75
1171
  };
1172
+ type MdxFamilyRecord = Readonly<Record<string, unknown>>;
76
1173
  type MdxViewPayload = {
77
1174
  readonly version: unknown;
78
1175
  readonly locators?: readonly MdxLocator[];
79
1176
  readonly events?: readonly MdxEventRecord[];
80
1177
  readonly domUpdates?: readonly MdxSymbolRecord[];
81
1178
  readonly behaviors?: readonly MdxSymbolRecord[];
82
- readonly elementHandles?: readonly MdxSymbolRecord[];
83
- readonly asyncBoundaries?: readonly unknown[];
1179
+ readonly elementHandles?: readonly MdxHandleRecord[];
1180
+ readonly keyedRepeats?: readonly MdxFamilyRecord[];
1181
+ readonly branches?: readonly MdxFamilyRecord[];
1182
+ readonly asyncBoundaries?: readonly MdxFamilyRecord[];
1183
+ readonly asyncRunners?: Readonly<Record<string, string>>;
84
1184
  };
85
- declare function renderMdxChild(children: MdxChild[], component: MdxComponentArtifact, props: unknown, child: Omit<MdxChild, 'output'>): Promise<string>;
86
- declare function composeMdxState(children: readonly MdxChild[]): MdxStatePayload | undefined;
87
- declare function composeMdxView(parts: readonly MdxRoutePart[], children: readonly MdxChild[], initialElementOffset: number): MdxViewPayload | undefined;
88
- declare function loadMdxSymbol(symbolId: string, children: readonly MdxChild[], loaders: readonly MdxSymbolLoader[]): unknown;
89
- //#endregion
90
- export { MdxChild, MdxComponentArtifact, MdxRenderOutput, MdxRoutePart, MdxSymbolLoader, composeMdxState, composeMdxView, createMdxRenderDataSurface, loadMdxSymbol, renderMdxChild };
1185
+ export declare function renderMdxChild(children: MdxChild[], component: MdxComponentArtifact, props: unknown, child: Omit<MdxChild, 'output'>, pageRenderContext?: unknown): Promise<string>;
1186
+ export declare function composeMdxState(children: readonly MdxChild[]): MdxStatePayload | undefined;
1187
+ export declare function composeMdxView(parts: readonly MdxRoutePart[], children: readonly MdxChild[], initialElementOffset: number, initialCommentOffset?: number): MdxViewPayload | undefined;
1188
+ export declare function loadMdxSymbol(symbolId: string, children: readonly MdxChild[], loaders: readonly MdxSymbolLoader[]): unknown;
1189
+ //#endregion