@zag-js/store 0.2.0 → 0.2.1
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/dist/index.d.ts +4 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,13 +2,13 @@ interface AsRef {
|
|
|
2
2
|
$$valtioRef: true;
|
|
3
3
|
}
|
|
4
4
|
declare function ref<T extends object>(o: T): T & AsRef;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
type Path = (string | symbol)[];
|
|
6
|
+
type Op = [op: "set", path: Path, value: unknown, prevValue: unknown] | [op: "delete", path: Path, prevValue: unknown] | [op: "resolve", path: Path, value: unknown] | [op: "reject", path: Path, error: unknown];
|
|
7
7
|
declare function proxy<T extends object>(initialObject?: T): T;
|
|
8
8
|
declare function getVersion(proxyObject: unknown): number | undefined;
|
|
9
9
|
declare function subscribe<T extends object>(proxyObject: T, callback: (ops: Op[]) => void, notifyInSync?: boolean): () => void;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
type AnyFunction = (...args: any[]) => any;
|
|
11
|
+
type Snapshot<T> = T extends AnyFunction ? T : T extends AsRef ? T : T extends Promise<infer V> ? Snapshot<V> : {
|
|
12
12
|
readonly [K in keyof T]: Snapshot<T[K]>;
|
|
13
13
|
};
|
|
14
14
|
declare function snapshot<T extends object>(proxyObject: T): Snapshot<T>;
|