@solidjs/signals 2.0.0-beta.13 → 2.0.0-beta.15
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 +4 -6
- package/dist/dev.js +376 -217
- package/dist/node.cjs +1634 -1528
- package/dist/prod.js +1400 -1299
- package/dist/types/core/core.d.ts +6 -22
- package/dist/types/core/dev.d.ts +1 -1
- package/dist/types/core/index.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/store/index.d.ts +1 -1
- package/dist/types/store/projection.d.ts +2 -2
- package/dist/types/store/store.d.ts +7 -2
- package/dist/types-cjs/core/core.d.cts +6 -22
- package/dist/types-cjs/core/dev.d.cts +1 -1
- package/dist/types-cjs/core/index.d.cts +1 -1
- package/dist/types-cjs/index.d.cts +1 -1
- package/dist/types-cjs/store/index.d.cts +1 -1
- package/dist/types-cjs/store/projection.d.cts +2 -2
- package/dist/types-cjs/store/store.d.cts +7 -2
- package/package.json +1 -1
|
@@ -2,9 +2,10 @@ import { type Refreshable } from "./constants.js";
|
|
|
2
2
|
import { type OptimisticLane } from "./lanes.js";
|
|
3
3
|
import type { Computed, FirewallSignal, NodeOptions, Owner, Signal } from "./types.js";
|
|
4
4
|
export declare const PRIMITIVE_IN_FORBIDDEN_SCOPE_MESSAGE = "[PRIMITIVE_IN_FORBIDDEN_SCOPE] Cannot create reactive primitives inside createTrackedEffect or owner-backed onSettled";
|
|
5
|
+
export declare const REACTIVE_WRITE_IN_OWNED_SCOPE_SIGNAL_MESSAGE: string;
|
|
6
|
+
export declare const REACTIVE_WRITE_IN_OWNED_SCOPE_REFRESH_MESSAGE: string;
|
|
5
7
|
export declare let tracking: boolean;
|
|
6
8
|
export declare let stale: boolean;
|
|
7
|
-
export declare let refreshing: boolean;
|
|
8
9
|
export declare let pendingCheckActive: boolean;
|
|
9
10
|
export declare let foundPending: boolean;
|
|
10
11
|
export declare let latestReadActive: boolean;
|
|
@@ -129,10 +130,8 @@ export declare function latest<T>(fn: () => T): T;
|
|
|
129
130
|
*
|
|
130
131
|
* Useful for showing inline transition indicators alongside the previous
|
|
131
132
|
* value (rather than swapping to a `<Loading>` fallback).
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* async source. If the source is on the Loading path for that read, the
|
|
135
|
-
* pending read follows that path instead of being treated as `false`.
|
|
133
|
+
* Because `fn` is read normally, `isPending` participates in Loading/SSR
|
|
134
|
+
* readiness the same way the read itself would.
|
|
136
135
|
*
|
|
137
136
|
* @example
|
|
138
137
|
* ```tsx
|
|
@@ -140,12 +139,10 @@ export declare function latest<T>(fn: () => T): T;
|
|
|
140
139
|
*
|
|
141
140
|
* <button disabled={pending()}>{pending() ? "Saving…" : "Save"}</button>
|
|
142
141
|
*
|
|
143
|
-
* <
|
|
144
|
-
* <button disabled={isPending(() => user(), true)}>Save</button>
|
|
145
|
-
* </Loading>
|
|
142
|
+
* <button disabled={isPending(() => user())}>Save</button>
|
|
146
143
|
* ```
|
|
147
144
|
*/
|
|
148
|
-
export declare function isPending(fn: () => any
|
|
145
|
+
export declare function isPending(fn: () => any): boolean;
|
|
149
146
|
/**
|
|
150
147
|
* Invalidates one reactive source, forcing it to re-execute even if its inputs
|
|
151
148
|
* haven't changed.
|
|
@@ -167,16 +164,3 @@ export declare function isPending(fn: () => any, loading?: boolean): boolean;
|
|
|
167
164
|
* ```
|
|
168
165
|
*/
|
|
169
166
|
export declare function refresh<T>(target: Refreshable<T>): void;
|
|
170
|
-
/**
|
|
171
|
-
* Returns `true` while a `refresh()` call is in progress. Useful for showing
|
|
172
|
-
* a "refreshing" indicator distinct from the initial-load `<Loading>`
|
|
173
|
-
* fallback.
|
|
174
|
-
*
|
|
175
|
-
* @example
|
|
176
|
-
* ```tsx
|
|
177
|
-
* <Show when={isRefreshing()}>
|
|
178
|
-
* <span class="badge">refreshing…</span>
|
|
179
|
-
* </Show>
|
|
180
|
-
* ```
|
|
181
|
-
*/
|
|
182
|
-
export declare function isRefreshing(): boolean;
|
package/dist/types/core/dev.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface DevHooks {
|
|
|
6
6
|
onStoreNodeUpdate?: (state: any, property: PropertyKey, value: any, prev: any) => void;
|
|
7
7
|
}
|
|
8
8
|
export type DiagnosticSeverity = "warn" | "error";
|
|
9
|
-
export type DiagnosticCode = "STRICT_READ_UNTRACKED" | "PENDING_ASYNC_UNTRACKED_READ" | "PENDING_ASYNC_FORBIDDEN_SCOPE" | "
|
|
9
|
+
export type DiagnosticCode = "STRICT_READ_UNTRACKED" | "PENDING_ASYNC_UNTRACKED_READ" | "PENDING_ASYNC_FORBIDDEN_SCOPE" | "REACTIVE_WRITE_IN_OWNED_SCOPE" | "RUN_WITH_DISPOSED_OWNER" | "NO_OWNER_CLEANUP" | "CLEANUP_IN_FORBIDDEN_SCOPE" | "PRIMITIVE_IN_FORBIDDEN_SCOPE" | "NO_OWNER_EFFECT" | "NO_OWNER_BOUNDARY" | "ASYNC_OUTSIDE_LOADING_BOUNDARY" | "INVALID_REFRESH_TARGET" | "MISSING_EFFECT_FN" | "SYNC_NODE_RECEIVED_ASYNC";
|
|
10
10
|
export type DiagnosticKind = "strict-read" | "async" | "write" | "lifecycle" | "owner";
|
|
11
11
|
export interface DiagnosticEvent {
|
|
12
12
|
sequence: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ContextNotFoundError, NoOwnerError, NotReadyError } from "./error.js";
|
|
2
|
-
export { isEqual, untrack, runWithOwner, computed, signal, read, setSignal, setMemo, suppressComputedRecompute, optimisticSignal, optimisticComputed, isPending, latest, refresh,
|
|
2
|
+
export { isEqual, untrack, runWithOwner, computed, signal, read, setSignal, setMemo, suppressComputedRecompute, optimisticSignal, optimisticComputed, isPending, latest, refresh, staleValues, setSnapshotCapture, markSnapshotScope, releaseSnapshotScope, clearSnapshots } from "./core.js";
|
|
3
3
|
export { enableExternalSource, _resetExternalSourceConfig, type ExternalSourceFactory, type ExternalSource, type ExternalSourceConfig } from "./external.js";
|
|
4
4
|
export { createOwner, createRoot, dispose, getNextChildId, getObserver, getOwner, isDisposed, cleanup, peekNextChildId } from "./owner.js";
|
|
5
5
|
export { createContext, getContext, setContext, type Context, type ContextRecord } from "./context.js";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { $REFRESH, ContextNotFoundError, NoOwnerError, NotReadyError, action, createContext, createOwner, createRoot, runWithOwner, flush, getNextChildId, peekNextChildId, getContext, setContext, getOwner, isDisposed, getObserver, isEqual, untrack, isPending, latest,
|
|
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 } from "./core/index.js";
|
|
2
2
|
import { type Dev } from "./core/index.js";
|
|
3
3
|
export declare const DEV: Dev | undefined;
|
|
4
4
|
export type { Owner, Context, ContextRecord, IQueue, ExternalSourceFactory, ExternalSource, ExternalSourceConfig, Refreshable, Dev, DevHooks, DiagnosticCapture, DiagnosticCode, DiagnosticEvent, DiagnosticKind, Diagnostics, DiagnosticSeverity } from "./core/index.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { Store, StoreSetter, StoreNode, StoreOptions, ProjectionOptions, NotWrappable, SolidStore } from "./store.js";
|
|
1
|
+
export type { Store, StoreReturn, ProjectionStoreReturn, StoreSetter, StoreNode, StoreOptions, ProjectionOptions, NotWrappable, SolidStore } from "./store.js";
|
|
2
2
|
export type { Merge, Omit } from "./utils.js";
|
|
3
3
|
export { isWrappable, createStore, $TRACK, $PROXY, $TARGET } from "./store.js";
|
|
4
4
|
export { createProjection } from "./projection.js";
|
|
@@ -61,6 +61,6 @@ export declare function createProjection<T extends object = {}>(fn: (draft: T) =
|
|
|
61
61
|
* instead of `STORE_OPTIMISTIC_OVERRIDE` even when an async yield fires outside
|
|
62
62
|
* the outer `setProjectionWriteActive` scope.
|
|
63
63
|
*/
|
|
64
|
-
export declare function runProjectionComputed<T extends object>(wrappedStore: Store<T>, fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, key: string | ((item: NonNullable<any>) => any), wrapCommit?: (write: () => void) => void): Computed<void | T>;
|
|
65
|
-
export declare function createWriteTraps(isActive?: () => boolean): ProxyHandler<any>;
|
|
64
|
+
export declare function runProjectionComputed<T extends object>(wrappedStore: Store<T>, fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, key: string | ((item: NonNullable<any>) => any), wrapCommit?: (write: () => void) => void, onDraftWrite?: () => void): Computed<void | T>;
|
|
65
|
+
export declare function createWriteTraps(isActive?: () => boolean, onDraftWrite?: () => void): ProxyHandler<any>;
|
|
66
66
|
export declare const writeTraps: ProxyHandler<any>;
|
|
@@ -17,6 +17,10 @@ export type Store<T> = Readonly<T>;
|
|
|
17
17
|
* whose derive function reconciles its return by `options.key`.
|
|
18
18
|
*/
|
|
19
19
|
export type StoreSetter<T> = (fn: (state: T) => T | void) => void;
|
|
20
|
+
/** Tuple returned by the plain `createStore(initialValue)` form. */
|
|
21
|
+
export type StoreReturn<T> = [get: Store<T>, set: StoreSetter<T>];
|
|
22
|
+
/** Tuple returned by the derived `createStore(fn, seed, options?)` form. */
|
|
23
|
+
export type ProjectionStoreReturn<T> = [get: Refreshable<Store<T>>, set: StoreSetter<T>];
|
|
20
24
|
/** Base options for store primitives. */
|
|
21
25
|
export interface StoreOptions {
|
|
22
26
|
/** Debug name (dev mode only) */
|
|
@@ -63,6 +67,7 @@ export declare function wrap<T extends Record<PropertyKey, any>>(value: T, targe
|
|
|
63
67
|
export declare function isWrappable<T>(obj: T | NotWrappable): obj is T;
|
|
64
68
|
export declare function setWriteOverride(value: boolean): void;
|
|
65
69
|
export declare function trackSelf(target: StoreNode, symbol?: symbol): void;
|
|
70
|
+
export declare function notifySelf(target: StoreNode): void;
|
|
66
71
|
export declare function getKeys(source: Record<PropertyKey, any>, override: Record<PropertyKey, any> | undefined, enumerable?: boolean): PropertyKey[];
|
|
67
72
|
export declare function getPropertyDescriptor(source: Record<PropertyKey, any>, override: Record<PropertyKey, any> | undefined, property: PropertyKey): PropertyDescriptor | undefined;
|
|
68
73
|
export declare const storeTraps: ProxyHandler<StoreNode>;
|
|
@@ -120,6 +125,6 @@ export declare function storeSetter<T extends object>(store: Store<T>, fn: (draf
|
|
|
120
125
|
*
|
|
121
126
|
* @returns `[store: Store<T>, setStore: StoreSetter<T>]`
|
|
122
127
|
*/
|
|
123
|
-
export declare function createStore<T extends object = {}>(store: NoFn<T> | Store<NoFn<T>>):
|
|
124
|
-
export declare function createStore<T extends object = {}>(fn: (store: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, store: Partial<T> | Store<NoFn<T>>, options?: ProjectionOptions):
|
|
128
|
+
export declare function createStore<T extends object = {}>(store: NoFn<T> | Store<NoFn<T>>): StoreReturn<T>;
|
|
129
|
+
export declare function createStore<T extends object = {}>(fn: (store: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, store: Partial<T> | Store<NoFn<T>>, options?: ProjectionOptions): ProjectionStoreReturn<T>;
|
|
125
130
|
export {};
|
|
@@ -2,9 +2,10 @@ import { type Refreshable } from "./constants.cjs";
|
|
|
2
2
|
import { type OptimisticLane } from "./lanes.cjs";
|
|
3
3
|
import type { Computed, FirewallSignal, NodeOptions, Owner, Signal } from "./types.cjs";
|
|
4
4
|
export declare const PRIMITIVE_IN_FORBIDDEN_SCOPE_MESSAGE = "[PRIMITIVE_IN_FORBIDDEN_SCOPE] Cannot create reactive primitives inside createTrackedEffect or owner-backed onSettled";
|
|
5
|
+
export declare const REACTIVE_WRITE_IN_OWNED_SCOPE_SIGNAL_MESSAGE: string;
|
|
6
|
+
export declare const REACTIVE_WRITE_IN_OWNED_SCOPE_REFRESH_MESSAGE: string;
|
|
5
7
|
export declare let tracking: boolean;
|
|
6
8
|
export declare let stale: boolean;
|
|
7
|
-
export declare let refreshing: boolean;
|
|
8
9
|
export declare let pendingCheckActive: boolean;
|
|
9
10
|
export declare let foundPending: boolean;
|
|
10
11
|
export declare let latestReadActive: boolean;
|
|
@@ -129,10 +130,8 @@ export declare function latest<T>(fn: () => T): T;
|
|
|
129
130
|
*
|
|
130
131
|
* Useful for showing inline transition indicators alongside the previous
|
|
131
132
|
* value (rather than swapping to a `<Loading>` fallback).
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* async source. If the source is on the Loading path for that read, the
|
|
135
|
-
* pending read follows that path instead of being treated as `false`.
|
|
133
|
+
* Because `fn` is read normally, `isPending` participates in Loading/SSR
|
|
134
|
+
* readiness the same way the read itself would.
|
|
136
135
|
*
|
|
137
136
|
* @example
|
|
138
137
|
* ```tsx
|
|
@@ -140,12 +139,10 @@ export declare function latest<T>(fn: () => T): T;
|
|
|
140
139
|
*
|
|
141
140
|
* <button disabled={pending()}>{pending() ? "Saving…" : "Save"}</button>
|
|
142
141
|
*
|
|
143
|
-
* <
|
|
144
|
-
* <button disabled={isPending(() => user(), true)}>Save</button>
|
|
145
|
-
* </Loading>
|
|
142
|
+
* <button disabled={isPending(() => user())}>Save</button>
|
|
146
143
|
* ```
|
|
147
144
|
*/
|
|
148
|
-
export declare function isPending(fn: () => any
|
|
145
|
+
export declare function isPending(fn: () => any): boolean;
|
|
149
146
|
/**
|
|
150
147
|
* Invalidates one reactive source, forcing it to re-execute even if its inputs
|
|
151
148
|
* haven't changed.
|
|
@@ -167,16 +164,3 @@ export declare function isPending(fn: () => any, loading?: boolean): boolean;
|
|
|
167
164
|
* ```
|
|
168
165
|
*/
|
|
169
166
|
export declare function refresh<T>(target: Refreshable<T>): void;
|
|
170
|
-
/**
|
|
171
|
-
* Returns `true` while a `refresh()` call is in progress. Useful for showing
|
|
172
|
-
* a "refreshing" indicator distinct from the initial-load `<Loading>`
|
|
173
|
-
* fallback.
|
|
174
|
-
*
|
|
175
|
-
* @example
|
|
176
|
-
* ```tsx
|
|
177
|
-
* <Show when={isRefreshing()}>
|
|
178
|
-
* <span class="badge">refreshing…</span>
|
|
179
|
-
* </Show>
|
|
180
|
-
* ```
|
|
181
|
-
*/
|
|
182
|
-
export declare function isRefreshing(): boolean;
|
|
@@ -6,7 +6,7 @@ export interface DevHooks {
|
|
|
6
6
|
onStoreNodeUpdate?: (state: any, property: PropertyKey, value: any, prev: any) => void;
|
|
7
7
|
}
|
|
8
8
|
export type DiagnosticSeverity = "warn" | "error";
|
|
9
|
-
export type DiagnosticCode = "STRICT_READ_UNTRACKED" | "PENDING_ASYNC_UNTRACKED_READ" | "PENDING_ASYNC_FORBIDDEN_SCOPE" | "
|
|
9
|
+
export type DiagnosticCode = "STRICT_READ_UNTRACKED" | "PENDING_ASYNC_UNTRACKED_READ" | "PENDING_ASYNC_FORBIDDEN_SCOPE" | "REACTIVE_WRITE_IN_OWNED_SCOPE" | "RUN_WITH_DISPOSED_OWNER" | "NO_OWNER_CLEANUP" | "CLEANUP_IN_FORBIDDEN_SCOPE" | "PRIMITIVE_IN_FORBIDDEN_SCOPE" | "NO_OWNER_EFFECT" | "NO_OWNER_BOUNDARY" | "ASYNC_OUTSIDE_LOADING_BOUNDARY" | "INVALID_REFRESH_TARGET" | "MISSING_EFFECT_FN" | "SYNC_NODE_RECEIVED_ASYNC";
|
|
10
10
|
export type DiagnosticKind = "strict-read" | "async" | "write" | "lifecycle" | "owner";
|
|
11
11
|
export interface DiagnosticEvent {
|
|
12
12
|
sequence: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ContextNotFoundError, NoOwnerError, NotReadyError } from "./error.cjs";
|
|
2
|
-
export { isEqual, untrack, runWithOwner, computed, signal, read, setSignal, setMemo, suppressComputedRecompute, optimisticSignal, optimisticComputed, isPending, latest, refresh,
|
|
2
|
+
export { isEqual, untrack, runWithOwner, computed, signal, read, setSignal, setMemo, suppressComputedRecompute, optimisticSignal, optimisticComputed, isPending, latest, refresh, staleValues, setSnapshotCapture, markSnapshotScope, releaseSnapshotScope, clearSnapshots } from "./core.cjs";
|
|
3
3
|
export { enableExternalSource, _resetExternalSourceConfig, type ExternalSourceFactory, type ExternalSource, type ExternalSourceConfig } from "./external.cjs";
|
|
4
4
|
export { createOwner, createRoot, dispose, getNextChildId, getObserver, getOwner, isDisposed, cleanup, peekNextChildId } from "./owner.cjs";
|
|
5
5
|
export { createContext, getContext, setContext, type Context, type ContextRecord } from "./context.cjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { $REFRESH, ContextNotFoundError, NoOwnerError, NotReadyError, action, createContext, createOwner, createRoot, runWithOwner, flush, getNextChildId, peekNextChildId, getContext, setContext, getOwner, isDisposed, getObserver, isEqual, untrack, isPending, latest,
|
|
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 } from "./core/index.cjs";
|
|
2
2
|
import { type Dev } from "./core/index.cjs";
|
|
3
3
|
export declare const DEV: Dev | undefined;
|
|
4
4
|
export type { Owner, Context, ContextRecord, IQueue, ExternalSourceFactory, ExternalSource, ExternalSourceConfig, Refreshable, Dev, DevHooks, DiagnosticCapture, DiagnosticCode, DiagnosticEvent, DiagnosticKind, Diagnostics, DiagnosticSeverity } from "./core/index.cjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { Store, StoreSetter, StoreNode, StoreOptions, ProjectionOptions, NotWrappable, SolidStore } from "./store.cjs";
|
|
1
|
+
export type { Store, StoreReturn, ProjectionStoreReturn, StoreSetter, StoreNode, StoreOptions, ProjectionOptions, NotWrappable, SolidStore } from "./store.cjs";
|
|
2
2
|
export type { Merge, Omit } from "./utils.cjs";
|
|
3
3
|
export { isWrappable, createStore, $TRACK, $PROXY, $TARGET } from "./store.cjs";
|
|
4
4
|
export { createProjection } from "./projection.cjs";
|
|
@@ -61,6 +61,6 @@ export declare function createProjection<T extends object = {}>(fn: (draft: T) =
|
|
|
61
61
|
* instead of `STORE_OPTIMISTIC_OVERRIDE` even when an async yield fires outside
|
|
62
62
|
* the outer `setProjectionWriteActive` scope.
|
|
63
63
|
*/
|
|
64
|
-
export declare function runProjectionComputed<T extends object>(wrappedStore: Store<T>, fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, key: string | ((item: NonNullable<any>) => any), wrapCommit?: (write: () => void) => void): Computed<void | T>;
|
|
65
|
-
export declare function createWriteTraps(isActive?: () => boolean): ProxyHandler<any>;
|
|
64
|
+
export declare function runProjectionComputed<T extends object>(wrappedStore: Store<T>, fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, key: string | ((item: NonNullable<any>) => any), wrapCommit?: (write: () => void) => void, onDraftWrite?: () => void): Computed<void | T>;
|
|
65
|
+
export declare function createWriteTraps(isActive?: () => boolean, onDraftWrite?: () => void): ProxyHandler<any>;
|
|
66
66
|
export declare const writeTraps: ProxyHandler<any>;
|
|
@@ -17,6 +17,10 @@ export type Store<T> = Readonly<T>;
|
|
|
17
17
|
* whose derive function reconciles its return by `options.key`.
|
|
18
18
|
*/
|
|
19
19
|
export type StoreSetter<T> = (fn: (state: T) => T | void) => void;
|
|
20
|
+
/** Tuple returned by the plain `createStore(initialValue)` form. */
|
|
21
|
+
export type StoreReturn<T> = [get: Store<T>, set: StoreSetter<T>];
|
|
22
|
+
/** Tuple returned by the derived `createStore(fn, seed, options?)` form. */
|
|
23
|
+
export type ProjectionStoreReturn<T> = [get: Refreshable<Store<T>>, set: StoreSetter<T>];
|
|
20
24
|
/** Base options for store primitives. */
|
|
21
25
|
export interface StoreOptions {
|
|
22
26
|
/** Debug name (dev mode only) */
|
|
@@ -63,6 +67,7 @@ export declare function wrap<T extends Record<PropertyKey, any>>(value: T, targe
|
|
|
63
67
|
export declare function isWrappable<T>(obj: T | NotWrappable): obj is T;
|
|
64
68
|
export declare function setWriteOverride(value: boolean): void;
|
|
65
69
|
export declare function trackSelf(target: StoreNode, symbol?: symbol): void;
|
|
70
|
+
export declare function notifySelf(target: StoreNode): void;
|
|
66
71
|
export declare function getKeys(source: Record<PropertyKey, any>, override: Record<PropertyKey, any> | undefined, enumerable?: boolean): PropertyKey[];
|
|
67
72
|
export declare function getPropertyDescriptor(source: Record<PropertyKey, any>, override: Record<PropertyKey, any> | undefined, property: PropertyKey): PropertyDescriptor | undefined;
|
|
68
73
|
export declare const storeTraps: ProxyHandler<StoreNode>;
|
|
@@ -120,6 +125,6 @@ export declare function storeSetter<T extends object>(store: Store<T>, fn: (draf
|
|
|
120
125
|
*
|
|
121
126
|
* @returns `[store: Store<T>, setStore: StoreSetter<T>]`
|
|
122
127
|
*/
|
|
123
|
-
export declare function createStore<T extends object = {}>(store: NoFn<T> | Store<NoFn<T>>):
|
|
124
|
-
export declare function createStore<T extends object = {}>(fn: (store: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, store: Partial<T> | Store<NoFn<T>>, options?: ProjectionOptions):
|
|
128
|
+
export declare function createStore<T extends object = {}>(store: NoFn<T> | Store<NoFn<T>>): StoreReturn<T>;
|
|
129
|
+
export declare function createStore<T extends object = {}>(fn: (store: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, store: Partial<T> | Store<NoFn<T>>, options?: ProjectionOptions): ProjectionStoreReturn<T>;
|
|
125
130
|
export {};
|
package/package.json
CHANGED