@ng-org/alien-deepsignals 0.1.2-alpha.4 → 0.1.2-alpha.6
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 +23 -42
- package/dist/core.d.ts +1 -60
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +4 -76
- package/dist/deepSignal.d.ts +3 -1
- package/dist/deepSignal.d.ts.map +1 -1
- package/dist/deepSignal.js +197 -135
- package/dist/effect.d.ts.map +1 -1
- package/dist/effect.js +8 -1
- package/dist/hooks/react/useDeepSignal.d.ts.map +1 -1
- package/dist/hooks/react/useDeepSignal.js +4 -1
- package/dist/hooks/svelte/index.d.ts +0 -1
- package/dist/hooks/svelte/index.d.ts.map +1 -1
- package/dist/hooks/svelte/useDeepSignal.svelte.d.ts +2 -14
- package/dist/hooks/svelte/useDeepSignal.svelte.d.ts.map +1 -1
- package/dist/hooks/svelte/useDeepSignal.svelte.js +28 -62
- package/dist/hooks/svelte4/index.d.ts +4 -0
- package/dist/hooks/svelte4/index.d.ts.map +1 -0
- package/dist/hooks/svelte4/index.js +8 -0
- package/dist/hooks/svelte4/useDeepSignal.svelte.d.ts +27 -0
- package/dist/hooks/svelte4/useDeepSignal.svelte.d.ts.map +1 -0
- package/dist/hooks/svelte4/useDeepSignal.svelte.js +91 -0
- package/dist/hooks/vue/useDeepSignal.d.ts +1 -1
- package/dist/hooks/vue/useDeepSignal.d.ts.map +1 -1
- package/dist/hooks/vue/useDeepSignal.js +21 -73
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/test/frontend/astro-app/src/components/ReactPanel.d.ts.map +1 -1
- package/dist/test/frontend/astro-app/src/components/{ReactPanel.js → ReactPanel.jsx} +56 -45
- package/dist/test/frontend/playwright/crossFrameworkHooks.spec.js +13 -3
- package/dist/test/frontend/utils/mockData.d.ts.map +1 -1
- package/dist/test/frontend/utils/mockData.js +10 -1
- package/dist/test/lib/index.test.js +16 -3
- package/dist/test/lib/misc.test.js +104 -1
- package/dist/test/lib/watch.test.js +2 -1
- package/dist/types.d.ts +35 -11
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +9 -0
- package/dist/watch.d.ts +11 -0
- package/dist/watch.d.ts.map +1 -1
- package/dist/watch.js +9 -0
- package/package.json +25 -40
- package/dist/test/frontend/astro-app/src/components/PerfSuiteClient.d.ts +0 -4
- package/dist/test/frontend/astro-app/src/components/PerfSuiteClient.d.ts.map +0 -1
- package/dist/test/frontend/astro-app/src/components/PerfSuiteClient.js +0 -225
- package/dist/test/frontend/astro-app/src/components/perf/react/ReactPerfDeep.d.ts +0 -4
- package/dist/test/frontend/astro-app/src/components/perf/react/ReactPerfDeep.d.ts.map +0 -1
- package/dist/test/frontend/astro-app/src/components/perf/react/ReactPerfDeep.js +0 -150
- package/dist/test/frontend/astro-app/src/components/perf/react/ReactPerfNative.d.ts +0 -4
- package/dist/test/frontend/astro-app/src/components/perf/react/ReactPerfNative.d.ts.map +0 -1
- package/dist/test/frontend/astro-app/src/components/perf/react/ReactPerfNative.js +0 -184
- package/dist/test/frontend/playwright/perfSuite.spec.d.ts +0 -2
- package/dist/test/frontend/playwright/perfSuite.spec.d.ts.map +0 -1
- package/dist/test/frontend/playwright/perfSuite.spec.js +0 -128
- package/dist/test/frontend/utils/perfScenarios.d.ts +0 -15
- package/dist/test/frontend/utils/perfScenarios.d.ts.map +0 -1
- package/dist/test/frontend/utils/perfScenarios.js +0 -287
- package/dist/test/lib/core.test.d.ts +0 -2
- package/dist/test/lib/core.test.d.ts.map +0 -1
- package/dist/test/lib/core.test.js +0 -53
- package/src/index.ts +0 -5
package/README.md
CHANGED
|
@@ -13,7 +13,6 @@ Core idea: wrap a data tree in a `Proxy` that lazily creates per-property signal
|
|
|
13
13
|
- Per-property signals: fine‑grained invalidation without traversal on each change.
|
|
14
14
|
- Patch stream: microtask‑batched granular mutations (paths + op) for syncing external stores / framework adapters.
|
|
15
15
|
- Getter => computed: property getters become derived (readonly) signals automatically.
|
|
16
|
-
- `$` accessors: TypeScript exposes `$prop` for each non‑function key plus `$` / `$length` for arrays.
|
|
17
16
|
- Sets: structural `add/delete/clear` emit patches; object entries get synthetic stable ids.
|
|
18
17
|
- Configurable synthetic IDs: custom property generator - the synthetic id is used in the paths of patches to identify objects in sets.
|
|
19
18
|
- Read-only properties: protect specific properties from modification.
|
|
@@ -47,39 +46,38 @@ state.settings.add("beta");
|
|
|
47
46
|
|
|
48
47
|
## Frontend Hooks
|
|
49
48
|
|
|
50
|
-
We provide hooks for Svelte, Vue, and React so that you can use deepSignal objects in your frontend framework. Modifying the object within those components works as usual, just that the component will rerender automatically if the object changed (by an event in the component or a modification from elsewhere).
|
|
49
|
+
We provide hooks for Svelte 3/4, Svelte 5, Vue, and React so that you can use deepSignal objects in your frontend framework. Modifying the object within those components works as usual, just that the component will rerender automatically if the object changed (by an event in the component or a modification from elsewhere).
|
|
51
50
|
|
|
52
51
|
Note that you can pass existing deepSignal objects (that you are using elsewhere too, for example as shared state) as well as plain JavaScript objects (which are then wrapped).
|
|
53
52
|
|
|
54
53
|
```tsx
|
|
55
54
|
import { useDeepSignal } from "@ng-org/alien-deepsignals/react";
|
|
56
55
|
|
|
57
|
-
const users = useDeepSignal([{username: "Bob"}]);
|
|
56
|
+
const users = useDeepSignal([{ username: "Bob" }]);
|
|
58
57
|
// Note: Instead of calling `setState`, you just need to modify a property. That will trigger the required re-render.
|
|
59
58
|
```
|
|
60
59
|
|
|
61
60
|
### Vue
|
|
62
61
|
|
|
63
62
|
In component `UserManager.vue`
|
|
63
|
+
|
|
64
64
|
```vue
|
|
65
|
-
<script setup lang="ts">
|
|
65
|
+
<script setup lang="ts">
|
|
66
66
|
import { DeepSignal } from "@ng-org/alien-deepsignals";
|
|
67
67
|
import { useDeepSignal } from "@ng-org/alien-deepsignals/vue";
|
|
68
68
|
import UserComponent from "./User.vue";
|
|
69
69
|
import { User } from "./types.ts";
|
|
70
70
|
|
|
71
|
-
const users: DeepSignal<User> = useDeepSignal([{username: "Bob", id: 1}]);
|
|
71
|
+
const users: DeepSignal<User> = useDeepSignal([{ username: "Bob", id: 1 }]);
|
|
72
72
|
</script>
|
|
73
73
|
|
|
74
74
|
<template>
|
|
75
|
-
<UserComponent
|
|
76
|
-
v-for="user in users"
|
|
77
|
-
:key="user.id"
|
|
78
|
-
:user="user"
|
|
79
|
-
/>
|
|
75
|
+
<UserComponent v-for="user in users" :key="user.id" :user="user" />
|
|
80
76
|
</template>
|
|
81
77
|
```
|
|
78
|
+
|
|
82
79
|
In a child component, `User.vue`
|
|
80
|
+
|
|
83
81
|
```vue
|
|
84
82
|
<script setup lang="ts">
|
|
85
83
|
import { useDeepSignal } from "@ng-org/alien-deepsignals/vue";
|
|
@@ -88,22 +86,31 @@ const props = defineProps<{
|
|
|
88
86
|
user: DeepSignal<User>;
|
|
89
87
|
}>();
|
|
90
88
|
|
|
91
|
-
//
|
|
92
|
-
//
|
|
93
|
-
const user =
|
|
89
|
+
// The component only rerenders when user.name changes.
|
|
90
|
+
// It behaves the same as an object called with `reactive()`
|
|
91
|
+
const user = props.user;
|
|
94
92
|
</script>
|
|
95
93
|
<template>
|
|
96
|
-
|
|
94
|
+
<input type="text" v-model:value="user.name" />
|
|
97
95
|
</template>
|
|
98
96
|
```
|
|
99
97
|
|
|
100
|
-
### Svelte
|
|
98
|
+
### Svelte 3 / 4
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
import { useDeepSignal } from "@ng-org/alien-deepsignals/svelte4";
|
|
102
|
+
|
|
103
|
+
// `users` is a store of type `{username: string}[]`
|
|
104
|
+
const users = useDeepSignal([{ username: "Bob" }]);
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Svelte 5
|
|
101
108
|
|
|
102
109
|
```ts
|
|
103
110
|
import { useDeepSignal } from "@ng-org/alien-deepsignals/svelte";
|
|
104
111
|
|
|
105
112
|
// `users` is a rune of type `{username: string}[]`
|
|
106
|
-
const users = useDeepSignal([{username: "Bob"}]);
|
|
113
|
+
const users = useDeepSignal([{ username: "Bob" }]);
|
|
107
114
|
```
|
|
108
115
|
|
|
109
116
|
## Configuration options
|
|
@@ -433,32 +440,6 @@ import { shallow } from "alien-deepsignals";
|
|
|
433
440
|
state.config = shallow({ huge: { blob: true } });
|
|
434
441
|
```
|
|
435
442
|
|
|
436
|
-
## TypeScript ergonomics
|
|
437
|
-
|
|
438
|
-
`DeepSignal<T>` exposes both plain properties and optional `$prop` signal accessors (excluded for function members). Arrays add `$` (index signal map) and `$length`.
|
|
439
|
-
|
|
440
|
-
```ts
|
|
441
|
-
const state = deepSignal({ count: 0, user: { name: "A" } });
|
|
442
|
-
state.count++; // ok
|
|
443
|
-
state.$count!.set(9); // write via signal
|
|
444
|
-
const n: number = state.$count!(); // typed number
|
|
445
|
-
```
|
|
446
|
-
|
|
447
|
-
## API surface
|
|
448
|
-
|
|
449
|
-
| Function | Description |
|
|
450
|
-
| ---------------------------------- | ------------------------------------------------------------------ |
|
|
451
|
-
| `deepSignal(obj, options?)` | Create (or reuse) reactive deep proxy with optional configuration. |
|
|
452
|
-
| `watch(root, cb, opts?)` | Observe batched deep mutations. |
|
|
453
|
-
| `observe(root, cb, opts?)` | Alias of `watch`. |
|
|
454
|
-
| `peek(obj,key)` | Untracked property read. |
|
|
455
|
-
| `shallow(obj)` | Mark object to skip deep proxying. |
|
|
456
|
-
| `isDeepSignal(val)` | Runtime predicate. |
|
|
457
|
-
| `isShallow(val)` | Was value marked shallow. |
|
|
458
|
-
| `setSetEntrySyntheticId(obj,id)` | Assign custom Set entry id (highest priority). |
|
|
459
|
-
| `addWithId(set, entry, id)` | Insert with desired synthetic id (convenience). |
|
|
460
|
-
| `subscribeDeepMutations(root, cb)` | Low-level patch stream (used by watch). |
|
|
461
|
-
|
|
462
443
|
## License
|
|
463
444
|
|
|
464
445
|
This project is a fork of https://github.com/CCherry07/alien-deepsignals, forked at commit `b691dc9202c58f63c1bf78675577c811316396db`. All code previous to this commit is licensed under MIT, and author is CCherry. No copyright attribution is present. This codebase is therefor relicensed under dual MIT and Apache 2.0 licensing.
|
package/dist/core.d.ts
CHANGED
|
@@ -1,63 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export { signal as _rawSignal, computed as _rawComputed, startBatch as _rawStartBatch, endBatch as _rawEndBatch, getCurrentSub as _rawGetCurrentSub, setCurrentSub as _rawSetCurrentSub, effect as _rawEffect, } from "alien-signals";
|
|
3
|
-
import { signal as alienSignal, computed as alienComputed } from "alien-signals";
|
|
4
|
-
/** Internal shape of a tagged writable signal after adding ergonomic helpers. */
|
|
5
|
-
type TaggedSignal<T> = ReturnType<typeof alienSignal<T>> & {
|
|
6
|
-
/** Tracking read / write via property syntax */
|
|
7
|
-
value: T;
|
|
8
|
-
/** Non-tracking read */
|
|
9
|
-
peek(): T;
|
|
10
|
-
/** Alias for tracking read */
|
|
11
|
-
get(): T;
|
|
12
|
-
/** Write helper */
|
|
13
|
-
set(v: T): void;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Create a new writable function-form signal enhanced with `.value`, `.peek()`, `.get()`, `.set()`.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* const count = signal(0);
|
|
20
|
-
* count(); // 0 (track)
|
|
21
|
-
* count(1); // write
|
|
22
|
-
* count.value; // 1 (track)
|
|
23
|
-
* count.peek(); // 1 (non-tracking)
|
|
24
|
-
*/
|
|
25
|
-
export declare const signal: <T>(v?: T) => TaggedSignal<any>;
|
|
26
|
-
/** Internal shape of a tagged computed signal after adding ergonomic helpers. */
|
|
27
|
-
type TaggedComputed<T> = ReturnType<typeof alienComputed<T>> & {
|
|
28
|
-
/** Tracking read via property syntax (readonly) */
|
|
29
|
-
readonly value: T;
|
|
30
|
-
/** Non-tracking read */
|
|
31
|
-
peek(): T;
|
|
32
|
-
/** Alias for tracking read */
|
|
33
|
-
get(): T;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Create a lazy computed (readonly) signal derived from other signals.
|
|
37
|
-
*
|
|
38
|
-
* Computed signals are automatically cached and only recompute when their tracked
|
|
39
|
-
* dependencies change. The getter function is evaluated lazily—if you never read
|
|
40
|
-
* the computed value, the computation never runs.
|
|
41
|
-
*
|
|
42
|
-
* The returned function can be called directly `computed()` or accessed via `.value`.
|
|
43
|
-
* Use `.peek()` for non-tracking reads (won't establish reactive dependency).
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* const count = signal(5);
|
|
47
|
-
* const doubled = computed(() => count() * 2);
|
|
48
|
-
* doubled(); // 10 (establishes dependency, caches result)
|
|
49
|
-
* doubled.value; // 10 (cached, same as calling it)
|
|
50
|
-
* doubled.peek(); // 10 (no dependency tracking)
|
|
51
|
-
* count(10);
|
|
52
|
-
* doubled(); // 20 (recomputed because count changed)
|
|
53
|
-
*/
|
|
54
|
-
export declare const computed: <T>(getter: () => T) => TaggedComputed<T>;
|
|
55
|
-
/** Union allowing a plain value or a writable signal wrapping that value. */
|
|
56
|
-
export type MaybeSignal<T = any> = T | ReturnType<typeof signal>;
|
|
57
|
-
/** Union allowing value, writable signal, computed signal or plain getter function. */
|
|
58
|
-
export type MaybeSignalOrGetter<T = any> = MaybeSignal<T> | ReturnType<typeof computed> | (() => T);
|
|
59
|
-
/** Runtime guard that an unknown value is one of our tagged signals/computeds. */
|
|
60
|
-
export declare const isSignal: (s: any) => boolean;
|
|
1
|
+
export { signal as alienSignal, computed as alienComputed, effect as alienEffect, } from "alien-signals";
|
|
61
2
|
/**
|
|
62
3
|
* Execute multiple signal writes in a single batched update frame.
|
|
63
4
|
* All downstream computed/effect re-evaluations are deferred until the function exits.
|
package/dist/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAWA,OAAO,EACH,MAAM,IAAI,WAAW,EACrB,QAAQ,IAAI,aAAa,EACzB,MAAM,IAAI,WAAW,GACxB,MAAM,eAAe,CAAC;AAOvB;;;;;;;;;;;;GAYG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAOvC"}
|
package/dist/core.js
CHANGED
|
@@ -9,86 +9,14 @@
|
|
|
9
9
|
// according to those terms.
|
|
10
10
|
// SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.alienEffect = exports.alienComputed = exports.alienSignal = void 0;
|
|
13
13
|
exports.batch = batch;
|
|
14
|
-
/** Lightweight facade adding ergonomic helpers (.value/.peek/.get/.set) to native alien-signals function signals. */
|
|
15
14
|
// Native re-exports for advanced usage.
|
|
16
15
|
var alien_signals_1 = require("alien-signals");
|
|
17
|
-
Object.defineProperty(exports, "
|
|
18
|
-
Object.defineProperty(exports, "
|
|
19
|
-
Object.defineProperty(exports, "
|
|
20
|
-
Object.defineProperty(exports, "_rawEndBatch", { enumerable: true, get: function () { return alien_signals_1.endBatch; } });
|
|
21
|
-
Object.defineProperty(exports, "_rawGetCurrentSub", { enumerable: true, get: function () { return alien_signals_1.getCurrentSub; } });
|
|
22
|
-
Object.defineProperty(exports, "_rawSetCurrentSub", { enumerable: true, get: function () { return alien_signals_1.setCurrentSub; } });
|
|
23
|
-
Object.defineProperty(exports, "_rawEffect", { enumerable: true, get: function () { return alien_signals_1.effect; } });
|
|
16
|
+
Object.defineProperty(exports, "alienSignal", { enumerable: true, get: function () { return alien_signals_1.signal; } });
|
|
17
|
+
Object.defineProperty(exports, "alienComputed", { enumerable: true, get: function () { return alien_signals_1.computed; } });
|
|
18
|
+
Object.defineProperty(exports, "alienEffect", { enumerable: true, get: function () { return alien_signals_1.effect; } });
|
|
24
19
|
const alien_signals_2 = require("alien-signals");
|
|
25
|
-
const contents_1 = require("./contents");
|
|
26
|
-
/**
|
|
27
|
-
* Decorate a native signal function with helpers & identity.
|
|
28
|
-
*/
|
|
29
|
-
function tagSignal(fn) {
|
|
30
|
-
Object.defineProperty(fn, contents_1.ReactiveFlags.IS_SIGNAL, { value: true });
|
|
31
|
-
Object.defineProperty(fn, "value", {
|
|
32
|
-
get: () => fn(),
|
|
33
|
-
set: (v) => fn(v),
|
|
34
|
-
});
|
|
35
|
-
// Add peek to mirror old API (non-tracking read)
|
|
36
|
-
if (!fn.peek)
|
|
37
|
-
Object.defineProperty(fn, "peek", { value: () => fn() });
|
|
38
|
-
if (!fn.get)
|
|
39
|
-
Object.defineProperty(fn, "get", { value: () => fn() });
|
|
40
|
-
if (!fn.set)
|
|
41
|
-
Object.defineProperty(fn, "set", { value: (v) => fn(v) });
|
|
42
|
-
return fn;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Decorate a native computed function with ergonomic helpers & readonly value accessor.
|
|
46
|
-
*/
|
|
47
|
-
function tagComputed(fn) {
|
|
48
|
-
Object.defineProperty(fn, contents_1.ReactiveFlags.IS_SIGNAL, { value: true });
|
|
49
|
-
Object.defineProperty(fn, "value", { get: () => fn() });
|
|
50
|
-
if (!fn.peek)
|
|
51
|
-
Object.defineProperty(fn, "peek", { value: () => fn() });
|
|
52
|
-
if (!fn.get)
|
|
53
|
-
Object.defineProperty(fn, "get", { value: () => fn() });
|
|
54
|
-
return fn;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Create a new writable function-form signal enhanced with `.value`, `.peek()`, `.get()`, `.set()`.
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* const count = signal(0);
|
|
61
|
-
* count(); // 0 (track)
|
|
62
|
-
* count(1); // write
|
|
63
|
-
* count.value; // 1 (track)
|
|
64
|
-
* count.peek(); // 1 (non-tracking)
|
|
65
|
-
*/
|
|
66
|
-
const signal = (v) => tagSignal((0, alien_signals_2.signal)(v));
|
|
67
|
-
exports.signal = signal;
|
|
68
|
-
/**
|
|
69
|
-
* Create a lazy computed (readonly) signal derived from other signals.
|
|
70
|
-
*
|
|
71
|
-
* Computed signals are automatically cached and only recompute when their tracked
|
|
72
|
-
* dependencies change. The getter function is evaluated lazily—if you never read
|
|
73
|
-
* the computed value, the computation never runs.
|
|
74
|
-
*
|
|
75
|
-
* The returned function can be called directly `computed()` or accessed via `.value`.
|
|
76
|
-
* Use `.peek()` for non-tracking reads (won't establish reactive dependency).
|
|
77
|
-
*
|
|
78
|
-
* @example
|
|
79
|
-
* const count = signal(5);
|
|
80
|
-
* const doubled = computed(() => count() * 2);
|
|
81
|
-
* doubled(); // 10 (establishes dependency, caches result)
|
|
82
|
-
* doubled.value; // 10 (cached, same as calling it)
|
|
83
|
-
* doubled.peek(); // 10 (no dependency tracking)
|
|
84
|
-
* count(10);
|
|
85
|
-
* doubled(); // 20 (recomputed because count changed)
|
|
86
|
-
*/
|
|
87
|
-
const computed = (getter) => tagComputed((0, alien_signals_2.computed)(getter));
|
|
88
|
-
exports.computed = computed;
|
|
89
|
-
/** Runtime guard that an unknown value is one of our tagged signals/computeds. */
|
|
90
|
-
const isSignal = (s) => typeof s === "function" && !!s && !!s[contents_1.ReactiveFlags.IS_SIGNAL];
|
|
91
|
-
exports.isSignal = isSignal;
|
|
92
20
|
/**
|
|
93
21
|
* Execute multiple signal writes in a single batched update frame.
|
|
94
22
|
* All downstream computed/effect re-evaluations are deferred until the function exits.
|
package/dist/deepSignal.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DeepPatchJITSubscriber, DeepPatchSubscriber, DeepSignal, DeepSignalOptions } from "./types";
|
|
2
2
|
/** Runtime guard that checks whether a value is a deepSignal proxy. */
|
|
3
|
-
export declare function isDeepSignal(value:
|
|
3
|
+
export declare function isDeepSignal(value: unknown): value is DeepSignal<any>;
|
|
4
4
|
/**
|
|
5
5
|
* Create a deep reactive proxy for objects, arrays or Sets.
|
|
6
6
|
* Returns the input itself, if it's a deepSignal already.
|
|
@@ -23,4 +23,6 @@ export declare function shallow<T extends object>(obj: T): T;
|
|
|
23
23
|
export declare function setSetEntrySyntheticId(obj: object, id: string | number): void;
|
|
24
24
|
/** Convenience helper to add an entry to a proxied Set with a pre-defined synthetic ID. */
|
|
25
25
|
export declare function addWithId<T>(set: Set<T>, entry: T, id: string | number): T;
|
|
26
|
+
/** Get the original, raw value of a deep signal. */
|
|
27
|
+
export declare function getRaw<T extends object>(value: T | DeepSignal<T>): any;
|
|
26
28
|
//# sourceMappingURL=deepSignal.d.ts.map
|
package/dist/deepSignal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepSignal.d.ts","sourceRoot":"","sources":["../src/deepSignal.ts"],"names":[],"mappings":"AAWA,OAAO,EAGH,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,EACV,iBAAiB,
|
|
1
|
+
{"version":3,"file":"deepSignal.d.ts","sourceRoot":"","sources":["../src/deepSignal.ts"],"names":[],"mappings":"AAWA,OAAO,EAGH,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,EACV,iBAAiB,EAOpB,MAAM,SAAS,CAAC;AA2wCjB,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAAC,GAAG,CAAC,CAErE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EACvC,KAAK,EAAE,CAAC,EACR,OAAO,CAAC,EAAE,iBAAiB,GAC5B,UAAU,CAAC,CAAC,CAAC,CAyCf;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAClC,IAAI,EAAE,MAAM,GAAG,MAAM,EACrB,EAAE,EAAE,mBAAmB,GAAG,sBAAsB,EAChD,gBAAgB,GAAE,OAAe,GAClC,MAAM,IAAI,CAoBZ;AAED,yEAAyE;AACzE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAElE;AAED,6EAA6E;AAC7E,wBAAgB,oBAAoB,CAChC,IAAI,EAAE,MAAM,GAAG,MAAM,GACtB,MAAM,GAAG,SAAS,CAIpB;AAED,yEAAyE;AACzE,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAGnD;AAED,mFAAmF;AACnF,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,QAItE;AAED,2FAA2F;AAC3F,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,CAa1E;AAED,oDAAoD;AACpD,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,OAEhE"}
|