@rlabs-inc/signals 1.3.0 → 1.4.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.
- package/README.md +114 -0
- package/dist/core/constants.d.ts +6 -0
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/deep/proxy.d.ts.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +430 -56
- package/dist/index.mjs +430 -56
- package/dist/primitives/bind.d.ts.map +1 -1
- package/dist/primitives/effect.d.ts.map +1 -1
- package/dist/primitives/linked.d.ts +73 -0
- package/dist/primitives/linked.d.ts.map +1 -0
- package/dist/primitives/scope.d.ts +96 -0
- package/dist/primitives/scope.d.ts.map +1 -0
- package/dist/primitives/selector.d.ts +46 -0
- package/dist/primitives/selector.d.ts.map +1 -0
- package/dist/reactivity/scheduling.d.ts.map +1 -1
- package/dist/reactivity/tracking.d.ts +5 -0
- package/dist/reactivity/tracking.d.ts.map +1 -1
- package/dist/v2/bench-compare.d.ts +2 -0
- package/dist/v2/bench-compare.d.ts.map +1 -0
- package/dist/v2/bench.d.ts +5 -0
- package/dist/v2/bench.d.ts.map +1 -0
- package/dist/v2/bind.d.ts +94 -0
- package/dist/v2/bind.d.ts.map +1 -0
- package/dist/v2/collections.d.ts +133 -0
- package/dist/v2/collections.d.ts.map +1 -0
- package/dist/v2/compat-test.d.ts +2 -0
- package/dist/v2/compat-test.d.ts.map +1 -0
- package/dist/v2/debug-array.d.ts +2 -0
- package/dist/v2/debug-array.d.ts.map +1 -0
- package/dist/v2/debug-diamond.d.ts +2 -0
- package/dist/v2/debug-diamond.d.ts.map +1 -0
- package/dist/v2/index.d.ts +7 -0
- package/dist/v2/index.d.ts.map +1 -0
- package/dist/v2/primitives.d.ts +120 -0
- package/dist/v2/primitives.d.ts.map +1 -0
- package/dist/v2/proxy.d.ts +10 -0
- package/dist/v2/proxy.d.ts.map +1 -0
- package/dist/v2/registry.d.ts +35 -0
- package/dist/v2/registry.d.ts.map +1 -0
- package/dist/v2/stress.d.ts +7 -0
- package/dist/v2/stress.d.ts.map +1 -0
- package/dist/v2/test-suite.d.ts +2 -0
- package/dist/v2/test-suite.d.ts.map +1 -0
- package/dist/v2/test-v1.d.ts +2 -0
- package/dist/v2/test-v1.d.ts.map +1 -0
- package/package.json +7 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { WritableSignal, Equals } from '../core/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for linkedSignal with explicit source and computation.
|
|
4
|
+
*/
|
|
5
|
+
export interface LinkedSignalOptions<S, D> {
|
|
6
|
+
source: () => S;
|
|
7
|
+
computation: (source: S, previous?: {
|
|
8
|
+
source: S;
|
|
9
|
+
value: D;
|
|
10
|
+
}) => D;
|
|
11
|
+
equal?: Equals<D>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Short form: just a function that computes the value.
|
|
15
|
+
* The function itself is both source and computation.
|
|
16
|
+
*/
|
|
17
|
+
export type LinkedSignalShortForm<D> = () => D;
|
|
18
|
+
/**
|
|
19
|
+
* Configuration can be either short form or full options.
|
|
20
|
+
*/
|
|
21
|
+
export type LinkedSignalConfig<S, D> = LinkedSignalShortForm<D> | LinkedSignalOptions<S, D>;
|
|
22
|
+
/**
|
|
23
|
+
* Create a linked signal that derives from a source but can be manually overridden.
|
|
24
|
+
* When the source changes, the linked signal resets to the computed value.
|
|
25
|
+
*
|
|
26
|
+
* @example Simple form (derives directly from source)
|
|
27
|
+
* ```ts
|
|
28
|
+
* const options = signal(['a', 'b', 'c'])
|
|
29
|
+
* const selected = linkedSignal(() => options.value[0])
|
|
30
|
+
*
|
|
31
|
+
* console.log(selected.value) // 'a'
|
|
32
|
+
* selected.value = 'b' // Manual override
|
|
33
|
+
* console.log(selected.value) // 'b'
|
|
34
|
+
*
|
|
35
|
+
* options.value = ['x', 'y', 'z'] // Source changes
|
|
36
|
+
* console.log(selected.value) // 'x' (reset to new first item)
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @example Advanced form (with previous value tracking)
|
|
40
|
+
* ```ts
|
|
41
|
+
* const options = signal(['a', 'b', 'c'])
|
|
42
|
+
* const selected = linkedSignal({
|
|
43
|
+
* source: () => options.value,
|
|
44
|
+
* computation: (opts, prev) => {
|
|
45
|
+
* // Keep selection if still valid
|
|
46
|
+
* if (prev && opts.includes(prev.value)) {
|
|
47
|
+
* return prev.value
|
|
48
|
+
* }
|
|
49
|
+
* return opts[0]
|
|
50
|
+
* }
|
|
51
|
+
* })
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @example Form input with reset
|
|
55
|
+
* ```ts
|
|
56
|
+
* const user = signal({ name: 'Alice' })
|
|
57
|
+
* const editName = linkedSignal(() => user.value.name)
|
|
58
|
+
*
|
|
59
|
+
* // User types in input
|
|
60
|
+
* editName.value = 'Bob'
|
|
61
|
+
*
|
|
62
|
+
* // When user data reloads, form resets
|
|
63
|
+
* user.value = { name: 'Charlie' }
|
|
64
|
+
* console.log(editName.value) // 'Charlie'
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare function linkedSignal<D>(config: LinkedSignalShortForm<D>): WritableSignal<D>;
|
|
68
|
+
export declare function linkedSignal<S, D>(config: LinkedSignalOptions<S, D>): WritableSignal<D>;
|
|
69
|
+
/**
|
|
70
|
+
* Check if a value is a LinkedSignal.
|
|
71
|
+
*/
|
|
72
|
+
export declare function isLinkedSignal(value: unknown): value is WritableSignal<unknown>;
|
|
73
|
+
//# sourceMappingURL=linked.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linked.d.ts","sourceRoot":"","sources":["../../src/primitives/linked.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAY9D;;GAEG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC,EAAE,CAAC;IACvC,MAAM,EAAE,MAAM,CAAC,CAAA;IACf,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE;QAAE,MAAM,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,CAAC,CAAA;KAAE,KAAK,CAAC,CAAA;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAA;CAClB;AAED;;;GAGG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI,MAAM,CAAC,CAAA;AAE9C;;GAEG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI,qBAAqB,CAAC,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAM3F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAA;AACpF,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAA;AA4GxF;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAAC,OAAO,CAAC,CAM/E"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { Effect, CleanupFn } from '../core/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* An effect scope that groups effects for batch disposal.
|
|
4
|
+
*/
|
|
5
|
+
export interface EffectScope {
|
|
6
|
+
/** Whether the scope is still active (not stopped) */
|
|
7
|
+
readonly active: boolean;
|
|
8
|
+
/** Whether the scope is paused */
|
|
9
|
+
readonly paused: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Run a function within this scope.
|
|
12
|
+
* Effects created during execution are tracked by this scope.
|
|
13
|
+
*/
|
|
14
|
+
run<R>(fn: () => R): R | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Stop the scope, disposing all tracked effects.
|
|
17
|
+
*/
|
|
18
|
+
stop(): void;
|
|
19
|
+
/**
|
|
20
|
+
* Pause all effects in this scope.
|
|
21
|
+
* Paused effects won't run until resumed.
|
|
22
|
+
*/
|
|
23
|
+
pause(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Resume all paused effects in this scope.
|
|
26
|
+
* Dirty effects will be scheduled for execution.
|
|
27
|
+
*/
|
|
28
|
+
resume(): void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the currently active scope.
|
|
32
|
+
*/
|
|
33
|
+
export declare function getCurrentScope(): EffectScope | null;
|
|
34
|
+
/**
|
|
35
|
+
* Create an effect scope.
|
|
36
|
+
* Effects created within the scope can be disposed together.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const scope = effectScope()
|
|
41
|
+
*
|
|
42
|
+
* scope.run(() => {
|
|
43
|
+
* // These effects are tracked by the scope
|
|
44
|
+
* effect(() => console.log(count.value))
|
|
45
|
+
* effect(() => console.log(name.value))
|
|
46
|
+
* })
|
|
47
|
+
*
|
|
48
|
+
* // Later, dispose all effects at once
|
|
49
|
+
* scope.stop()
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @example With pause/resume
|
|
53
|
+
* ```ts
|
|
54
|
+
* const scope = effectScope()
|
|
55
|
+
*
|
|
56
|
+
* scope.run(() => {
|
|
57
|
+
* effect(() => console.log(count.value))
|
|
58
|
+
* })
|
|
59
|
+
*
|
|
60
|
+
* // Pause effects (they won't run while paused)
|
|
61
|
+
* scope.pause()
|
|
62
|
+
*
|
|
63
|
+
* count.value++ // Effect doesn't run
|
|
64
|
+
*
|
|
65
|
+
* // Resume effects (pending updates will run)
|
|
66
|
+
* scope.resume()
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* @param detached - If true, scope won't be collected by parent scope
|
|
70
|
+
*/
|
|
71
|
+
export declare function effectScope(detached?: boolean): EffectScope;
|
|
72
|
+
/**
|
|
73
|
+
* Register a cleanup function on the current scope.
|
|
74
|
+
* Will be called when the scope is stopped.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* scope.run(() => {
|
|
79
|
+
* const timer = setInterval(() => console.log('tick'), 1000)
|
|
80
|
+
*
|
|
81
|
+
* onScopeDispose(() => {
|
|
82
|
+
* clearInterval(timer)
|
|
83
|
+
* })
|
|
84
|
+
* })
|
|
85
|
+
*
|
|
86
|
+
* // Later...
|
|
87
|
+
* scope.stop() // Timer is cleared
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
export declare function onScopeDispose(fn: CleanupFn): void;
|
|
91
|
+
/**
|
|
92
|
+
* Register an effect with the current scope.
|
|
93
|
+
* Called internally when an effect is created.
|
|
94
|
+
*/
|
|
95
|
+
export declare function registerEffectWithScope(effect: Effect): void;
|
|
96
|
+
//# sourceMappingURL=scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../src/primitives/scope.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAUzD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,sDAAsD;IACtD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IAExB,kCAAkC;IAClC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IAExB;;;OAGG;IACH,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAA;IAElC;;OAEG;IACH,IAAI,IAAI,IAAI,CAAA;IAEZ;;;OAGG;IACH,KAAK,IAAI,IAAI,CAAA;IAEb;;;OAGG;IACH,MAAM,IAAI,IAAI,CAAA;CACf;AAQD;;GAEG;AACH,wBAAgB,eAAe,IAAI,WAAW,GAAG,IAAI,CAEpD;AAoJD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,WAAW,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,WAAW,CAE3D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,SAAS,GAAG,IAAI,CAMlD;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAI5D"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Reaction } from '../core/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* A selector function that returns whether a key matches the current selection.
|
|
4
|
+
*/
|
|
5
|
+
export type SelectorFn<T, U = T> = (key: U) => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Create a selector function for efficient list selection tracking.
|
|
8
|
+
*
|
|
9
|
+
* Instead of each list item effect depending on the full selection state,
|
|
10
|
+
* only items whose selection status changed will re-run.
|
|
11
|
+
*
|
|
12
|
+
* This turns O(n) updates into O(2) updates: only the previously selected
|
|
13
|
+
* and newly selected items' effects run.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const selectedId = signal(1)
|
|
18
|
+
* const isSelected = createSelector(() => selectedId.value)
|
|
19
|
+
*
|
|
20
|
+
* // In a list of 1000 items:
|
|
21
|
+
* items.forEach(item => {
|
|
22
|
+
* effect(() => {
|
|
23
|
+
* // Only runs when THIS item's selection state changes!
|
|
24
|
+
* // When selectedId changes from 1 to 2:
|
|
25
|
+
* // - Only item 1's effect runs (was selected, now not)
|
|
26
|
+
* // - Only item 2's effect runs (was not selected, now is)
|
|
27
|
+
* // - Other 998 items' effects DON'T run
|
|
28
|
+
* if (isSelected(item.id)) {
|
|
29
|
+
* highlight(item)
|
|
30
|
+
* } else {
|
|
31
|
+
* unhighlight(item)
|
|
32
|
+
* }
|
|
33
|
+
* })
|
|
34
|
+
* })
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @param source - Function returning the current selection value
|
|
38
|
+
* @param fn - Optional comparison function (defaults to strict equality)
|
|
39
|
+
*/
|
|
40
|
+
export declare function createSelector<T, U = T>(source: () => T, fn?: (key: U, value: T) => boolean): SelectorFn<T, U>;
|
|
41
|
+
/**
|
|
42
|
+
* Cleanup helper - call this to manually clean up a selector's subscriptions.
|
|
43
|
+
* Usually not needed as destroyed reactions are automatically filtered.
|
|
44
|
+
*/
|
|
45
|
+
export declare function cleanupSelector<T, U>(selector: SelectorFn<T, U>, subscribers: Map<U, Set<Reaction>>): void;
|
|
46
|
+
//# sourceMappingURL=selector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selector.d.ts","sourceRoot":"","sources":["../../src/primitives/selector.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAYhD;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAA;AAMtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EACrC,MAAM,EAAE,MAAM,CAAC,EACf,EAAE,GAAE,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,OAAwC,GACjE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAwFlB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,EAClC,QAAQ,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,EAC1B,WAAW,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,GACjC,IAAI,CAWN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduling.d.ts","sourceRoot":"","sources":["../../src/reactivity/scheduling.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAkBxD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAmCvD;AAWD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAExE;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"scheduling.d.ts","sourceRoot":"","sources":["../../src/reactivity/scheduling.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAkBxD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAmCvD;AAWD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAExE;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAiBnC;AAyBD;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAmB5C;AASD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAkDxD;AAMD;;;GAGG;AACH,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAG1C"}
|
|
@@ -6,6 +6,7 @@ import type { Source, Reaction, Derived } from '../core/types.js';
|
|
|
6
6
|
* Key optimizations:
|
|
7
7
|
* 1. Version-based deduplication (rv) prevents duplicate dependencies
|
|
8
8
|
* 2. skippedDeps optimization reuses existing dependency arrays
|
|
9
|
+
* 3. ITERATIVE derived chain updates to avoid stack overflow
|
|
9
10
|
*/
|
|
10
11
|
export declare function get<T>(signal: Source<T>): T;
|
|
11
12
|
/**
|
|
@@ -16,6 +17,8 @@ export declare function set<T>(signal: Source<T>, value: T): T;
|
|
|
16
17
|
* Mark all reactions of a signal with the given status
|
|
17
18
|
* For effects: schedule them for execution
|
|
18
19
|
* For deriveds: cascade MAYBE_DIRTY to their reactions
|
|
20
|
+
*
|
|
21
|
+
* ITERATIVE VERSION: Uses explicit stack to avoid stack overflow on deep chains
|
|
19
22
|
*/
|
|
20
23
|
export declare function markReactions(signal: Source, status: number): void;
|
|
21
24
|
/**
|
|
@@ -30,6 +33,8 @@ export declare function setSignalStatus(signal: {
|
|
|
30
33
|
* DIRTY: definitely needs update
|
|
31
34
|
* MAYBE_DIRTY: check dependencies to see if any actually changed
|
|
32
35
|
* CLEAN: no update needed
|
|
36
|
+
*
|
|
37
|
+
* ITERATIVE VERSION: Uses explicit stack to avoid stack overflow on deep chains
|
|
33
38
|
*/
|
|
34
39
|
export declare function isDirty(reaction: Reaction): boolean;
|
|
35
40
|
export declare function updateDerived(derived: Derived): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracking.d.ts","sourceRoot":"","sources":["../../src/reactivity/tracking.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAkCjE
|
|
1
|
+
{"version":3,"file":"tracking.d.ts","sourceRoot":"","sources":["../../src/reactivity/tracking.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAkCjE;;;;;;;;GAQG;AACH,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAiD3C;AAoGD;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CA8BrD;AAMD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CA8BlE;AAMD;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE;IAAE,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAE3E;AAMD;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAoGnD;AAWD,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAEpD;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAE3E;AAMD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAOvE;AA8BD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAmG1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bench-compare.d.ts","sourceRoot":"","sources":["../../src/v2/bench-compare.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bench.d.ts","sourceRoot":"","sources":["../../src/v2/bench.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { Signal, ReadonlySignal } from './primitives.js';
|
|
2
|
+
declare const BINDING_SYMBOL: unique symbol;
|
|
3
|
+
export interface Binding<T> {
|
|
4
|
+
value: T;
|
|
5
|
+
readonly [BINDING_SYMBOL]: true;
|
|
6
|
+
}
|
|
7
|
+
export interface ReadonlyBinding<T> {
|
|
8
|
+
readonly value: T;
|
|
9
|
+
readonly [BINDING_SYMBOL]: true;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Check if a value is a binding.
|
|
13
|
+
*/
|
|
14
|
+
export declare function isBinding(value: unknown): value is Binding<unknown> | ReadonlyBinding<unknown>;
|
|
15
|
+
/**
|
|
16
|
+
* Unwrap a binding to get its value, or return the value directly if not a binding.
|
|
17
|
+
*/
|
|
18
|
+
export declare function unwrap<T>(value: T | Binding<T>): T;
|
|
19
|
+
/**
|
|
20
|
+
* Create a two-way binding to a signal.
|
|
21
|
+
*
|
|
22
|
+
* Changes to the binding update the source signal.
|
|
23
|
+
* Changes to the source signal update the binding.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const count = signal(0)
|
|
28
|
+
* const binding = bind(count)
|
|
29
|
+
*
|
|
30
|
+
* binding.value = 5 // count.value is now 5
|
|
31
|
+
* count.value = 10 // binding.value is now 10
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare function bind<T>(source: Signal<T>): Binding<T>;
|
|
35
|
+
export declare namespace bind {
|
|
36
|
+
var to: <T extends object, K extends keyof T>(source: Signal<T>, key: K) => Binding<T[K]>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Create a one-way (readonly) binding to a signal.
|
|
40
|
+
*
|
|
41
|
+
* The binding tracks the source but cannot modify it.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const count = signal(0)
|
|
46
|
+
* const readonly = bindReadonly(count)
|
|
47
|
+
*
|
|
48
|
+
* console.log(readonly.value) // 0
|
|
49
|
+
* // readonly.value = 5 // Error: cannot assign
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare function bindReadonly<T>(source: Signal<T> | ReadonlySignal<T>): ReadonlyBinding<T>;
|
|
53
|
+
export declare namespace bindReadonly {
|
|
54
|
+
var to: <T extends object, K extends keyof T>(source: Signal<T>, key: K) => ReadonlyBinding<T[K]>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Create a computed binding with a getter and optional setter.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const firstName = signal('Rodrigo')
|
|
62
|
+
* const lastName = signal('Santos')
|
|
63
|
+
*
|
|
64
|
+
* const fullName = bindComputed(
|
|
65
|
+
* () => `${firstName.value} ${lastName.value}`,
|
|
66
|
+
* (name) => {
|
|
67
|
+
* const [first, ...rest] = name.split(' ')
|
|
68
|
+
* firstName.value = first
|
|
69
|
+
* lastName.value = rest.join(' ')
|
|
70
|
+
* }
|
|
71
|
+
* )
|
|
72
|
+
*
|
|
73
|
+
* console.log(fullName.value) // 'Rodrigo Santos'
|
|
74
|
+
* fullName.value = 'Rusty Developer' // Updates both signals
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export declare function bindComputed<T>(getter: () => T, setter?: (value: T) => void): Binding<T> | ReadonlyBinding<T>;
|
|
78
|
+
/**
|
|
79
|
+
* Extract signal wrappers from an object's properties.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```ts
|
|
83
|
+
* const user = signal({ name: 'Rusty', age: 43 })
|
|
84
|
+
* const { name, age } = signals(user)
|
|
85
|
+
*
|
|
86
|
+
* name.value = 'Rodrigo' // user.value.name is now 'Rodrigo'
|
|
87
|
+
* console.log(age.value) // 43
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
export declare function signals<T extends object>(source: Signal<T>): {
|
|
91
|
+
[K in keyof T]: Binding<T[K]>;
|
|
92
|
+
};
|
|
93
|
+
export {};
|
|
94
|
+
//# sourceMappingURL=bind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bind.d.ts","sourceRoot":"","sources":["../../src/v2/bind.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,M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GAoBG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,MAAM,EAAE,MAAM,CAAC,EACf,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAC1B,OAAO,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAqBjC;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG;KAC3D,CAAC,IAAI,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC9B,CA0CA"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A reactive Map with fine-grained per-key tracking.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* const users = new ReactiveMap<string, User>()
|
|
7
|
+
*
|
|
8
|
+
* effect(() => {
|
|
9
|
+
* // Only re-runs when 'alice' changes
|
|
10
|
+
* console.log(users.get('alice'))
|
|
11
|
+
* })
|
|
12
|
+
*
|
|
13
|
+
* users.set('bob', { name: 'Bob' }) // Effect doesn't run
|
|
14
|
+
* users.set('alice', { name: 'Alice' }) // Effect runs
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare class ReactiveMap<K, V> implements Map<K, V> {
|
|
18
|
+
private readonly map;
|
|
19
|
+
private readonly signals;
|
|
20
|
+
private readonly sizeSignalId;
|
|
21
|
+
private readonly keysSignalId;
|
|
22
|
+
constructor(entries?: Iterable<[K, V]> | null);
|
|
23
|
+
get size(): number;
|
|
24
|
+
has(key: K): boolean;
|
|
25
|
+
get(key: K): V | undefined;
|
|
26
|
+
set(key: K, value: V): this;
|
|
27
|
+
delete(key: K): boolean;
|
|
28
|
+
clear(): void;
|
|
29
|
+
forEach(callback: (value: V, key: K, map: Map<K, V>) => void, thisArg?: unknown): void;
|
|
30
|
+
keys(): MapIterator<K>;
|
|
31
|
+
values(): MapIterator<V>;
|
|
32
|
+
entries(): MapIterator<[K, V]>;
|
|
33
|
+
[Symbol.iterator](): MapIterator<[K, V]>;
|
|
34
|
+
get [Symbol.toStringTag](): string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A reactive Set with fine-grained per-item tracking.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const selected = new ReactiveSet<string>()
|
|
42
|
+
*
|
|
43
|
+
* effect(() => {
|
|
44
|
+
* // Only re-runs when 'itemA' membership changes
|
|
45
|
+
* console.log(selected.has('itemA'))
|
|
46
|
+
* })
|
|
47
|
+
*
|
|
48
|
+
* selected.add('itemB') // Effect doesn't run
|
|
49
|
+
* selected.add('itemA') // Effect runs
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare class ReactiveSet<T> implements Set<T> {
|
|
53
|
+
private readonly set;
|
|
54
|
+
private readonly signals;
|
|
55
|
+
private readonly sizeSignalId;
|
|
56
|
+
private readonly keysSignalId;
|
|
57
|
+
constructor(values?: Iterable<T> | null);
|
|
58
|
+
get size(): number;
|
|
59
|
+
has(value: T): boolean;
|
|
60
|
+
add(value: T): this;
|
|
61
|
+
delete(value: T): boolean;
|
|
62
|
+
clear(): void;
|
|
63
|
+
forEach(callback: (value: T, value2: T, set: Set<T>) => void, thisArg?: unknown): void;
|
|
64
|
+
keys(): SetIterator<T>;
|
|
65
|
+
values(): SetIterator<T>;
|
|
66
|
+
entries(): SetIterator<[T, T]>;
|
|
67
|
+
[Symbol.iterator](): SetIterator<T>;
|
|
68
|
+
get [Symbol.toStringTag](): string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A reactive Date with tracked mutations.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* const deadline = new ReactiveDate()
|
|
76
|
+
*
|
|
77
|
+
* effect(() => {
|
|
78
|
+
* console.log('Deadline:', deadline.toISOString())
|
|
79
|
+
* })
|
|
80
|
+
*
|
|
81
|
+
* deadline.setDate(deadline.getDate() + 1) // Effect runs
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
export declare class ReactiveDate extends Date {
|
|
85
|
+
private readonly timeSignalId;
|
|
86
|
+
constructor(...args: ConstructorParameters<typeof Date>);
|
|
87
|
+
private updateTime;
|
|
88
|
+
private trackTime;
|
|
89
|
+
getTime(): number;
|
|
90
|
+
getFullYear(): number;
|
|
91
|
+
getMonth(): number;
|
|
92
|
+
getDate(): number;
|
|
93
|
+
getDay(): number;
|
|
94
|
+
getHours(): number;
|
|
95
|
+
getMinutes(): number;
|
|
96
|
+
getSeconds(): number;
|
|
97
|
+
getMilliseconds(): number;
|
|
98
|
+
getUTCFullYear(): number;
|
|
99
|
+
getUTCMonth(): number;
|
|
100
|
+
getUTCDate(): number;
|
|
101
|
+
getUTCDay(): number;
|
|
102
|
+
getUTCHours(): number;
|
|
103
|
+
getUTCMinutes(): number;
|
|
104
|
+
getUTCSeconds(): number;
|
|
105
|
+
getUTCMilliseconds(): number;
|
|
106
|
+
getTimezoneOffset(): number;
|
|
107
|
+
toISOString(): string;
|
|
108
|
+
toJSON(): string;
|
|
109
|
+
toString(): string;
|
|
110
|
+
toDateString(): string;
|
|
111
|
+
toTimeString(): string;
|
|
112
|
+
toLocaleString(): string;
|
|
113
|
+
toLocaleDateString(): string;
|
|
114
|
+
toLocaleTimeString(): string;
|
|
115
|
+
toUTCString(): string;
|
|
116
|
+
valueOf(): number;
|
|
117
|
+
setTime(time: number): number;
|
|
118
|
+
setFullYear(year: number, month?: number, date?: number): number;
|
|
119
|
+
setMonth(month: number, date?: number): number;
|
|
120
|
+
setDate(date: number): number;
|
|
121
|
+
setHours(hours: number, min?: number, sec?: number, ms?: number): number;
|
|
122
|
+
setMinutes(min: number, sec?: number, ms?: number): number;
|
|
123
|
+
setSeconds(sec: number, ms?: number): number;
|
|
124
|
+
setMilliseconds(ms: number): number;
|
|
125
|
+
setUTCFullYear(year: number, month?: number, date?: number): number;
|
|
126
|
+
setUTCMonth(month: number, date?: number): number;
|
|
127
|
+
setUTCDate(date: number): number;
|
|
128
|
+
setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number;
|
|
129
|
+
setUTCMinutes(min: number, sec?: number, ms?: number): number;
|
|
130
|
+
setUTCSeconds(sec: number, ms?: number): number;
|
|
131
|
+
setUTCMilliseconds(ms: number): number;
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=collections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/v2/collections.ts"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,WAAW,CAAC,CAAC,EAAE,CAAC,CAAE,YAAW,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;IACjD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAW;IAC/B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA4B;IACpD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAQ;IACrC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAQ;gBAEzB,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI;IAa7C,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO;IAWpB,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;IAS1B,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAoB3B,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO;IAevB,KAAK,IAAI,IAAI;IAeb,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GA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.d.ts","sourceRoot":"","sources":["../../src/v2/compat-test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-array.d.ts","sourceRoot":"","sources":["../../src/v2/debug-array.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-diamond.d.ts","sourceRoot":"","sources":["../../src/v2/debug-diamond.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { signal, state, // Alias for signal (backwards compatibility)
|
|
2
|
+
derived, effect, batch, untrack, flushSync, defaultEquals, neverEquals, shallowEquals, type Signal, type ReadonlySignal, type SignalOptions, type EffectOptions, } from './primitives.js';
|
|
3
|
+
export { bind, bindReadonly, bindComputed, signals, isBinding, unwrap, type Binding, type ReadonlyBinding, } from './bind.js';
|
|
4
|
+
export { ReactiveMap, ReactiveSet, ReactiveDate, } from './collections.js';
|
|
5
|
+
export { isProxied, toRaw, } from './proxy.js';
|
|
6
|
+
export { getNodeInfo, getStats, } from './registry.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":"AASA,OAAO,EAEL,MAAM,EACN,KAAK,EAAG,6CAA6C;AACrD,OAAO,EACP,MAAM,EAGN,KAAK,EACL,OAAO,EACP,SAAS,EAGT,aAAa,EACb,WAAW,EACX,aAAa,EAGb,KAAK,MAAM,EACX,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,iBAAiB,CAAA;AAMxB,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,SAAS,EACT,MAAM,EAGN,KAAK,OAAO,EACZ,KAAK,eAAe,GACrB,MAAM,WAAW,CAAA;AAMlB,OAAO,EACL,WAAW,EACX,WAAW,EACX,YAAY,GACb,MAAM,kBAAkB,CAAA;AAMzB,OAAO,EACL,SAAS,EACT,KAAK,GACN,MAAM,YAAY,CAAA;AAMnB,OAAO,EACL,WAAW,EACX,QAAQ,GACT,MAAM,eAAe,CAAA"}
|