@solidjs/signals 2.0.0-rc.2 → 2.0.0-rc.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/dist/dev-shared.js +6505 -0
  2. package/dist/dev.attribution.js +3484 -0
  3. package/dist/dev.js +10227 -9508
  4. package/dist/observe/affects-marks.js +86 -0
  5. package/dist/observe/affects.js +112 -0
  6. package/dist/observe/attribution.js +7 -0
  7. package/dist/observe/boundaries.js +696 -0
  8. package/dist/observe/core/action.js +182 -0
  9. package/dist/observe/core/async.js +824 -0
  10. package/dist/observe/core/attribution-costs.js +66 -0
  11. package/dist/observe/core/attribution-feedback.js +280 -0
  12. package/dist/observe/core/attribution-hooks.js +83 -0
  13. package/dist/observe/core/attribution-queries.js +43 -0
  14. package/dist/observe/core/attribution.js +3079 -0
  15. package/dist/observe/core/constants.js +269 -0
  16. package/dist/observe/core/context.js +63 -0
  17. package/dist/observe/core/copies.js +10 -0
  18. package/dist/observe/core/core.js +1707 -0
  19. package/dist/observe/core/dev.js +394 -0
  20. package/dist/observe/core/effect.js +193 -0
  21. package/dist/observe/core/error-hooks.js +71 -0
  22. package/dist/observe/core/error.js +82 -0
  23. package/dist/observe/core/external.js +97 -0
  24. package/dist/observe/core/graph.js +162 -0
  25. package/dist/observe/core/heap.js +124 -0
  26. package/dist/observe/core/identities.js +62 -0
  27. package/dist/observe/core/invariants.js +12 -0
  28. package/dist/observe/core/lanes.js +972 -0
  29. package/dist/observe/core/owner.js +371 -0
  30. package/dist/observe/core/scheduler.js +1157 -0
  31. package/dist/observe/core/truth.js +47 -0
  32. package/dist/observe/core/verdict.js +470 -0
  33. package/dist/observe/deferred.js +186 -0
  34. package/dist/observe/flatten.js +79 -0
  35. package/dist/observe/from.js +248 -0
  36. package/dist/observe/index.js +71 -0
  37. package/dist/observe/map.js +593 -0
  38. package/dist/observe/reveal.js +212 -0
  39. package/dist/observe/signals.js +717 -0
  40. package/dist/observe/store/affects.js +142 -0
  41. package/dist/observe/store/edges.js +39 -0
  42. package/dist/observe/store/hooks.js +16 -0
  43. package/dist/observe/store/index.js +47 -0
  44. package/dist/observe/store/optimistic.js +713 -0
  45. package/dist/observe/store/projection.js +345 -0
  46. package/dist/observe/store/reconcile.js +281 -0
  47. package/dist/observe/store/store.js +2127 -0
  48. package/dist/observe/store/storePath.js +103 -0
  49. package/dist/observe/store/target.js +46 -0
  50. package/dist/observe/store/types.js +83 -0
  51. package/dist/observe/store/utils.js +1063 -0
  52. package/dist/prod/affects-marks.js +86 -0
  53. package/dist/prod/affects.js +98 -112
  54. package/dist/prod/attribution.js +45 -0
  55. package/dist/prod/boundaries.js +578 -468
  56. package/dist/prod/core/action.js +92 -59
  57. package/dist/prod/core/async.js +522 -336
  58. package/dist/prod/core/attribution-hooks.js +3 -0
  59. package/dist/prod/core/constants.js +168 -44
  60. package/dist/prod/core/context.js +12 -16
  61. package/dist/prod/core/copies.js +10 -0
  62. package/dist/prod/core/core.js +1345 -627
  63. package/dist/prod/core/dev.js +123 -1
  64. package/dist/prod/core/effect.js +113 -80
  65. package/dist/prod/core/error-hooks.js +71 -0
  66. package/dist/prod/core/error.js +18 -4
  67. package/dist/prod/core/external.js +6 -7
  68. package/dist/prod/core/graph.js +119 -72
  69. package/dist/prod/core/heap.js +85 -109
  70. package/dist/prod/core/identities.js +62 -0
  71. package/dist/prod/core/invariants.js +1 -32
  72. package/dist/prod/core/lanes.js +931 -132
  73. package/dist/prod/core/owner.js +192 -129
  74. package/dist/prod/core/scheduler.js +948 -642
  75. package/dist/prod/core/truth.js +47 -0
  76. package/dist/prod/core/verdict.js +409 -420
  77. package/dist/prod/deferred.js +184 -0
  78. package/dist/prod/flatten.js +77 -0
  79. package/dist/prod/from.js +248 -0
  80. package/dist/prod/index.js +40 -16
  81. package/dist/prod/map.js +481 -211
  82. package/dist/prod/reveal.js +212 -0
  83. package/dist/prod/signals.js +401 -84
  84. package/dist/prod/store/affects.js +142 -0
  85. package/dist/prod/store/edges.js +39 -0
  86. package/dist/prod/store/hooks.js +16 -0
  87. package/dist/prod/store/index.js +27 -18
  88. package/dist/prod/store/optimistic.js +707 -0
  89. package/dist/prod/store/projection.js +331 -0
  90. package/dist/prod/store/reconcile.js +281 -0
  91. package/dist/prod/store/store.js +1952 -267
  92. package/dist/prod/store/storePath.js +1 -1
  93. package/dist/prod/store/target.js +43 -0
  94. package/dist/prod/store/types.js +83 -0
  95. package/dist/prod/store/utils.js +997 -138
  96. package/dist/types/affects-marks.d.ts +14 -0
  97. package/dist/types/affects.d.ts +12 -30
  98. package/dist/types/attribution.d.ts +19 -0
  99. package/dist/types/attribution.prod.d.ts +22 -0
  100. package/dist/types/boundaries.d.ts +99 -124
  101. package/dist/types/carved.d.ts +1 -0
  102. package/dist/types/core/action.d.ts +23 -9
  103. package/dist/types/core/async.d.ts +34 -6
  104. package/dist/types/core/attribution-costs.d.ts +35 -0
  105. package/dist/types/core/attribution-feedback.d.ts +133 -0
  106. package/dist/types/core/attribution-hooks.d.ts +307 -8
  107. package/dist/types/core/attribution-queries.d.ts +24 -0
  108. package/dist/types/core/attribution.d.ts +802 -72
  109. package/dist/types/core/constants.d.ts +195 -38
  110. package/dist/types/core/copies.d.ts +54 -0
  111. package/dist/types/core/core.d.ts +295 -65
  112. package/dist/types/core/dev.d.ts +509 -22
  113. package/dist/types/core/effect.d.ts +1 -1
  114. package/dist/types/core/error-hooks.d.ts +71 -0
  115. package/dist/types/core/error.d.ts +18 -1
  116. package/dist/types/core/graph.d.ts +40 -1
  117. package/dist/types/core/heap.d.ts +5 -5
  118. package/dist/types/core/identities.d.ts +17 -0
  119. package/dist/types/core/index.d.ts +11 -7
  120. package/dist/types/core/invariants.d.ts +1 -26
  121. package/dist/types/core/lanes.d.ts +74 -43
  122. package/dist/types/core/owner.d.ts +27 -9
  123. package/dist/types/core/scheduler.d.ts +353 -102
  124. package/dist/types/core/truth.d.ts +18 -0
  125. package/dist/types/core/types.d.ts +97 -71
  126. package/dist/types/core/verdict.d.ts +35 -0
  127. package/dist/types/deferred.d.ts +28 -0
  128. package/dist/types/flatten.d.ts +8 -0
  129. package/dist/types/from.d.ts +47 -0
  130. package/dist/types/index.d.ts +33 -7
  131. package/dist/types/map.d.ts +4 -2
  132. package/dist/types/reveal.d.ts +19 -0
  133. package/dist/types/signals.d.ts +196 -45
  134. package/dist/types/store/affects.d.ts +12 -0
  135. package/dist/types/store/edges.d.ts +9 -0
  136. package/dist/types/store/hooks.d.ts +62 -0
  137. package/dist/types/store/index.d.ts +42 -15
  138. package/dist/types/store/optimistic.d.ts +24 -45
  139. package/dist/types/store/projection.d.ts +17 -68
  140. package/dist/types/store/reconcile.d.ts +3 -46
  141. package/dist/types/store/store.d.ts +133 -136
  142. package/dist/types/store/storePath.d.ts +1 -1
  143. package/dist/types/store/target.d.ts +166 -0
  144. package/dist/types/store/types.d.ts +105 -0
  145. package/dist/types/store/utils.d.ts +188 -0
  146. package/package.json +31 -26
  147. package/dist/node.cjs +0 -8745
  148. package/dist/prod/core/optimistic.js +0 -265
  149. package/dist/prod/store/next/optimistic.js +0 -385
  150. package/dist/prod/store/next/projection.js +0 -172
  151. package/dist/prod/store/next/reconcile.js +0 -331
  152. package/dist/prod/store/next/store.js +0 -1499
  153. package/dist/prod/store/next/target.js +0 -20
  154. package/dist/types/core/optimistic.d.ts +0 -6
  155. package/dist/types/store/next/optimistic.d.ts +0 -20
  156. package/dist/types/store/next/projection.d.ts +0 -8
  157. package/dist/types/store/next/reconcile.d.ts +0 -3
  158. package/dist/types/store/next/store.d.ts +0 -77
  159. package/dist/types/store/next/target.d.ts +0 -117
  160. package/dist/types-cjs/affects.d.cts +0 -47
  161. package/dist/types-cjs/boundaries.d.cts +0 -175
  162. package/dist/types-cjs/core/action.d.cts +0 -64
  163. package/dist/types-cjs/core/async.d.cts +0 -21
  164. package/dist/types-cjs/core/attribution-hooks.d.cts +0 -52
  165. package/dist/types-cjs/core/attribution.d.cts +0 -186
  166. package/dist/types-cjs/core/constants.d.cts +0 -97
  167. package/dist/types-cjs/core/context.d.cts +0 -36
  168. package/dist/types-cjs/core/core.d.cts +0 -163
  169. package/dist/types-cjs/core/dev.d.cts +0 -81
  170. package/dist/types-cjs/core/effect.d.cts +0 -30
  171. package/dist/types-cjs/core/error.d.cts +0 -47
  172. package/dist/types-cjs/core/external.d.cts +0 -15
  173. package/dist/types-cjs/core/graph.d.cts +0 -6
  174. package/dist/types-cjs/core/heap.d.cts +0 -22
  175. package/dist/types-cjs/core/index.d.cts +0 -13
  176. package/dist/types-cjs/core/invariants.d.cts +0 -59
  177. package/dist/types-cjs/core/lanes.d.cts +0 -44
  178. package/dist/types-cjs/core/optimistic.d.cts +0 -6
  179. package/dist/types-cjs/core/owner.d.cts +0 -124
  180. package/dist/types-cjs/core/scheduler.d.cts +0 -180
  181. package/dist/types-cjs/core/types.d.cts +0 -192
  182. package/dist/types-cjs/core/verdict.d.cts +0 -2
  183. package/dist/types-cjs/index.d.cts +0 -10
  184. package/dist/types-cjs/map.d.cts +0 -69
  185. package/dist/types-cjs/package.json +0 -3
  186. package/dist/types-cjs/signals.d.cts +0 -624
  187. package/dist/types-cjs/store/index.d.cts +0 -19
  188. package/dist/types-cjs/store/next/optimistic.d.cts +0 -20
  189. package/dist/types-cjs/store/next/projection.d.cts +0 -8
  190. package/dist/types-cjs/store/next/reconcile.d.cts +0 -3
  191. package/dist/types-cjs/store/next/store.d.cts +0 -77
  192. package/dist/types-cjs/store/next/target.d.cts +0 -117
  193. package/dist/types-cjs/store/optimistic.d.cts +0 -45
  194. package/dist/types-cjs/store/projection.d.cts +0 -70
  195. package/dist/types-cjs/store/reconcile.d.cts +0 -46
  196. package/dist/types-cjs/store/store.d.cts +0 -138
  197. package/dist/types-cjs/store/storePath.d.cts +0 -58
  198. package/dist/types-cjs/store/utils.d.cts +0 -74
@@ -1,15 +1,208 @@
1
+ import { type DiagnosticSubject } from "./dev.js";
1
2
  import { type Heap } from "./heap.js";
2
- import { activeLanes, assignOrMergeLane, findLane, type OptimisticLane } from "./lanes.js";
3
- import type { Computed, Signal } from "./types.js";
4
- export { activeLanes, assignOrMergeLane, findLane };
5
- export { getOrCreateLane, hasActiveOverride, mergeLanes, resolveLane } from "./lanes.js";
3
+ import type { Computed, Owner, Signal } from "./types.js";
4
+ export declare let laneReadHook: ((c: Computed<any> | null, el: Signal<any> | Computed<any>) => unknown) | null;
5
+ export declare let laneStageHook: ((el: Computed<any>, l: Transaction, create: boolean, errored: boolean | Computed<any>) => boolean) | null;
6
+ export declare let laneOutcomeHook: ((el: Computed<any>, value: unknown, errored: boolean) => boolean) | null;
7
+ export declare let laneWriteHook: (<T>(el: Signal<T> | Computed<T>, v: T) => T) | null;
8
+ export declare let applyGuessesHook: ((parent: Transaction | null) => void) | null;
9
+ export declare let laneSeamsHook: ((t: Transaction | null) => void) | null;
10
+ export declare let laneCorrectionsHook: (() => boolean) | null;
11
+ export declare let endLanesHook: ((u: Transaction) => void) | null;
12
+ export declare let lanesBlockedHook: ((t: Transaction) => boolean) | null;
13
+ /** R5 (lanes.ts `laneSeams` parks a frame flight): the landing's re-derive
14
+ * of a reader adopts the flight instead (true: adopted, nothing to queue). */
15
+ export declare let laneAdoptHook: ((r: Computed<any>) => boolean) | null;
16
+ /** core.ts `frameRead` served lane work or a verdict reader a held node's
17
+ * committed value (lanes.ts `laneServed`). */
18
+ export declare let laneServedHook: ((c: Computed<any>, el: Signal<any> | Computed<any>) => void) | null;
19
+ /** A guess was written (lanes.ts `optimisticWrite`): the arms only a guess
20
+ * reaches (CONFIG_GUESS) — a build without `createOptimistic` or
21
+ * `createOptimisticStore` never sets it, and its bundler folds them. */
22
+ export declare let guessing: boolean;
23
+ export declare function armGuessing(): void;
24
+ export declare function installLaneHooks(read: NonNullable<typeof laneReadHook>, stage: NonNullable<typeof laneStageHook>, outcome: NonNullable<typeof laneOutcomeHook>, write: NonNullable<typeof laneWriteHook>, applyGuesses: NonNullable<typeof applyGuessesHook>, seams: NonNullable<typeof laneSeamsHook>, corrections: NonNullable<typeof laneCorrectionsHook>, end: NonNullable<typeof endLanesHook>, blocked: NonNullable<typeof lanesBlockedHook>, adopt: NonNullable<typeof laneAdoptHook>, served: NonNullable<typeof laneServedHook>): void;
25
+ export declare let catchHook: ((node: Computed<any>, flags: number, error: unknown) => unknown) | null;
26
+ export declare let freshHook: ((node: Computed<any>, held?: unknown) => unknown) | null;
27
+ export declare let hiddenHook: ((r: Computed<any>) => unknown) | null;
28
+ export declare let boundarySeamHook: (() => void) | null;
29
+ export declare let heldRunHook: ((node: Computed<any>) => boolean) | null;
30
+ export declare function installBoundaryHooks(caught: NonNullable<typeof catchHook>, fresh: NonNullable<typeof freshHook>, hidden: NonNullable<typeof hiddenHook>, seam: NonNullable<typeof boundarySeamHook>, heldRun: NonNullable<typeof heldRunHook>): void;
31
+ /** Store (store/store.ts): `park` — the flush parked into `t`: the store
32
+ * materializes and holds the container node of every staging that had none
33
+ * (a staging needs the node as its home only when something can read the
34
+ * frame through it; a hold can); `commit` — fold the pending backings whose
35
+ * container nodes this flush committed (the owned-raw model's one mutation
36
+ * point). */
37
+ export declare let storeParkHook: ((t: Transaction) => void) | null;
38
+ export declare let storeCommitHook: (() => void) | null;
39
+ export declare function installStoreHooks(park: NonNullable<typeof storeParkHook>, commit: NonNullable<typeof storeCommitHook>): void;
40
+ /** `affects()` marks (affects.ts): the releases at a landing and at the seam
41
+ * (ambient marks). */
42
+ export declare let releaseMarksHook: ((nodes: Signal<any>[]) => void) | null;
43
+ export declare let releaseAmbientMarksHook: ((parked: Transaction | null) => void) | null;
44
+ export declare function installMarkHooks(release: NonNullable<typeof releaseMarksHook>, releaseAmbient: NonNullable<typeof releaseAmbientMarksHook>): void;
45
+ /** Verdicts (verdict.ts). */
46
+ export declare let observeFlightHook: ((c: Computed<any>, el: Computed<any>) => boolean) | null;
47
+ /** D-25's hold work (verdict.ts `holdWork`): on `source` going pending,
48
+ * whether verdict reader `n` waits on it instead of re-deriving. */
49
+ export declare let holdWorkHook: ((n: Computed<any>, source: Computed<any>) => unknown) | null;
50
+ export declare function installVerdictHooks(observeFlight: NonNullable<typeof observeFlightHook>, holdWork: NonNullable<typeof holdWorkHook>): void;
51
+ /** External-source bridge (wired by enableExternalSource(); undefined while
52
+ * no config is active — including after _resetExternalSourceConfig()). */
53
+ export declare let wireExternalSourceHook: ((self: Computed<any>) => void) | undefined;
54
+ export declare let externalUntrackHook: (<T>(fn: () => T) => T) | undefined;
55
+ export declare function setExternalHooks(wire: typeof wireExternalSourceHook, untrack: typeof externalUntrackHook): void;
56
+ export interface Transaction {
57
+ /** Held staged nodes: committed at the landing. For a lane: its guesses
58
+ * and its work (their lane values in `_x._lane`), revealed at the seam. */
59
+ _nodes: Signal<any>[];
60
+ /** Stashed effect queues (render, user): run ahead of the landing flush's. */
61
+ _queues: [QueueCallback[], QueueCallback[]];
62
+ /** Render effects that read a held node as committed (A15's stale
63
+ * readers): re-derived after the landing. One entry per pass. */
64
+ _reruns: Computed<any>[];
65
+ /** Merged into another (overlap): resolve through it (`txOf`). */
66
+ _into: Transaction | null;
67
+ /** Lane: the transition it is a sub-frame of — it reads that world through
68
+ * and ends with it. */
69
+ _parent: Transaction | null;
70
+ /** A lane. Cleared when a blocked lane outlives its parent and continues
71
+ * as a transaction. */
72
+ _lane: boolean;
73
+ /** The lane the readers of this transaction's verdicts (`isPending`,
74
+ * `latest`) break out into — a guess the system supplies: "pending, until
75
+ * this lands", "the proposal is the value". Opened at the first such read,
76
+ * ends with the transaction. */
77
+ _verdict: Transaction | null;
78
+ /** Actions (action.ts) still running in it: held open — blocked — until
79
+ * every one has returned. Summed when transactions merge. */
80
+ _open: number;
81
+ /** An action ran in it (action.ts). Its body ending (`_open` back to 0)
82
+ * supersedes the guesses still in force whose own truth is not in flight
83
+ * (A18 body-end corollary, #3427; lanes.ts). */
84
+ _acted: boolean;
85
+ /** Lane: the lanes a frame derives from together with this one (a pass
86
+ * read two lanes' work — #3335): one reveal unit, each blocked while any
87
+ * is; shared array. Lifetimes stay their own (#2912). */
88
+ _links: Transaction[] | null;
89
+ /** Lane: it has revealed — its values are the screen (`display`,
90
+ * lanes.ts) and its passes stage for the next reveal. Set at the first
91
+ * seam it is not blocked; a verdict lane is born shown. */
92
+ _shown: boolean;
93
+ /** Lane: the last seam found it blocked (its own flight up). A frame
94
+ * leaf reading a held lane that has not shown is a stale reader of it
95
+ * (#3460); one reading a lane the seam has not judged yet is its work. */
96
+ _held: boolean;
97
+ /** Lane: a current truth that differs folded beneath one of its keyed
98
+ * guesses (lanes.ts `laneWrite`, D-34) — the store's reader of it: a
99
+ * deriving pass outside the lane, or `latest()` (`c` null), is served
100
+ * the hold's world from its guesses; NOT_PENDING otherwise
101
+ * (store/optimistic.ts `foldedRead`). Unset until then; not
102
+ * `_`-prefixed: a new mangled name shifts every later one
103
+ * (scripts/mangle-props.mjs), which costs the floors bytes for a path
104
+ * only optimistic stores reach. */
105
+ folded?: (c: Computed<any> | null, el: Signal<any> | Computed<any>) => unknown;
106
+ /** `affects()` marks declared in it (affects.ts): released at the landing.
107
+ * Not nodes — a mark holds nothing (`blocked` never sees one). */
108
+ _marks: Signal<any>[] | null;
109
+ }
110
+ /** A transaction (listed here) or a lane (lanes.ts lists its own). */
111
+ export declare function newTransaction(lane: boolean, parent?: Transaction | null): Transaction;
112
+ /** The lane the running pass is work of; set at `recompute`'s head from the
113
+ * node, moved by a derivation's lane read, saved and restored around the
114
+ * pass. */
115
+ export declare let passLane: Transaction | null;
116
+ export declare function setPassLane(l: Transaction | null): void;
117
+ /** The transaction this flush parks into: set by the first join, merged
118
+ * with every further one. Consumed at the seam. A join outside a flush (a
119
+ * mount's pending observer, a write to a held node, an action opening)
120
+ * schedules the seam that consumes it: membership is the tick's — the same
121
+ * synchronous frame — and the next tick's writes are not this one's. */
122
+ export declare let flushTransaction: Transaction | null;
123
+ /** The flush's transaction while only a `latest()` read of a staging opened
124
+ * it (verdict.ts `provisionalVerdict`): it holds nothing, and a verdict
125
+ * reader's plain read of a staging in it is the frame's read (D-22). */
126
+ export declare let latestOpened: Transaction | null;
127
+ export declare function openedByLatest(): void;
128
+ /** The transaction the passes running OUTSIDE a flush this tick derive from
129
+ * (a mainline mount, a mainline re-pass): the passes' own (A29, creation-
130
+ * time form — "the entry is the pass's alone"): their results are staged
131
+ * into it, and nothing else in the tick is — a write made after the mount
132
+ * is a mainline write, a render effect mounted beside it a stale reader.
133
+ * Inside a flush, or in a tick that already has its transaction (an
134
+ * action's body), the frame joins instead (`flushTransaction`) — except a
135
+ * first pass a loading boundary that has not shown content catches (`own`,
136
+ * A29's boundary exemption, #3540): it is the boundary's, not the tick's,
137
+ * and a flush that has joined nothing keeps it pass-scoped as outside one.
138
+ * Cleared by the flush the join schedules, and at the end of a flush that
139
+ * set it. */
140
+ export declare let passTx: Transaction | null;
141
+ export declare function joinPassTx(t: Transaction, own?: unknown): void;
142
+ /** The transaction holding a node (CONFIG_HELD set), resolved through
143
+ * merges; the path is compressed. */
144
+ export declare function txOf(n: Signal<any> | Computed<any>): Transaction;
145
+ /** `t` resolved through merges while it is still parked or open; null once
146
+ * it has landed. */
147
+ export declare function liveTx(t: Transaction): Transaction | null;
148
+ export declare function resolveTx(t: Transaction): Transaction;
149
+ /** The flush joins transaction `t` — or needs one of its own (`null`: a pass
150
+ * went pending with nothing held). Joining a second one merges it into the
151
+ * flush's: the work that touched both entangles them (A15). */
152
+ export declare function joinFuture(t: Transaction | null): void;
153
+ /** `t` merges into `f`: the work that touched both entangles them (A15).
154
+ * A lane never merges: it is a sub-frame, not a peer — its work is routed
155
+ * per pass (`passLane`). */
156
+ export declare function merge(t: Transaction, f: Transaction): void;
157
+ /** A15: a hold is a property of the async node — observed pending by a
158
+ * render reader. A transaction is blocked while a node it holds, in flight,
159
+ * has one: a pending render effect (the frame itself), or a pending held
160
+ * node a render effect reads. A stale reader served the committed value
161
+ * never went pending, but derives from the flight all the same (#3494) and
162
+ * is still linked to it; a memo between them is pending, and held, too — so
163
+ * one hop of `_subs` is the chain. Reads of the reader's LAST pass only (the
164
+ * link's generation is the pass's): a tail kept for A30 — the committed
165
+ * frame's dependency, awaiting the run that retires it — is not a read of
166
+ * the flight, and a reader that stopped reading releases it (O3, #3494).
167
+ * An errored pass (NotReady included) did not stop: it never got there, and
168
+ * its full list stands (A30) — the reads it did not reach still observe. A
169
+ * flight nobody renders holds nothing (A29). Only the nodes `t` still owns
170
+ * count: one a lane took over since is the lane's to wait on. A guess whose
171
+ * own truth is in flight blocks the lane's parent, not the lane — it stands
172
+ * in for the flight (A17: "visible until its own fetch settles"). */
173
+ export declare function blocked(t: Transaction): boolean;
174
+ /** Observe tier: the flights `t` waits on — its pending held sources a
175
+ * frame reader observes (`blockedBy`'s predicate, collected; the readers
176
+ * themselves are not sources). */
177
+ export declare function blockersOf(t: Transaction): Computed<any>[];
178
+ /** `t`'s own flights only — not its lanes': a flight the frame asked for
179
+ * (a refetch, a plain load) is authoritative; a lane's derivation flight is
180
+ * not (lanes.ts, the body-end corollary). A pending reader counts only if
181
+ * one of the sources it waits on is `t`'s (a render effect marked pending
182
+ * by a lane flight, never re-run, is the lane's wait, not the frame's). */
183
+ export declare function ownFlights(t: Transaction): boolean;
184
+ export declare function heldTrim(el: Computed<any>): void;
185
+ export declare function deferZombie(el: Computed<any>): void;
186
+ /** Put a staged node in a transaction: flagged, stamped, on its landing
187
+ * list. */
188
+ export declare function holdNode(n: Signal<any>, t: Transaction): void;
189
+ /** Put a node on a transaction's list, once: a node's `_transaction` is the
190
+ * transaction whose `_nodes` it is on (every site that sets one does the
191
+ * other), so a re-pass, a re-landing or a re-staging adds nothing. */
192
+ export declare function list(n: Signal<any>, t: Transaction): void;
193
+ /** The nodes under `owner` a transaction other than `t` holds (boundaries.ts:
194
+ * what an earlier hold staged under a re-armed boundary). */
195
+ export declare function heldUnder(owner: Owner, t: Transaction | null, fn: (n: Computed<any>) => void): void;
196
+ /** `n` leaves the hold it was staged in: its next pass publishes mainline. */
197
+ export declare function unhold(n: Signal<any>): void;
6
198
  export declare const dirtyQueue: Heap;
7
- export declare const zombieQueue: Heap;
8
199
  export declare let clock: number;
9
- export declare let activeTransition: Transition | null;
10
- export declare let projectionWriteActive: boolean;
11
200
  export declare let _hitUnhandledAsync: boolean;
12
- export declare function resetUnhandledAsync(): void;
201
+ /**
202
+ * Consume the unhandled-async hit. Returns whether this is the first report
203
+ * of the current enforcement window — the caller warns only then.
204
+ */
205
+ export declare function resetUnhandledAsync(): boolean;
13
206
  /**
14
207
  * Toggles the dev-mode "must be inside a `<Loading>` boundary" enforcement
15
208
  * window. Only `render()` calls this — wrapping the initial mount so that a
@@ -19,128 +212,184 @@ export declare function resetUnhandledAsync(): void;
19
212
  * @internal
20
213
  */
21
214
  export declare function enforceLoadingBoundary(enabled: boolean): void;
22
- export declare function setProjectionWriteActive(value: boolean): void;
23
215
  export declare function setTrackedQueueCallback(value: boolean): void;
24
- export declare function setEffectCallback(value: boolean): void;
216
+ /** Action bodies on the stack (action.ts): `flush()` is refused inside one —
217
+ * the body's writes are its transaction's and commit when it settles; a
218
+ * drain mid-step cannot reveal them, and dev says so. */
219
+ export declare let actionDepth: number;
220
+ export declare function enterAction(): void;
221
+ export declare function exitAction(): void;
222
+ /** Provenance (A18, #3331): the question being asked — an action's
223
+ * sequence while a slice of its body and the flush that carries it run, 0
224
+ * otherwise. A guess is stamped with it (lanes.ts; a mainline guess takes a
225
+ * fresh sequence: the newest intent), a flight with the question that
226
+ * started it (async.ts; mainline is always the current question). An
227
+ * answer from an older question than the guess it lands on is stale: held
228
+ * silently, it does not move the graph. */
229
+ export declare let question: number;
230
+ export declare function setQuestion(q: number): void;
231
+ export declare function nextQuestion(): number;
232
+ export declare const MAINLINE_QUESTION = 2147483647;
233
+ export declare let inEffectCallback: boolean;
234
+ /** Dev-only: matches no event, so a window or phase holding it applies
235
+ * whatever event is current (see `strictReadEvent`, core.ts). */
236
+ export declare const ANY_EVENT: {};
237
+ /** Dev-only: the DOM event current when the effect phase was entered. A
238
+ * handler dispatched synchronously from that phase (`el.focus()`) runs under
239
+ * a different event and is not in it (#4235). */
240
+ export declare let effectCallbackEvent: unknown;
241
+ export declare function setEffectCallback(value: boolean, event?: unknown): void;
25
242
  export type QueueCallback = (type: number) => void;
26
- type QueueStub = {
27
- _queues: [QueueCallback[], QueueCallback[]];
28
- _children: QueueStub[];
29
- };
30
- type OptimisticNode = Signal<any> | Computed<any>;
31
- export interface Transition {
32
- _time: number;
33
- _asyncReporters: Map<Computed<any>, Set<Computed<any>>>;
34
- _pendingNodes: Signal<any>[];
35
- _optimisticNodes: OptimisticNode[];
36
- _affectsNodes: OptimisticNode[];
37
- _optimisticStores: Set<any>;
38
- _actions: Array<Generator<any, any, any> | AsyncGenerator<any, any, any>>;
39
- _queueStash: QueueStub;
40
- _done: boolean | Transition;
41
- _gatedSubs: Set<Computed<any>>;
42
- }
43
243
  export declare function schedule(): void;
44
244
  /**
45
245
  * Permanently halts the reactive system. Called when a user error escapes
46
246
  * every boundary — app state is undefined at that point, so scheduling stops
47
247
  * entirely rather than limping along with a half-applied update.
48
248
  */
249
+ /**
250
+ * The key a root owner carries its client error hook under (`render`'s
251
+ * `onError`) — registered, so a runtime writes it with no import of the hook
252
+ * module (core/error-hooks.ts) and no property mangling in the way. Defined
253
+ * HERE, not there: a runtime that only writes the key must not retain the
254
+ * hook machinery (pay-for-use).
255
+ */
256
+ export declare const ROOT_ERROR_HOOK: unique symbol;
49
257
  export declare function haltReactivity(cause?: unknown): void;
258
+ /**
259
+ * Dev: `haltReactivity`, located at `subject` — the computation the uncaught
260
+ * error escaped from — for the REACTIVITY_HALTED message's owner path. Call
261
+ * sites pick it in dev builds only (`haltReactivity(e)` in production), so
262
+ * production keeps the one-argument halt and its bytes unchanged.
263
+ */
264
+ export declare function haltReactivityAt(cause: unknown, subject: DiagnosticSubject): void;
50
265
  /** @internal Test/dev-reload hook. Revives scheduling after a halt. */
51
266
  export declare function resetErrorHalt(): void;
52
267
  export interface IQueue {
53
268
  enqueue(type: number, fn: QueueCallback): void;
54
269
  run(type: number): boolean | void;
55
- addChild(child: IQueue): void;
56
- removeChild(child: IQueue): void;
57
- created: number;
58
270
  notify(node: Computed<any>, mask: number, flags: number, error?: any): boolean;
59
- stashQueues(stub: QueueStub): void;
60
- restoreQueues(stub: QueueStub): void;
61
- _parent: IQueue | null;
62
271
  }
63
- export declare class Queue implements IQueue {
64
- _parent: IQueue | null;
272
+ export declare class GlobalQueue implements IQueue {
65
273
  _queues: [QueueCallback[], QueueCallback[]];
66
- _children: IQueue[];
67
- _ranAt: number;
68
- created: number;
69
- addChild(child: IQueue): void;
70
- removeChild(child: IQueue): void;
71
- notify(node: Computed<any>, mask: number, flags: number, error?: any): boolean;
72
- run(type: number): void;
73
- enqueue(type: number, fn: QueueCallback): void;
74
- stashQueues(stub: QueueStub): void;
75
- restoreQueues(stub: QueueStub): void;
76
- }
77
- export declare class GlobalQueue extends Queue {
78
274
  _running: boolean;
79
- _batch: Transition;
80
275
  static _update: (el: Computed<unknown>) => void;
81
- static _dispose: (el: Computed<unknown>, self: boolean, zombie: boolean) => void;
276
+ static _dispose: (el: Computed<unknown>, self: boolean, zombie?: boolean) => void;
82
277
  static _runEffect: (el: Computed<unknown>) => void;
83
- static _clearOptimisticStores: ((stores: Set<any>, completing: Transition | null) => void) | null;
84
- static _releaseAffectsScope: ((node: OptimisticNode) => void) | null;
85
- static _releaseAffectsMarks: ((nodes: OptimisticNode[]) => void) | null;
86
- static _markAffects: ((node: OptimisticNode) => void) | null;
87
- static _releaseAffectsMark: ((node: OptimisticNode) => void) | null;
88
- static _wireExternalSource: ((self: Computed<any>) => void) | null;
89
- static _externalUntrack: (<T>(fn: () => T) => T) | null;
90
- static _syncCompanions: (<T>(el: Signal<T> | Computed<T>, value: T) => void) | null;
91
- static _updatePendingSignal: ((el: OptimisticNode) => void) | null;
92
- static _updateChildCompanions: ((el: Computed<any>) => void) | null;
93
- static _snapCompanions: ((el: OptimisticNode) => void) | null;
94
- static _latestRead: (<T>(el: Signal<T> | Computed<T>) => T) | null;
95
- static _pendingCheck: ((el: OptimisticNode, c: Computed<any> | null, owner: OptimisticNode, firewall: Computed<any> | null) => void) | null;
96
- static _recordFresh: ((el: OptimisticNode, value: any) => void) | null;
97
- static _applyReask: ((el: Computed<any>, hadReask: boolean) => boolean) | null;
98
- static _repollVerdicts: ((el: Computed<any>, snap?: boolean) => void) | null;
99
- static _witnessAffects: ((node: OptimisticNode) => void) | null;
100
- static _wakeSuppressedProbes: ((transition: Transition) => void) | null;
101
- static _optimisticWrite: (<T>(el: Signal<T> | Computed<T>, v: T | ((prev: T) => T)) => T) | null;
102
- static _resolveOptimistic: ((nodes: OptimisticNode[]) => void) | null;
103
- static _transitionBlocked: ((transition: Transition) => boolean) | null;
104
- static _cleanupLanes: ((completingTransition: Transition | null) => void) | null;
105
- static _runLaneEffects: ((type: number) => void) | null;
106
- static _gatedRead: ((el: Signal<any>, owner: OptimisticNode, c: Computed<any>) => boolean) | null;
107
- static _laneSuspends: ((owner: OptimisticNode) => boolean) | null;
108
- static _laneReadsCommitted: ((el: OptimisticNode, owner: OptimisticNode, c: Computed<any>) => boolean) | null;
109
- static _recomputeLane: ((el: Computed<any>, own: boolean) => OptimisticLane | null | false) | null;
110
- static _laneAsyncPending: ((el: Computed<any>) => void) | null;
111
- static _laneAsyncSettled: ((el: Computed<any>) => void) | null;
112
- static _trackOptimisticStore: ((store: any) => void) | null;
278
+ /** A slot node's truth is in flight (its family's derive — store/store.ts). */
279
+ static _slotFlight: ((n: Signal<any>) => boolean) | undefined;
280
+ /** A write to a slot node's guess (lanes.ts `laneWrite`): true when the
281
+ * store made the slot its derive's lane's derivation (optimistic.ts);
282
+ * `back`: the slot's node now, for a guess that comes back (lanes.ts
283
+ * `endLanes`). */
284
+ static _slotTake: ((n: Signal<any>, back?: boolean) => any) | undefined;
285
+ /** The value a slot node's guess covered: its committed value — a chained
286
+ * link's refreshed from the inner store, whose commits it never learned
287
+ * while the guess served the reads (store/store.ts, §7b). */
288
+ static _slotCovered: ((n: Signal<any>) => unknown) | undefined;
289
+ /** The store's row judgment for a guessed slot (optimistic.ts): the truth
290
+ * is the guess's echo when reconcile would write nothing into it. */
291
+ static _echoes: ((guess: unknown, truth: unknown) => boolean) | undefined;
292
+ /** Truth readers (lanes.ts `truthRead`/`truthConfirmed`), installed by the
293
+ * first `until`/`refresh` (signals.ts `watch`). */
294
+ static _truth: ((el: any) => unknown) | undefined;
295
+ static _confirmed: ((l: Transaction) => void) | undefined;
296
+ /** `affects()` on a store (store/affects.ts): a store's node for a key
297
+ * (store/store.ts `getNode`); a bare registration (birth inheritance); a
298
+ * witnessed mark on an untracked probe (verdict.ts). */
299
+ static _storeNode: ((t: any, key: PropertyKey) => Signal<any>) | undefined;
300
+ static _storeWrappable: ((v: unknown) => boolean) | undefined;
301
+ static _mark: ((node: Signal<any> | Computed<any>) => void) | undefined;
302
+ static _witnessMark: (() => void) | undefined;
303
+ /** A truth landing on a guess (lanes.ts `laneWrite`), `older` when it
304
+ * answers an older question: the store re-bases an arrangement guess over
305
+ * it; a current one differing from a shown keyed arrangement guess folds
306
+ * beneath it instead of voiding it (D-34) — true: the lane stages it
307
+ * beneath (store/optimistic.ts). */
308
+ static _laneRebase: ((el: Signal<any>, truth: unknown, older: boolean) => boolean | void) | undefined;
309
+ static _verdictLane: ((t: Transaction) => Transaction) | undefined;
310
+ static _laneGuesses: ((t: Transaction) => Signal<any>[]) | undefined;
311
+ /** `createDeferred` (deferred.ts): a deferred node with a flight up that
312
+ * `c` derives from, if any — a truth reader waits on it. */
313
+ static _lagging: ((c: Computed<any>) => Computed<any> | undefined) | undefined;
314
+ static _marked: ((el: Signal<any> | Computed<any>) => boolean) | undefined;
113
315
  flush(): void;
316
+ /** L2 — the seam: end of the pure phase. Commit this flush's staged nodes,
317
+ * or park them with the transaction the flush joined; then land every
318
+ * transaction no frame is waiting on. The landing flush is an ordinary
319
+ * flush: the settle walk (async.ts) re-ran the parked readers in its pure
320
+ * phase, and here no flight the transaction holds has a frame deriving
321
+ * from it (`blocked`). */
322
+ settle(): void;
323
+ run(type: number): void;
324
+ enqueue(type: number, fn: QueueCallback, lane?: Transaction | null): void;
325
+ /** Status reaching the root: pending is absorbed (the root mount defers —
326
+ * dev records it for the ASYNC_OUTSIDE_LOADING_BOUNDARY FYI); an error is
327
+ * unhandled (`false` → the caller halts).
328
+ *
329
+ * L2: this is where a transaction is registered. Pending that reaches an
330
+ * observer (a render effect: the frame) is a frame that cannot show — the
331
+ * flush parks, and the transaction waits on the flight while a frame
332
+ * derives from it (`blocked`). Pending nobody observes holds nothing: a
333
+ * memo in flight that no frame reads is not a frame waiting. (Base: the
334
+ * queue's `_asyncReporters`, INV-3's one registration site.)
335
+ *
336
+ * A boundary between the observer and the root (boundaries.ts) is asked
337
+ * first: a fallback catches what is not ready under it, and the root
338
+ * never hears of it. */
114
339
  notify(node: Computed<any>, mask: number, flags: number, error?: any): boolean;
115
- initTransition(transition?: Transition | null): void;
116
340
  }
341
+ /** A15's stale readers: a frame whose LAST pass read a held node as
342
+ * committed re-derives on the landed world — next round, after the commits.
343
+ * One re-derived since (any later pass cleared the bit: in the transaction,
344
+ * or without the held read) owes nothing. A run this transaction stashed
345
+ * for it is void (#3322: an effect has one value slot, and the stale pass
346
+ * overwrote the value that run was for) — the re-derivation's run replaces
347
+ * it. Truthy when an effect re-derives (`land`). */
348
+ export declare function reruns(u: Transaction): unknown;
349
+ /** The held runs join this flush's effect phase after its own runs (the
350
+ * landing's re-passes, in height order): the frame's effects run as one
351
+ * pass would have queued them — a shell re-derived at the landing before a
352
+ * boundary swap held since the write (#3540's log order). */
353
+ export declare function releaseQueues(u: Transaction): void;
354
+ /** Nodes staged this flush (`_pendingValue` set), committed at its end. */
355
+ export declare const pendingNodes: Signal<any>[];
356
+ /** Passes that read a staging of this flush as the screen — lane work
357
+ * (core.ts `stagedRead`), a verdict reader before the frame's verdict
358
+ * (verdict.ts): if the frame parks they read a held write — re-derived next
359
+ * round (lanes.ts; a lane's runs wait that round). */
360
+ export declare const stagedReaders: Computed<any>[];
361
+ /** A15's stale reader: `c` was served the committed value of a node `t`
362
+ * holds (a render effect, a verdict reader, lane work) and is re-derived
363
+ * after `t`'s landing (`_reruns`). Once per pass. */
364
+ export declare function staleReader(c: Computed<any>, t: Transaction): void;
117
365
  export declare function queuePendingNode(node: Signal<any>): void;
118
- export declare let reaskArmed: boolean;
119
366
  /** §12d: bumped by every recompute and every new subscriber edge. A node's
120
367
  * staged-rewrite skip is sound only while NOTHING recomputed or linked since
121
368
  * its last notify — a mid-batch pull can clean a marked subscriber, and a
122
369
  * skipped re-write would leave it stale. */
123
370
  export declare let notifyEpoch: number;
124
371
  export declare function bumpNotifyEpoch(): void;
125
- export declare function armReaskClear(): void;
126
- export declare function insertSubs(node: Signal<any> | Computed<any>, optimistic?: boolean): void;
127
- export declare let storeCommitHook: (() => void) | null;
128
- export declare function setStoreCommitHook(fn: () => void): void;
129
- export declare function finalizePureQueue(completingTransition?: Transition | null, incomplete?: boolean): void;
130
- /**
131
- * Count of live `affects()` registrations across the system (including
132
- * store-scope inherited marks). Gates the read-path mark check in `read()` so
133
- * graphs that never use the feature pay one integer compare.
134
- */
135
- export declare let activeAffectsMarks: number;
136
- /**
137
- * Counter mutation seam for the mark engine in affects.ts: an imported `let`
138
- * binding is read-only, and the read-path gate above must stay a plain module
139
- * variable so `read()` pays one integer compare, not a function call.
372
+ export declare function insertSubs(node: Signal<any> | Computed<any>): void;
373
+ /** Lane work re-staged (lanes.ts; `recompute`): the lane's members among
374
+ * its subscribers re-derive as the lane's work (REACTIVE_LANE_DIRTY), their
375
+ * runs held with it — not as stale readers republishing the committed view
376
+ * (#3460). After `insertSubs`. A render effect on no lane is marked too:
377
+ * inert for its pass (`recompute` seats a lane only from its own `_x`), it
378
+ * is a live write if the effect becomes a zombie later this flush — an
379
+ * on-screen reader whose removal an adopted write stages follows the lane
380
+ * (the lane-membership ruling, 2026-10-05; `_update`).
140
381
  *
141
- * @internal
142
- */
143
- export declare function shiftAffectsMarks(delta: 1 | -1): void;
382
+ * A render effect re-run by a verdict memo's change (`createMemo(() =>
383
+ * latest(x))`, CONFIG_VERDICT) is the verdict reader the same read inline
384
+ * makes it, for that pass (F-6; D-26 `[s(), L()]`, #4284): a frame reader
385
+ * of its other reads — a staging's screen, a flight's committed value. One
386
+ * an earlier propagation this flush seated in another lane leaves that
387
+ * seat: its pass starts from the frame's, as the inline effect's does, and
388
+ * `laneRead` re-derives it on the screen if that lane holds (`entered`). */
389
+ export declare function laneDirty(node: Signal<any> | Computed<any>, l: Transaction): void;
390
+ /** One lane, or two of one link group (#3335): one reveal unit. */
391
+ export declare function sameLane(a: Transaction, b: Transaction): boolean;
392
+ export declare function commitPendingNode(n: Signal<any>): void;
144
393
  export declare const globalQueue: GlobalQueue;
145
394
  /**
146
395
  * Synchronously processes the pending reactive queue, or runs `fn` in a synchronous
@@ -175,6 +424,8 @@ export declare const globalQueue: GlobalQueue;
175
424
  */
176
425
  export declare function flush(): void;
177
426
  export declare function flush<T>(fn: () => T): T;
178
- export declare function currentTransition(transition: Transition): Transition;
179
- export declare function setActiveTransition(transition: Transition | null): void;
180
- export declare function runInTransition<T>(transition: Transition, fn: () => T): T;
427
+ /** Dev-only: the DOM event current when the running effect queue started,
428
+ * or `ANY_EVENT` outside one. Read once per queue rather than once per
429
+ * effect (the getter is costly under jsdom); no event starts or ends between
430
+ * two effects of one synchronous queue (#4235). */
431
+ export declare let queueEvent: unknown;
@@ -0,0 +1,18 @@
1
+ import type { Transaction } from "./scheduler.js";
2
+ import type { Computed, Signal } from "./types.js";
3
+ /** A lane node's current value: its guess, or the latest it derived — the
4
+ * staging a shown lane holds for its next reveal, else its slot; the
5
+ * committed value while it has none (its first lane pass in flight) —
6
+ * NOT_PENDING for a node with no committed value either (born in the lane,
7
+ * uninitialized: its reads throw NotReady, A7; #4363). */
8
+ export declare function laneValueOf(el: Signal<any> | Computed<any>): unknown;
9
+ /** Truth readers (`until`, `refresh`; CONFIG_AUTHORITATIVE) — pay-for-use:
10
+ * the first one installs these on GlobalQueue (signals.ts `watch`).
11
+ *
12
+ * A truth reader's read of a lane node: the lane's value when it is the
13
+ * truth (#3943), else the truth staged beneath a guess, else the committed
14
+ * value. */
15
+ export declare function truthRead(el: Signal<any> | Computed<any>): unknown;
16
+ /** A guess confirmed: its lane's truth readers re-read — of the lane's
17
+ * derivations too, which may be the truth now (#3943). */
18
+ export declare function truthConfirmed(l: Transaction): void;