mobx-state-tree 5.1.8 → 5.2.0-alpha.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/core/action.d.ts +4 -0
- package/dist/core/mst-operations.d.ts +19 -11
- package/dist/internal.d.ts +1 -0
- package/dist/mobx-state-tree.js +267 -47
- package/dist/mobx-state-tree.min.js +1 -1
- package/dist/mobx-state-tree.module.js +268 -48
- package/dist/mobx-state-tree.umd.js +267 -47
- package/dist/mobx-state-tree.umd.min.js +1 -1
- package/dist/types/complex-types/model.d.ts +2 -2
- package/dist/types/index.d.ts +4 -1
- package/dist/types/primitives.d.ts +24 -1
- package/dist/types/utility-types/enumeration.d.ts +2 -2
- package/dist/types/utility-types/lazy.d.ts +7 -0
- package/package.json +2 -2
- package/LICENSE +0 -21
|
@@ -27,7 +27,6 @@ export declare const string: ISimpleType<string>;
|
|
|
27
27
|
export declare const number: ISimpleType<number>;
|
|
28
28
|
/**
|
|
29
29
|
* `types.integer` - Creates a type that can only contain an integer value.
|
|
30
|
-
* This type is used for integer values by default
|
|
31
30
|
*
|
|
32
31
|
* Example:
|
|
33
32
|
* ```ts
|
|
@@ -38,6 +37,30 @@ export declare const number: ISimpleType<number>;
|
|
|
38
37
|
* ```
|
|
39
38
|
*/
|
|
40
39
|
export declare const integer: ISimpleType<number>;
|
|
40
|
+
/**
|
|
41
|
+
* `types.float` - Creates a type that can only contain an float value.
|
|
42
|
+
*
|
|
43
|
+
* Example:
|
|
44
|
+
* ```ts
|
|
45
|
+
* const Size = types.model({
|
|
46
|
+
* width: types.float,
|
|
47
|
+
* height: 10
|
|
48
|
+
* })
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export declare const float: ISimpleType<number>;
|
|
52
|
+
/**
|
|
53
|
+
* `types.finite` - Creates a type that can only contain an finite value.
|
|
54
|
+
*
|
|
55
|
+
* Example:
|
|
56
|
+
* ```ts
|
|
57
|
+
* const Size = types.model({
|
|
58
|
+
* width: types.finite,
|
|
59
|
+
* height: 10
|
|
60
|
+
* })
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare const finite: ISimpleType<number>;
|
|
41
64
|
/**
|
|
42
65
|
* `types.boolean` - Creates a type that can only contain a boolean value.
|
|
43
66
|
* This type is used for boolean values by default
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ISimpleType } from "../../internal";
|
|
2
2
|
/** @hidden */
|
|
3
|
-
export declare type UnionStringArray<T extends string[]> = T[number];
|
|
4
|
-
export declare function enumeration<T extends string>(options: T
|
|
3
|
+
export declare type UnionStringArray<T extends readonly string[]> = T[number];
|
|
4
|
+
export declare function enumeration<T extends readonly string[]>(options: T): ISimpleType<UnionStringArray<T>>;
|
|
5
5
|
export declare function enumeration<T extends string>(name: string, options: T[]): ISimpleType<UnionStringArray<T[]>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IType } from "../../core/type/type";
|
|
2
|
+
interface LazyOptions<T extends IType<any, any, any>, U> {
|
|
3
|
+
loadType: () => Promise<T>;
|
|
4
|
+
shouldLoadPredicate: (parent: U) => boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function lazy<T extends IType<any, any, any>, U>(name: string, options: LazyOptions<T, U>): T;
|
|
7
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mobx-state-tree",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0-alpha.2",
|
|
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",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"functional-reactive-programming",
|
|
87
87
|
"state management"
|
|
88
88
|
],
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "27ec7ac0b0743a367fb01a7f40192f3042bd91f2"
|
|
90
90
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2016 Michel Weststrate
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|