mobx-state-tree 7.0.2 → 7.1.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/dist/core/mst-operations.d.ts +1 -1
- package/dist/core/type/type.d.ts +3 -1
- package/dist/mobx-state-tree.js +195 -20
- package/dist/mobx-state-tree.min.js +1 -1
- package/dist/mobx-state-tree.module.js +195 -20
- package/dist/mobx-state-tree.umd.js +195 -20
- package/dist/mobx-state-tree.umd.min.js +1 -1
- package/dist/types/complex-types/model.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/primitives.d.ts +15 -1
- package/dist/types/utility-types/snapshotProcessor.d.ts +2 -0
- package/package.json +2 -2
|
@@ -61,6 +61,20 @@ export declare const float: ISimpleType<number>;
|
|
|
61
61
|
* ```
|
|
62
62
|
*/
|
|
63
63
|
export declare const finite: ISimpleType<number>;
|
|
64
|
+
/**
|
|
65
|
+
* `types.bigint` - Creates a type that can only contain a bigint value.
|
|
66
|
+
* Snapshots serialize to string (JSON-safe) and deserialize from string, number or bigint.
|
|
67
|
+
*
|
|
68
|
+
* Example:
|
|
69
|
+
* ```ts
|
|
70
|
+
* const BigId = types.model({
|
|
71
|
+
* id: types.identifier,
|
|
72
|
+
* value: types.bigint
|
|
73
|
+
* })
|
|
74
|
+
* getSnapshot(store).value // "0" (string, JSON-safe)
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export declare const bigint: IType<bigint | string | number, string, bigint>;
|
|
64
78
|
/**
|
|
65
79
|
* `types.boolean` - Creates a type that can only contain a boolean value.
|
|
66
80
|
* This type is used for boolean values by default
|
|
@@ -101,4 +115,4 @@ export declare const DatePrimitive: IType<number | Date, number, Date>;
|
|
|
101
115
|
* @param type
|
|
102
116
|
* @returns
|
|
103
117
|
*/
|
|
104
|
-
export declare function isPrimitiveType(type: unknown): type is ISimpleType<string> | ISimpleType<number> | ISimpleType<boolean> | typeof DatePrimitive;
|
|
118
|
+
export declare function isPrimitiveType(type: unknown): type is ISimpleType<string> | ISimpleType<number> | ISimpleType<boolean> | typeof bigint | typeof DatePrimitive;
|
|
@@ -29,6 +29,8 @@ export interface ISnapshotProcessors<IT extends IAnyType, CustomC, CustomS> {
|
|
|
29
29
|
/**
|
|
30
30
|
* `types.snapshotProcessor` - Runs a pre/post snapshot processor before/after serializing a given type.
|
|
31
31
|
*
|
|
32
|
+
* [See known issue with `applySnapshot` and `preProcessSnapshot`](https://github.com/mobxjs/mobx-state-tree/issues/1317)
|
|
33
|
+
*
|
|
32
34
|
* Example:
|
|
33
35
|
* ```ts
|
|
34
36
|
* const Todo1 = types.model({ text: types.string })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mobx-state-tree",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "Opinionated, transactional, MobX powered state container",
|
|
5
5
|
"main": "dist/mobx-state-tree.js",
|
|
6
6
|
"umd:main": "dist/mobx-state-tree.umd.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"typecheck": "tsc --noEmit",
|
|
26
26
|
"size": "size-limit",
|
|
27
27
|
"tag-new-version": "yarn version && git push --tags",
|
|
28
|
-
"build-docs": "bun run fix-typedoc && shx rm -rf ./docs/API && typedoc --options ./typedocconfig.js",
|
|
28
|
+
"build-docs": "bun run fix-typedoc && shx rm -rf ./docs/API && typedoc --options ./typedocconfig.js && node scripts/fix-docs-source-links.js",
|
|
29
29
|
"publish-docs": "bun run build-docs && cd ./website && GIT_USER=jamonholmgren USE_SSH=true bun run publish-gh-pages",
|
|
30
30
|
"start": "cd website && bun run start",
|
|
31
31
|
"prepare": "husky install",
|