mobx-state-tree
Advanced tools
Comparing version 5.2.0-alpha.1 to 5.2.0-alpha.2
@@ -31,3 +31,3 @@ import { IAnyStateTreeNode, IType, IAnyModelType, IStateTreeNode, IJsonPatch, IDisposer, IAnyType, ReferenceIdentifier, TypeOfValue, IActionContext, IAnyComplexType } from "../internal"; | ||
* See [patches](https://github.com/mobxjs/mobx-state-tree#patches) for more details. onPatch events are emitted immediately and will not await the end of a transaction. | ||
* Patches can be used to deep observe a model tree. | ||
* Patches can be used to deeply observe a model tree. | ||
* | ||
@@ -72,3 +72,3 @@ * @param target the model instance from which to receive patches | ||
* Small abstraction around `onPatch` and `applyPatch`, attaches a patch listener to a tree and records all the patches. | ||
* Returns an recorder object with the following signature: | ||
* Returns a recorder object with the following signature: | ||
* | ||
@@ -252,3 +252,3 @@ * Example: | ||
/** | ||
* Tests if a reference is valid (pointing to an existing node and optionally if alive) and returns such reference if it the check passes, | ||
* Tests if a reference is valid (pointing to an existing node and optionally if alive) and returns such reference if the check passes, | ||
* else it returns undefined. | ||
@@ -288,5 +288,5 @@ * | ||
* Returns a deep copy of the given state tree node as new tree. | ||
* Short hand for `snapshot(x) = getType(x).create(getSnapshot(x))` | ||
* Shorthand for `snapshot(x) = getType(x).create(getSnapshot(x))` | ||
* | ||
* _Tip: clone will create a literal copy, including the same identifiers. To modify identifiers etc during cloning, don't use clone but take a snapshot of the tree, modify it, and create new instance_ | ||
* _Tip: clone will create a literal copy, including the same identifiers. To modify identifiers etc. during cloning, don't use clone but take a snapshot of the tree, modify it, and create new instance_ | ||
* | ||
@@ -398,3 +398,3 @@ * @param source | ||
/** | ||
* Casts a node instance type to an snapshot type so it can be assigned to a type snapshot (e.g. to be used inside a create call). | ||
* Casts a node instance type to a snapshot type so it can be assigned to a type snapshot (e.g. to be used inside a create call). | ||
* Note that this is just a cast for the type system, this is, it won't actually convert an instance to a snapshot, | ||
@@ -423,8 +423,8 @@ * but just fool typescript into thinking so. | ||
* @param snapshotOrInstance Snapshot or instance | ||
* @returns The same object casted as an input (creation) snapshot | ||
* @returns The same object cast as an input (creation) snapshot | ||
*/ | ||
export declare function castToSnapshot<I>(snapshotOrInstance: I): Extract<I, IAnyStateTreeNode> extends never ? I : TypeOfValue<I>["CreationType"]; | ||
/** | ||
* Casts a node instance type to a reference snapshot type so it can be assigned to a refernence snapshot (e.g. to be used inside a create call). | ||
* Note that this is just a cast for the type system, this is, it won't actually convert an instance to a refererence snapshot, | ||
* Casts a node instance type to a reference snapshot type so it can be assigned to a reference snapshot (e.g. to be used inside a create call). | ||
* Note that this is just a cast for the type system, this is, it won't actually convert an instance to a reference snapshot, | ||
* but just fool typescript into thinking so. | ||
@@ -453,3 +453,3 @@ * | ||
* @param instance Instance | ||
* @returns The same object casted as an reference snapshot (string or number) | ||
* @returns The same object cast as a reference snapshot (string or number) | ||
*/ | ||
@@ -456,0 +456,0 @@ export declare function castToReferenceSnapshot<I>(instance: I): Extract<I, IAnyStateTreeNode> extends never ? I : ReferenceIdentifier; |
import { ISimpleType } from "../../internal"; | ||
/** @hidden */ | ||
export declare type UnionStringArray<T extends string[]> = T[number]; | ||
export declare function enumeration<T extends string>(options: T[]): ISimpleType<UnionStringArray<T[]>>; | ||
export declare type UnionStringArray<T extends readonly string[]> = T[number]; | ||
export declare function enumeration<T extends readonly string[]>(options: T): ISimpleType<UnionStringArray<T>>; | ||
export declare function enumeration<T extends string>(name: string, options: T[]): ISimpleType<UnionStringArray<T[]>>; |
{ | ||
"name": "mobx-state-tree", | ||
"version": "5.2.0-alpha.1", | ||
"version": "5.2.0-alpha.2", | ||
"description": "Opinionated, transactional, MobX powered state container", | ||
@@ -5,0 +5,0 @@ "main": "dist/mobx-state-tree.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1281948
28540
0