r-state-tree 0.6.2 → 0.7.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 +100 -8
- package/dist/configuration.d.ts +10 -0
- package/dist/model/Model.d.ts +1 -1
- package/dist/model/ModelAdministration.d.ts +3 -0
- package/dist/observables/object.d.ts +1 -1
- package/dist/r-state-tree.cjs +322 -128
- package/dist/r-state-tree.js +322 -128
- package/dist/store/Store.d.ts +1 -1
- package/dist/types.d.ts +8 -7
- package/package.json +58 -57
package/dist/types.d.ts
CHANGED
|
@@ -45,11 +45,12 @@ export declare enum ObservableCfgTypes {
|
|
|
45
45
|
computed = "computed"
|
|
46
46
|
}
|
|
47
47
|
export type ConfigurationTypes = CommonCfgTypes | ModelCfgTypes | StoreCfgTypes | ObservableCfgTypes;
|
|
48
|
-
export type
|
|
48
|
+
export type ConfigurationValue = {
|
|
49
49
|
type: ConfigurationTypes;
|
|
50
50
|
childType?: Function;
|
|
51
51
|
[key: string]: unknown;
|
|
52
52
|
};
|
|
53
|
+
export type ConfigurationType = ConfigurationValue | Function;
|
|
53
54
|
export type ModelConfiguration<T> = Record<PropertyKey, ConfigurationType>;
|
|
54
55
|
export type StoreConfiguration<T> = Record<PropertyKey, ConfigurationType>;
|
|
55
56
|
export type Configuration<T> = ModelConfiguration<T> | StoreConfiguration<T>;
|
|
@@ -69,14 +70,14 @@ export type RefSnapshot = {
|
|
|
69
70
|
[key: string]: IdType;
|
|
70
71
|
[key: number]: IdType;
|
|
71
72
|
};
|
|
72
|
-
export declare const childType: ((childType: Function) =>
|
|
73
|
+
export declare const childType: ((childType: Function) => ConfigurationValue) & {
|
|
73
74
|
type: CommonCfgTypes;
|
|
74
75
|
};
|
|
75
|
-
export declare const stateType:
|
|
76
|
-
export declare const modelRefType: ((childType: Function) =>
|
|
76
|
+
export declare const stateType: ConfigurationValue;
|
|
77
|
+
export declare const modelRefType: ((childType: Function) => ConfigurationValue) & {
|
|
77
78
|
type: ModelCfgTypes;
|
|
78
79
|
};
|
|
79
|
-
export declare const idType:
|
|
80
|
-
export declare const modelType:
|
|
81
|
-
export declare const computedType:
|
|
80
|
+
export declare const idType: ConfigurationValue;
|
|
81
|
+
export declare const modelType: ConfigurationValue;
|
|
82
|
+
export declare const computedType: ConfigurationValue;
|
|
82
83
|
export {};
|
package/package.json
CHANGED
|
@@ -1,58 +1,59 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
2
|
+
"name": "r-state-tree",
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"description": "reactive state management library",
|
|
5
|
+
"main": "dist/r-state-tree.cjs",
|
|
6
|
+
"module": "dist/r-state-tree.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/r-state-tree.js",
|
|
12
|
+
"require": "./dist/r-state-tree.cjs"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist/*",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"test": "vitest run",
|
|
22
|
+
"test:watch": "vitest",
|
|
23
|
+
"test:cover": "vitest run --coverage",
|
|
24
|
+
"build": "vite build && pnpm run build:types",
|
|
25
|
+
"build:types": "tsc --emitDeclarationOnly",
|
|
26
|
+
"lint": "eslint ./src ./tests --ext .ts",
|
|
27
|
+
"format": "prettier --cache --write \"src/**/*.ts\" \"tests/**/*.ts\"",
|
|
28
|
+
"prepublishOnly": "pnpm run build"
|
|
29
|
+
},
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "git+https://github.com/melnikov-s/r-state-tree.git"
|
|
33
|
+
},
|
|
34
|
+
"author": "Sergey Melnikov",
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/melnikov-s/r-state-tree/issues"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://github.com/melnikov-s/r-state-tree#readme",
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@tsmetadata/polyfill": "^1.1.3",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
|
43
|
+
"@typescript-eslint/parser": "^5.8.1",
|
|
44
|
+
"eslint": "^8.5.0",
|
|
45
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
46
|
+
"eslint-config-prettier": "^8.3.0",
|
|
47
|
+
"eslint-import-resolver-typescript": "^2.5.0",
|
|
48
|
+
"eslint-plugin-import": "^2.25.3",
|
|
49
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
50
|
+
"prettier": "^2.8.4",
|
|
51
|
+
"tslib": "^2.5.0",
|
|
52
|
+
"typescript": "5.9.3",
|
|
53
|
+
"vite": "7.1.9",
|
|
54
|
+
"vitest": "3.2.4"
|
|
55
|
+
},
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"@preact/signals-core": "^1.12.1"
|
|
58
|
+
}
|
|
59
|
+
}
|