@zag-js/store 0.2.0 → 0.2.2
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 +18 -6
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>;
|
package/package.json
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/store",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "The reactive store package for zag machines",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"module": "dist/index.mjs",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
5
|
"keywords": [
|
|
9
6
|
"js",
|
|
10
7
|
"utils",
|
|
@@ -28,10 +25,25 @@
|
|
|
28
25
|
"dependencies": {
|
|
29
26
|
"proxy-compare": "2.3.0"
|
|
30
27
|
},
|
|
28
|
+
"clean-package": "../../clean-package.config.json",
|
|
29
|
+
"main": "dist/index.js",
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"clean-package": "2.2.0"
|
|
32
|
+
},
|
|
33
|
+
"module": "dist/index.mjs",
|
|
34
|
+
"types": "dist/index.d.ts",
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"types": "./dist/index.d.ts",
|
|
38
|
+
"import": "./dist/index.mjs",
|
|
39
|
+
"require": "./dist/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./package.json": "./package.json"
|
|
42
|
+
},
|
|
31
43
|
"scripts": {
|
|
32
|
-
"build-fast": "tsup src
|
|
44
|
+
"build-fast": "tsup src",
|
|
33
45
|
"start": "pnpm build --watch",
|
|
34
|
-
"build": "tsup src
|
|
46
|
+
"build": "tsup src --dts",
|
|
35
47
|
"test": "jest --config ../../../jest.config.js --rootDir tests",
|
|
36
48
|
"lint": "eslint src --ext .ts,.tsx",
|
|
37
49
|
"test-ci": "pnpm test --ci --runInBand -u",
|