@solidjs/signals 2.0.0-rc.0 → 2.0.0-rc.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/README.md +1 -1
  2. package/dist/dev-shared.js +7138 -0
  3. package/dist/dev.attribution.js +3307 -0
  4. package/dist/dev.js +8076 -6692
  5. package/dist/observe/affects.js +129 -0
  6. package/dist/observe/attribution.js +7 -0
  7. package/dist/observe/boundaries.js +793 -0
  8. package/dist/observe/core/action.js +177 -0
  9. package/dist/observe/core/async.js +849 -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 +2904 -0
  15. package/dist/observe/core/constants.js +283 -0
  16. package/dist/{types-cjs/core/context.d.cts → observe/core/context.js} +37 -12
  17. package/dist/observe/core/core.js +1999 -0
  18. package/dist/observe/core/dev.js +343 -0
  19. package/dist/observe/core/effect.js +200 -0
  20. package/dist/observe/core/error-hooks.js +71 -0
  21. package/dist/observe/core/error.js +80 -0
  22. package/dist/observe/core/external.js +98 -0
  23. package/dist/observe/core/graph.js +155 -0
  24. package/dist/observe/core/heap.js +147 -0
  25. package/dist/observe/core/invariants.js +45 -0
  26. package/dist/observe/core/lanes.js +205 -0
  27. package/dist/observe/core/optimistic.js +627 -0
  28. package/dist/observe/core/owner.js +353 -0
  29. package/dist/observe/core/scheduler.js +1547 -0
  30. package/dist/observe/core/verdict.js +674 -0
  31. package/dist/observe/index.js +59 -0
  32. package/dist/observe/map.js +484 -0
  33. package/dist/observe/signals.js +731 -0
  34. package/dist/observe/store/index.js +44 -0
  35. package/dist/observe/store/next/optimistic.js +717 -0
  36. package/dist/observe/store/next/projection.js +266 -0
  37. package/dist/observe/store/next/reconcile.js +375 -0
  38. package/dist/observe/store/next/store.js +2480 -0
  39. package/dist/observe/store/next/target.js +51 -0
  40. package/dist/observe/store/store.js +331 -0
  41. package/dist/observe/store/storePath.js +103 -0
  42. package/dist/observe/store/utils.js +1070 -0
  43. package/dist/prod/affects.js +10 -9
  44. package/dist/prod/attribution.js +45 -0
  45. package/dist/prod/boundaries.js +388 -178
  46. package/dist/prod/core/action.js +65 -37
  47. package/dist/prod/core/async.js +477 -208
  48. package/dist/prod/core/attribution-hooks.js +3 -0
  49. package/dist/prod/core/constants.js +186 -1
  50. package/dist/prod/core/context.js +10 -16
  51. package/dist/prod/core/core.js +1556 -415
  52. package/dist/prod/core/dev.js +18 -1
  53. package/dist/prod/core/effect.js +119 -79
  54. package/dist/prod/core/error-hooks.js +71 -0
  55. package/dist/prod/core/error.js +13 -1
  56. package/dist/prod/core/external.js +4 -4
  57. package/dist/prod/core/graph.js +105 -54
  58. package/dist/prod/core/heap.js +72 -65
  59. package/dist/prod/core/invariants.js +3 -2
  60. package/dist/prod/core/lanes.js +117 -52
  61. package/dist/prod/core/optimistic.js +474 -103
  62. package/dist/prod/core/owner.js +131 -84
  63. package/dist/prod/core/scheduler.js +1013 -248
  64. package/dist/prod/core/verdict.js +418 -113
  65. package/dist/prod/index.js +25 -13
  66. package/dist/prod/map.js +314 -151
  67. package/dist/prod/signals.js +382 -32
  68. package/dist/prod/store/index.js +38 -0
  69. package/dist/prod/store/next/optimistic.js +710 -0
  70. package/dist/prod/store/next/projection.js +257 -0
  71. package/dist/prod/store/next/reconcile.js +373 -0
  72. package/dist/prod/store/next/store.js +2356 -0
  73. package/dist/prod/store/next/target.js +51 -0
  74. package/dist/prod/store/store.js +129 -881
  75. package/dist/prod/store/utils.js +982 -242
  76. package/dist/types/attribution.d.ts +19 -0
  77. package/dist/types/attribution.prod.d.ts +22 -0
  78. package/dist/types/boundaries.d.ts +78 -5
  79. package/dist/types/core/action.d.ts +12 -5
  80. package/dist/types/core/async.d.ts +3 -1
  81. package/dist/types/core/attribution-costs.d.ts +35 -0
  82. package/dist/types/core/attribution-feedback.d.ts +133 -0
  83. package/dist/types/core/attribution-hooks.d.ts +304 -0
  84. package/dist/types/core/attribution-queries.d.ts +24 -0
  85. package/dist/types/core/attribution.d.ts +892 -0
  86. package/dist/types/core/constants.d.ts +179 -0
  87. package/dist/types/core/core.d.ts +305 -23
  88. package/dist/types/core/dev.d.ts +421 -8
  89. package/dist/types/core/effect.d.ts +8 -1
  90. package/dist/types/core/error-hooks.d.ts +71 -0
  91. package/dist/types/core/error.d.ts +9 -0
  92. package/dist/types/core/graph.d.ts +23 -0
  93. package/dist/types/core/heap.d.ts +5 -3
  94. package/dist/types/core/index.d.ts +6 -3
  95. package/dist/types/core/invariants.d.ts +5 -1
  96. package/dist/types/core/lanes.d.ts +51 -19
  97. package/dist/types/core/owner.d.ts +15 -3
  98. package/dist/types/core/scheduler.d.ts +252 -3
  99. package/dist/types/core/types.d.ts +124 -41
  100. package/dist/types/index.d.ts +18 -5
  101. package/dist/types/map.d.ts +2 -0
  102. package/dist/types/signals.d.ts +164 -13
  103. package/dist/types/store/index.d.ts +16 -5
  104. package/dist/types/store/next/optimistic.d.ts +25 -0
  105. package/dist/types/store/next/projection.d.ts +27 -0
  106. package/dist/types/store/next/reconcile.d.ts +10 -0
  107. package/dist/types/store/next/store.d.ts +143 -0
  108. package/dist/types/store/next/target.d.ts +196 -0
  109. package/dist/types/store/store.d.ts +46 -112
  110. package/dist/types/store/utils.d.ts +188 -40
  111. package/package.json +32 -26
  112. package/dist/node.cjs +0 -7938
  113. package/dist/prod/store/optimistic.js +0 -217
  114. package/dist/prod/store/projection.js +0 -231
  115. package/dist/prod/store/reconcile.js +0 -707
  116. package/dist/types/store/optimistic.d.ts +0 -45
  117. package/dist/types/store/projection.d.ts +0 -70
  118. package/dist/types/store/reconcile.d.ts +0 -46
  119. package/dist/types-cjs/affects.d.cts +0 -47
  120. package/dist/types-cjs/boundaries.d.cts +0 -175
  121. package/dist/types-cjs/core/action.d.cts +0 -64
  122. package/dist/types-cjs/core/async.d.cts +0 -21
  123. package/dist/types-cjs/core/constants.d.cts +0 -71
  124. package/dist/types-cjs/core/core.d.cts +0 -148
  125. package/dist/types-cjs/core/dev.d.cts +0 -64
  126. package/dist/types-cjs/core/effect.d.cts +0 -30
  127. package/dist/types-cjs/core/error.d.cts +0 -47
  128. package/dist/types-cjs/core/external.d.cts +0 -15
  129. package/dist/types-cjs/core/graph.d.cts +0 -5
  130. package/dist/types-cjs/core/heap.d.cts +0 -22
  131. package/dist/types-cjs/core/index.d.cts +0 -13
  132. package/dist/types-cjs/core/invariants.d.cts +0 -59
  133. package/dist/types-cjs/core/lanes.d.cts +0 -56
  134. package/dist/types-cjs/core/optimistic.d.cts +0 -6
  135. package/dist/types-cjs/core/owner.d.cts +0 -124
  136. package/dist/types-cjs/core/scheduler.d.cts +0 -170
  137. package/dist/types-cjs/core/types.d.cts +0 -148
  138. package/dist/types-cjs/core/verdict.d.cts +0 -2
  139. package/dist/types-cjs/index.d.cts +0 -10
  140. package/dist/types-cjs/map.d.cts +0 -69
  141. package/dist/types-cjs/package.json +0 -3
  142. package/dist/types-cjs/signals.d.cts +0 -605
  143. package/dist/types-cjs/store/index.d.cts +0 -9
  144. package/dist/types-cjs/store/optimistic.d.cts +0 -45
  145. package/dist/types-cjs/store/projection.d.cts +0 -70
  146. package/dist/types-cjs/store/reconcile.d.cts +0 -46
  147. package/dist/types-cjs/store/store.d.cts +0 -213
  148. package/dist/types-cjs/store/storePath.d.cts +0 -58
  149. package/dist/types-cjs/store/utils.d.cts +0 -114
@@ -1,170 +0,0 @@
1
- import { type Heap } from "./heap.cjs";
2
- import { activeLanes, assignOrMergeLane, findLane, type OptimisticLane } from "./lanes.cjs";
3
- import type { Computed, Signal } from "./types.cjs";
4
- export { activeLanes, assignOrMergeLane, findLane };
5
- export { getOrCreateLane, hasActiveOverride, mergeLanes, resolveLane } from "./lanes.cjs";
6
- export declare const dirtyQueue: Heap;
7
- export declare const zombieQueue: Heap;
8
- export declare let clock: number;
9
- export declare let activeTransition: Transition | null;
10
- export declare let projectionWriteActive: boolean;
11
- export declare let _hitUnhandledAsync: boolean;
12
- export declare function registerTransientStoreNode(node: Signal<any>): void;
13
- export declare function resetUnhandledAsync(): void;
14
- /**
15
- * Toggles the dev-mode "must be inside a `<Loading>` boundary" enforcement
16
- * window. Only `render()` calls this — wrapping the initial mount so that a
17
- * top-level uncaught async read surfaces the diagnostic. Not part of the
18
- * user-facing API.
19
- *
20
- * @internal
21
- */
22
- export declare function enforceLoadingBoundary(enabled: boolean): void;
23
- export declare function setProjectionWriteActive(value: boolean): void;
24
- export declare function setTrackedQueueCallback(value: boolean): void;
25
- 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
- export declare function schedule(): void;
44
- /**
45
- * Permanently halts the reactive system. Called when a user error escapes
46
- * every boundary — app state is undefined at that point, so scheduling stops
47
- * entirely rather than limping along with a half-applied update.
48
- */
49
- export declare function haltReactivity(cause?: unknown): void;
50
- /** @internal Test/dev-reload hook. Revives scheduling after a halt. */
51
- export declare function resetErrorHalt(): void;
52
- export interface IQueue {
53
- enqueue(type: number, fn: QueueCallback): void;
54
- run(type: number): boolean | void;
55
- addChild(child: IQueue): void;
56
- removeChild(child: IQueue): void;
57
- created: number;
58
- 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
- }
63
- export declare class Queue implements IQueue {
64
- _parent: IQueue | null;
65
- _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
- _running: boolean;
79
- _batch: Transition;
80
- static _update: (el: Computed<unknown>) => void;
81
- static _dispose: (el: Computed<unknown>, self: boolean, zombie: boolean) => void;
82
- 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 _optimisticWrite: (<T>(el: Signal<T> | Computed<T>, v: T | ((prev: T) => T)) => T) | null;
101
- static _resolveOptimistic: ((nodes: OptimisticNode[]) => void) | null;
102
- static _transitionBlocked: ((transition: Transition) => boolean) | null;
103
- static _cleanupLanes: ((completingTransition: Transition | null) => void) | null;
104
- static _runLaneEffects: ((type: number) => void) | null;
105
- static _gatedRead: ((el: Signal<any>, owner: OptimisticNode, c: Computed<any>) => boolean) | null;
106
- static _laneSuspends: ((owner: OptimisticNode) => boolean) | null;
107
- static _laneReadsCommitted: ((el: OptimisticNode, owner: OptimisticNode, c: Computed<any>) => boolean) | null;
108
- static _recomputeLane: ((el: Computed<any>, own: boolean) => OptimisticLane | null) | null;
109
- static _laneAsyncPending: ((el: Computed<any>) => void) | null;
110
- static _laneAsyncSettled: ((el: Computed<any>) => void) | null;
111
- static _trackOptimisticStore: ((store: any) => void) | null;
112
- flush(): void;
113
- notify(node: Computed<any>, mask: number, flags: number, error?: any): boolean;
114
- initTransition(transition?: Transition | null): void;
115
- }
116
- export declare function queuePendingNode(node: Signal<any>): void;
117
- export declare function armReaskClear(): void;
118
- export declare function insertSubs(node: Signal<any> | Computed<any>, optimistic?: boolean): void;
119
- export declare function finalizePureQueue(completingTransition?: Transition | null, incomplete?: boolean): void;
120
- /**
121
- * Count of live `affects()` registrations across the system (including
122
- * store-scope inherited marks). Gates the read-path mark check in `read()` so
123
- * graphs that never use the feature pay one integer compare.
124
- */
125
- export declare let activeAffectsMarks: number;
126
- /**
127
- * Counter mutation seam for the mark engine in affects.ts: an imported `let`
128
- * binding is read-only, and the read-path gate above must stay a plain module
129
- * variable so `read()` pays one integer compare, not a function call.
130
- *
131
- * @internal
132
- */
133
- export declare function shiftAffectsMarks(delta: 1 | -1): void;
134
- export declare const globalQueue: GlobalQueue;
135
- /**
136
- * Synchronously processes the pending reactive queue, or runs `fn` in a synchronous
137
- * flush scope before draining the queue.
138
- *
139
- * Reactive updates are normally batched onto the microtask queue, so multiple
140
- * writes in a row collapse into a single update pass. Call `flush()` when you
141
- * need to *observe* the result of those writes synchronously — most commonly
142
- * in tests, but also at the boundary of imperative integration code. Pass a
143
- * callback when the writes themselves should bypass microtask scheduling and
144
- * drain synchronously when the callback returns.
145
- *
146
- * @example
147
- * ```ts
148
- * const [count, setCount] = createSignal(0);
149
- * const doubled = createMemo(() => count() * 2);
150
- *
151
- * setCount(5);
152
- * flush();
153
- * expect(doubled()).toBe(10);
154
- *
155
- * flush(() => setCount(6));
156
- * expect(doubled()).toBe(12);
157
- *
158
- * // Nested flushes drain at each level:
159
- * flush(() => {
160
- * setCount(7);
161
- * flush(() => setCount(8)); // inner drain — effects fire here
162
- * // outer continues with up-to-date state
163
- * });
164
- * ```
165
- */
166
- export declare function flush(): void;
167
- export declare function flush<T>(fn: () => T): T;
168
- export declare function currentTransition(transition: Transition): Transition;
169
- export declare function setActiveTransition(transition: Transition | null): void;
170
- export declare function runInTransition<T>(transition: Transition, fn: () => T): T;
@@ -1,148 +0,0 @@
1
- import type { NOT_PENDING } from "./constants.cjs";
2
- import type { OptimisticLane } from "./lanes.cjs";
3
- import type { IQueue, Transition } from "./scheduler.cjs";
4
- export interface Disposable {
5
- (): void;
6
- }
7
- export interface Link {
8
- _dep: Signal<unknown> | Computed<unknown>;
9
- _sub: Computed<unknown>;
10
- _nextDep: Link | null;
11
- _prevSub: Link | null;
12
- _nextSub: Link | null;
13
- /**
14
- * `_sub._depGen` at the time this link was created or last revalidated
15
- * in-order. A link stamped with the subscriber's current pass generation is
16
- * inside the validated `[deps.._depsTail]` prefix — an O(1) replacement for
17
- * scanning the dep list to answer membership (see `link()`).
18
- */
19
- _gen: number;
20
- _pendingObserver?: boolean;
21
- }
22
- export interface NodeOptions<T> {
23
- id?: string;
24
- name?: string;
25
- transparent?: boolean;
26
- equals?: ((prev: T, next: T) => boolean) | false;
27
- ownedWrite?: boolean;
28
- /** Exclude this signal from snapshot capture (internal — not part of public API) */
29
- _noSnapshot?: boolean;
30
- unobserved?: () => void;
31
- lazy?: boolean;
32
- sync?: boolean;
33
- /**
34
- * Commit #0. When present (checked with `in`, so an explicit `undefined`
35
- * counts), the node is born committed with this value instead of
36
- * STATUS_UNINITIALIZED: reads serve it everywhere, nothing suspends to
37
- * Loading boundaries, transitions are never held, and the window is
38
- * verdict-quiet (`isPending` stays false — commit #0 answers the question
39
- * by declaration; first-load affordances live in the value itself). After
40
- * the first real answer lands, normal refetch/pending semantics apply.
41
- */
42
- loadingValue?: T;
43
- }
44
- export interface RawSignal<T> {
45
- _subs: Link | null;
46
- _subsTail: Link | null;
47
- _value: T;
48
- _snapshotValue?: any;
49
- _name?: string;
50
- _equals: false | ((a: T, b: T) => boolean);
51
- _config: number;
52
- _unobserved?: () => void;
53
- _time: number;
54
- _transition: Transition | null;
55
- _pendingValue: T | typeof NOT_PENDING;
56
- _overrideValue?: T | typeof NOT_PENDING;
57
- /**
58
- * The transaction that owns the active override (stamped at optimistic
59
- * write, cleared at settle). Ownership must live on the node: a lane's
60
- * _transition is a scheduling affinity that a shared subscriber can merge
61
- * across transactions (#2912) — following it would let one action's settle
62
- * revert another action's live override. Node-level sibling of the store
63
- * layer's STORE_OPTIMISTIC_OWNERS stamps (#2899). `null` = ambient write.
64
- */
65
- _overrideOwner?: Transition | null;
66
- _optimisticLane?: OptimisticLane;
67
- _pendingSignal?: Signal<boolean>;
68
- _latestValueComputed?: Computed<T>;
69
- _parentSource?: Signal<any> | Computed<any>;
70
- /**
71
- * Live `affects()` marks on this node (refcount). Non-zero is declared
72
- * motion: the node — and, via the verdict layer's dep-graph coverage walk,
73
- * everything derived from it — reads pending regardless of graph state,
74
- * until every declaring transaction settles/reverts and releases its mark.
75
- * This count is the mark's ONLY graph state: the dedicated channel stores
76
- * nothing downstream and never touches status flags, errors, or pending
77
- * sources.
78
- */
79
- _affectsCount?: number;
80
- }
81
- export interface FirewallSignal<T> extends RawSignal<T> {
82
- _firewall: Computed<any>;
83
- _nextChild: FirewallSignal<unknown> | null;
84
- }
85
- export type Signal<T> = RawSignal<T> | FirewallSignal<T>;
86
- export interface Owner {
87
- id?: string;
88
- _config: number;
89
- _snapshotScope?: boolean;
90
- /** Effect-returned cleanup; managed across reruns, invoked at true disposal */
91
- _cleanup?: () => void;
92
- _disposal: Disposable | Disposable[] | null;
93
- _parent: Owner | null;
94
- _context: Record<symbol | string, unknown>;
95
- _childCount: number;
96
- _queue: IQueue;
97
- _firstChild: Owner | null;
98
- _nextSibling: Owner | null;
99
- _prevSibling: Owner | null;
100
- _pendingDisposal: Disposable | Disposable[] | null;
101
- _pendingFirstChild: Owner | null;
102
- }
103
- export interface Computed<T> extends RawSignal<T>, Owner {
104
- _deps: Link | null;
105
- _depsTail: Link | null;
106
- /** Recompute-pass counter; bumped when dep revalidation starts. */
107
- _depGen: number;
108
- _flags: number;
109
- _blocked?: boolean;
110
- _pendingSources?: Set<Computed<any>>;
111
- _error?: unknown;
112
- _statusFlags: number;
113
- _height: number;
114
- _nextHeap: Computed<any> | undefined;
115
- _prevHeap: Computed<any>;
116
- _fn: (prev?: T) => T;
117
- _inFlight: PromiseLike<T> | AsyncIterable<T> | null;
118
- _child: FirewallSignal<any> | null;
119
- _notifyStatus?: (status?: number, error?: any) => void;
120
- /**
121
- * Question-scoped pending classification of the node's CURRENT pending
122
- * window: `true` means the in-flight recompute is a re-ask of the same
123
- * question (refresh/poll/confirm — no tracked input changed value), so the
124
- * shown answer still answers the question and the node reads NOT pending.
125
- * Set by `recompute` from `REACTIVE_REASK`, cleared on landing
126
- * (`clearStatus`). Meaningless while not STATUS_PENDING.
127
- */
128
- _reask: boolean;
129
- /**
130
- * True while a `loadingValue` node's first real answer hasn't landed: the
131
- * node was born committed (commit #0 = the loading value) and `handleAsync`
132
- * serves that committed value instead of throwing NotReadyError, so first
133
- * flights never suspend readers, trip boundaries, or hold transitions.
134
- * The window is verdict-quiet: `isPending` stays false, because commit #0
135
- * answers the question by declaration (first-load affordances belong to
136
- * the value channel). Cleared by the first value landing on any path (sync
137
- * return, sync-resolved promise, first iterator yield, async settle); a
138
- * real error leaves it set — errors answer reads but don't enter the value
139
- * lineage, so a retry serves the loading value again. Once cleared, normal
140
- * pending/refetch semantics apply forever.
141
- */
142
- _loading: boolean;
143
- }
144
- export interface Root extends Owner {
145
- _root: true;
146
- _parentComputed: Computed<any> | null;
147
- dispose(self?: boolean): void;
148
- }
@@ -1,2 +0,0 @@
1
- export declare function latest<T>(fn: () => T): T;
2
- export declare function isPending(fn: () => any): boolean;
@@ -1,10 +0,0 @@
1
- export { $REFRESH, ContextNotFoundError, NoOwnerError, NotReadyError, action, createContext, createOwner, createRoot, runWithOwner, flush, getNextChildId, peekNextChildId, getContext, setContext, getOwner, isDisposed, getObserver, isEqual, untrack, isPending, latest, refresh, SUPPORTS_PROXY, setSnapshotCapture, markSnapshotScope, releaseSnapshotScope, clearSnapshots, enforceLoadingBoundary, enableExternalSource, resetErrorHalt } from "./core/index.cjs";
2
- import { type Dev } from "./core/index.cjs";
3
- export declare const DEV: Dev | undefined;
4
- export type { Owner, Context, ContextRecord, IQueue, ExternalSourceFactory, ExternalSource, ExternalSourceConfig, Refreshable, Dev, DevHooks, DiagnosticCapture, DiagnosticCode, DiagnosticEvent, DiagnosticKind, Diagnostics, DiagnosticSeverity } from "./core/index.cjs";
5
- export { createSignal, createMemo, createEffect, createRenderEffect, createTrackedEffect, createReaction, createOptimistic, resolve, onSettled, onCleanup } from "./signals.cjs";
6
- export type { Accessor, SourceAccessor, Setter, Signal, ComputeFunction, EffectFunction, EffectBundle, EffectOptions, SignalOptions, MemoOptions, NoInfer } from "./signals.cjs";
7
- export { affects } from "./affects.cjs";
8
- export { mapArray, repeat, type Maybe } from "./map.cjs";
9
- export * from "./store/index.cjs";
10
- export { createLoadingBoundary, createErrorBoundary, createRevealOrder, flatten, type RevealOrder } from "./boundaries.cjs";
@@ -1,69 +0,0 @@
1
- import { type Accessor } from "./signals.cjs";
2
- export type Maybe<T> = T | void | null | undefined | false;
3
- /**
4
- * Reactively maps an array, reusing the previously-mapped value for unchanged
5
- * items.
6
- *
7
- * The callback shape follows the keying mode:
8
- * - default / `keyed: true` receives `(item, index)` where `item` is the raw
9
- * row value and `index` is an accessor.
10
- * - `keyed: false` receives `(item, index)` where `item` is an accessor and
11
- * `index` is a stable number.
12
- * - `keyed: item => key` receives accessors for both arguments.
13
- *
14
- * This is the underlying helper that powers `<For>`. App code should use
15
- * `<For>` directly; reach for `mapArray` when implementing custom list
16
- * components.
17
- *
18
- * - `options.keyed` — `true` (default for primitives) compares by identity;
19
- * `false` falls back to index-only mapping; pass a function `(item) => key`
20
- * for stable identity by extracted key.
21
- * - `options.fallback` — accessor returning a value to show when the input is
22
- * empty.
23
- *
24
- * @example
25
- * ```ts
26
- * const view = mapArray(
27
- * items,
28
- * (item, index) => `${index()}: ${item.label}`,
29
- * { fallback: () => "no items" }
30
- * );
31
- * ```
32
- *
33
- * @description https://docs.solidjs.com/reference/reactive-utilities/map-array
34
- */
35
- export declare function mapArray<Item, MappedItem>(list: Accessor<Maybe<readonly Item[]>>, map: (value: Item, index: Accessor<number>) => MappedItem, options?: {
36
- keyed?: true;
37
- fallback?: Accessor<any>;
38
- name?: string;
39
- }): Accessor<MappedItem[]>;
40
- export declare function mapArray<Item, MappedItem>(list: Accessor<Maybe<readonly Item[]>>, map: (value: Accessor<Item>, index: number) => MappedItem, options: {
41
- keyed: false;
42
- fallback?: Accessor<any>;
43
- name?: string;
44
- }): Accessor<MappedItem[]>;
45
- export declare function mapArray<Item, MappedItem>(list: Accessor<Maybe<readonly Item[]>>, map: (value: Accessor<Item>, index: Accessor<number>) => MappedItem, options: {
46
- keyed: (item: Item) => any;
47
- fallback?: Accessor<any>;
48
- name?: string;
49
- }): Accessor<MappedItem[]>;
50
- /**
51
- * Reactively renders a callback `count` times, reusing previously-rendered
52
- * entries when only the count changes. Underlying helper for `<Repeat>`.
53
- *
54
- * - `options.from` — start index (default `0`); useful for offset/windowed
55
- * rendering.
56
- * - `options.fallback` — accessor returning a value to show when count is `0`.
57
- *
58
- * @example
59
- * ```ts
60
- * const view = repeat(count, i => `Item ${i}`, { fallback: () => "empty" });
61
- * ```
62
- *
63
- * @description https://docs.solidjs.com/reference/reactive-utilities/repeat
64
- */
65
- export declare function repeat(count: Accessor<number>, map: (index: number) => any, options?: {
66
- from?: Accessor<number | undefined>;
67
- fallback?: Accessor<any>;
68
- name?: string;
69
- }): Accessor<any[]>;
@@ -1,3 +0,0 @@
1
- {
2
- "type": "commonjs"
3
- }