mobx-state-tree
Advanced tools
Comparing version 3.14.1 to 3.15.0
@@ -0,0 +0,0 @@ import { IDisposer, IAnyStateTreeNode, IActionContext } from "../internal"; |
@@ -0,0 +0,0 @@ import { IAnyStateTreeNode, IMiddlewareEvent } from "../internal"; |
@@ -1,17 +0,1 @@ | ||
/** @hidden */ | ||
declare const $flowYield: unique symbol; | ||
/** @hidden */ | ||
export interface FlowYield { | ||
[$flowYield]: undefined; | ||
} | ||
/** @hidden */ | ||
declare const $flowReturn: unique symbol; | ||
/** @hidden */ | ||
export interface FlowReturn<T> { | ||
[$flowReturn]: T; | ||
} | ||
/** @hidden */ | ||
export declare type FlowReturnType<R> = IfAllAreFlowYieldThenVoid<R extends FlowReturn<infer FR> ? FR extends Promise<infer FRP> ? FRP : FR : R extends Promise<any> ? FlowYield : R>; | ||
/** @hidden */ | ||
export declare type IfAllAreFlowYieldThenVoid<R> = Exclude<R, FlowYield> extends never ? void : Exclude<R, FlowYield>; | ||
/** | ||
@@ -22,5 +6,6 @@ * See [asynchronous actions](https://github.com/mobxjs/mobx-state-tree/blob/master/docs/async-actions.md). | ||
*/ | ||
export declare function flow<R, Args extends any[]>(generator: (...args: Args) => IterableIterator<R>): (...args: Args) => Promise<FlowReturnType<R>>; | ||
export declare function flow<R, Args extends any[]>(generator: (...args: Args) => Generator<any, R, any>): (...args: Args) => Promise<R>; | ||
/** | ||
* Used for TypeScript to make flows that return a promise return the actual promise result. | ||
* @deprecated Not needed since TS3.6. | ||
* Used for TypeScript to make flows that return a promise return the actual promise result. | ||
* | ||
@@ -30,3 +15,2 @@ * @param val | ||
*/ | ||
export declare function castFlowReturn<T>(val: T): FlowReturn<T>; | ||
export {}; | ||
export declare function castFlowReturn<T>(val: T): T; |
@@ -0,0 +0,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { IAnyStateTreeNode, IType, IAnyModelType, IStateTreeNode, IJsonPatch, IDisposer, IAnyType, ReferenceIdentifier, TypeOfValue, IActionContext } from "../internal"; | ||
import { IAnyStateTreeNode, IType, IAnyModelType, IStateTreeNode, IJsonPatch, IDisposer, IAnyType, ReferenceIdentifier, TypeOfValue, IActionContext, IAnyComplexType } from "../internal"; | ||
/** @hidden */ | ||
@@ -10,3 +10,3 @@ export declare type TypeOrStateTreeNodeToStateTreeNode<T extends IAnyType | IAnyStateTreeNode> = T extends IType<any, any, infer TT> ? TT & IStateTreeNode<T> : T; | ||
*/ | ||
export declare function getType(object: IAnyStateTreeNode): IAnyType; | ||
export declare function getType(object: IAnyStateTreeNode): IAnyComplexType; | ||
/** | ||
@@ -175,3 +175,3 @@ * Returns the _declared_ type of the given sub property of an object, array or map. | ||
*/ | ||
export declare function getParent<IT extends IAnyStateTreeNode | IAnyType>(target: IAnyStateTreeNode, depth?: number): TypeOrStateTreeNodeToStateTreeNode<IT>; | ||
export declare function getParent<IT extends IAnyStateTreeNode | IAnyComplexType>(target: IAnyStateTreeNode, depth?: number): TypeOrStateTreeNodeToStateTreeNode<IT>; | ||
/** | ||
@@ -184,3 +184,3 @@ * Given a model instance, returns `true` if the object has a parent of given type, that is, is part of another object, map or array | ||
*/ | ||
export declare function hasParentOfType(target: IAnyStateTreeNode, type: IAnyType): boolean; | ||
export declare function hasParentOfType(target: IAnyStateTreeNode, type: IAnyComplexType): boolean; | ||
/** | ||
@@ -193,3 +193,3 @@ * Returns the target's parent of a given type, or throws. | ||
*/ | ||
export declare function getParentOfType<IT extends IAnyType>(target: IAnyStateTreeNode, type: IT): IT["Type"]; | ||
export declare function getParentOfType<IT extends IAnyComplexType>(target: IAnyStateTreeNode, type: IT): IT["Type"]; | ||
/** | ||
@@ -204,3 +204,3 @@ * Given an object in a model tree, returns the root object of that tree. | ||
*/ | ||
export declare function getRoot<IT extends IAnyType | IAnyStateTreeNode>(target: IAnyStateTreeNode): TypeOrStateTreeNodeToStateTreeNode<IT>; | ||
export declare function getRoot<IT extends IAnyComplexType | IAnyStateTreeNode>(target: IAnyStateTreeNode): TypeOrStateTreeNodeToStateTreeNode<IT>; | ||
/** | ||
@@ -245,3 +245,3 @@ * Returns the path of the given object in the model tree | ||
*/ | ||
export declare function resolveIdentifier<IT extends IAnyType>(type: IT, target: IAnyStateTreeNode, identifier: ReferenceIdentifier): IT["Type"] | undefined; | ||
export declare function resolveIdentifier<IT extends IAnyModelType>(type: IT, target: IAnyStateTreeNode, identifier: ReferenceIdentifier): IT["Type"] | undefined; | ||
/** | ||
@@ -248,0 +248,0 @@ * Returns the identifier of the target node. |
export {}; |
export {}; |
@@ -1,1 +0,17 @@ | ||
export {}; | ||
/** | ||
* @hidden | ||
*/ | ||
export declare enum Hook { | ||
afterCreate = "afterCreate", | ||
afterAttach = "afterAttach", | ||
afterCreationFinalization = "afterCreationFinalization", | ||
beforeDetach = "beforeDetach", | ||
beforeDestroy = "beforeDestroy" | ||
} | ||
export interface IHooks { | ||
[Hook.afterCreate]?: () => void; | ||
[Hook.afterAttach]?: () => void; | ||
[Hook.beforeDetach]?: () => void; | ||
[Hook.beforeDestroy]?: () => void; | ||
} | ||
export declare type IHooksGetter<T> = (self: T) => IHooks; |
export {}; |
@@ -0,0 +0,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { IAnyType } from "../../internal"; | ||
import { IAnyType, STNValue, Instance, IAnyComplexType } from "../../internal"; | ||
/** @hidden */ | ||
@@ -17,3 +17,3 @@ declare const $stateTreeNodeType: unique symbol; | ||
*/ | ||
export interface IAnyStateTreeNode extends IStateTreeNode<IAnyType> { | ||
export interface IAnyStateTreeNode extends STNValue<any, IAnyType> { | ||
} | ||
@@ -28,3 +28,3 @@ /** | ||
*/ | ||
export declare function isStateTreeNode<IT extends IAnyType = IAnyType>(value: any): value is IStateTreeNode<IT>; | ||
export declare function isStateTreeNode<IT extends IAnyComplexType = IAnyComplexType>(value: any): value is STNValue<Instance<IT>, IT>; | ||
export {}; |
export {}; |
export {}; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import { IAnyType, ExtractCSTWithSTN } from "../../internal"; |
import { IValidationContext, IValidationResult, IStateTreeNode, ModelPrimitive } from "../../internal"; | ||
/** | ||
* A state tree node value. | ||
* @hidden | ||
@@ -4,0 +5,0 @@ */ |
export { IModelType, IAnyModelType, IDisposer, IMSTMap, IMapType, IMSTArray, IArrayType, IType, IAnyType, ModelPrimitive, ISimpleType, IComplexType, IAnyComplexType, IReferenceType, _CustomCSProcessor, _CustomOrOther, _CustomJoin, _NotCustomized, typecheck, escapeJsonPath, unescapeJsonPath, joinJsonPath, splitJsonPath, IJsonPatch, IReversibleJsonPatch, decorate, addMiddleware, IMiddlewareEvent, IActionTrackingMiddleware2Call, IMiddlewareHandler, IMiddlewareEventType, IActionTrackingMiddlewareHooks, IActionTrackingMiddleware2Hooks, process, isStateTreeNode, IStateTreeNode, IAnyStateTreeNode, flow, castFlowReturn, applyAction, onAction, IActionRecorder, ISerializedActionCall, recordActions, createActionTrackingMiddleware, createActionTrackingMiddleware2, setLivelinessChecking, getLivelinessChecking, LivelinessMode, setLivelynessChecking, // to be deprecated | ||
LivelynessMode, // to be deprecated | ||
ModelSnapshotType, ModelCreationType, ModelSnapshotType2, ModelCreationType2, ModelInstanceType, ModelInstanceTypeProps, ModelPropertiesDeclarationToProperties, ModelProperties, ModelPropertiesDeclaration, ModelActions, ITypeUnion, CustomTypeOptions, UnionOptions, Instance, SnapshotIn, SnapshotOut, SnapshotOrInstance, TypeOrStateTreeNodeToStateTreeNode, UnionStringArray, getType, getChildType, onPatch, onSnapshot, applyPatch, IPatchRecorder, recordPatches, protect, unprotect, isProtected, applySnapshot, getSnapshot, hasParent, getParent, hasParentOfType, getParentOfType, getRoot, getPath, getPathParts, isRoot, resolvePath, resolveIdentifier, getIdentifier, tryResolve, getRelativePath, clone, detach, destroy, isAlive, addDisposer, getEnv, walk, IModelReflectionData, IModelReflectionPropertiesData, IMaybeIType, IMaybe, IMaybeNull, IOptionalIType, OptionalDefaultValueOrFunction, ValidOptionalValue, ValidOptionalValues, getMembers, getPropertyMembers, TypeOfValue, cast, castToSnapshot, castToReferenceSnapshot, isType, isArrayType, isFrozenType, isIdentifierType, isLateType, isLiteralType, isMapType, isModelType, isOptionalType, isPrimitiveType, isReferenceType, isRefinementType, isUnionType, tryReference, isValidReference, OnReferenceInvalidated, OnReferenceInvalidatedEvent, ReferenceOptions, ReferenceOptionsGetSet, ReferenceOptionsOnInvalidated, ReferenceIdentifier, ISnapshotProcessor, ISnapshotProcessors, getNodeId, IActionContext, getRunningActionContext, isActionContextChildOf, isActionContextThisOrChildOf, types } from "./internal"; |
@@ -0,0 +0,0 @@ export * from "./core/node/livelinessChecking"; |
@@ -0,0 +0,0 @@ import { IMiddlewareEvent, IMiddlewareHandler } from "../internal"; |
@@ -0,0 +0,0 @@ import { IMiddlewareHandler, IActionContext } from "../internal"; |
@@ -0,0 +0,0 @@ import { IDisposer, IAnyStateTreeNode, IActionContext } from "../internal"; |
import { IObservableArray } from "mobx"; | ||
import { IAnyType, IType, ExtractCSTWithSTN } from "../../internal"; | ||
import { ExtractCSTWithSTN, IAnyType, IHooksGetter, IType } from "../../internal"; | ||
/** @hidden */ | ||
@@ -19,2 +19,3 @@ export interface IMSTArray<IT extends IAnyType> extends IObservableArray<IT["Type"]> { | ||
export interface IArrayType<IT extends IAnyType> extends IType<IT["CreationType"][] | undefined, IT["SnapshotType"][], IMSTArray<IT>> { | ||
hooks(hooks: IHooksGetter<IMSTArray<IAnyType>>): IArrayType<IT>; | ||
} | ||
@@ -21,0 +22,0 @@ /** |
import { IInterceptor, IKeyValueMap, IMapDidChange, IMapWillChange, Lambda } from "mobx"; | ||
import { IAnyType, IType, ExtractCSTWithSTN } from "../../internal"; | ||
import { IAnyType, IType, ExtractCSTWithSTN, IHooksGetter } from "../../internal"; | ||
/** @hidden */ | ||
export interface IMapType<IT extends IAnyType> extends IType<IKeyValueMap<IT["CreationType"]> | undefined, IKeyValueMap<IT["SnapshotType"]>, IMSTMap<IT>> { | ||
hooks(hooks: IHooksGetter<IMSTMap<IT>>): IMapType<IT>; | ||
} | ||
@@ -32,3 +33,3 @@ /** @hidden */ | ||
* Returns a shallow non observable object clone of this map. | ||
* Note that the values migth still be observable. For a deep clone use mobx.toJS. | ||
* Note that the values might still be observable. For a deep clone use mobx.toJS. | ||
*/ | ||
@@ -35,0 +36,0 @@ toJS(): Map<string, IT["Type"]>; |
@@ -43,2 +43,8 @@ import { IAnyType, IType, _CustomOrOther, _NotCustomized, Instance } from "../../internal"; | ||
/** @hidden */ | ||
export declare const $nonEmptyObject: unique symbol; | ||
/** @hidden */ | ||
export interface NonEmptyObject { | ||
[$nonEmptyObject]?: any; | ||
} | ||
/** @hidden */ | ||
export declare type ExtractCFromProps<P extends ModelProperties> = { | ||
@@ -50,3 +56,3 @@ [k in keyof P]: P[k]["CreationType"]; | ||
[P in DefinablePropsNames<PC>]: PC[P]; | ||
} & Partial<PC>; | ||
} & Partial<PC> & NonEmptyObject; | ||
/** @hidden */ | ||
@@ -57,3 +63,3 @@ export declare type ModelCreationType2<P extends ModelProperties, CustomC> = _CustomOrOther<CustomC, ModelCreationType<ExtractCFromProps<P>>>; | ||
[K in keyof P]: P[K]["SnapshotType"]; | ||
}; | ||
} & NonEmptyObject; | ||
/** @hidden */ | ||
@@ -67,3 +73,3 @@ export declare type ModelSnapshotType2<P extends ModelProperties, CustomS> = _CustomOrOther<CustomS, ModelSnapshotType<P>>; | ||
[K in keyof P]: P[K]["Type"]; | ||
}; | ||
} & NonEmptyObject; | ||
/** | ||
@@ -70,0 +76,0 @@ * @hidden |
@@ -0,0 +0,0 @@ import { enumeration, model, compose, custom, reference, safeReference, union, optional, literal, maybe, maybeNull, refinement, map, array, frozen, late, snapshotProcessor } from "../internal"; |
@@ -0,0 +0,0 @@ import { ISimpleType, IType } from "../internal"; |
@@ -0,0 +0,0 @@ import { IType } from "../../internal"; |
@@ -0,0 +0,0 @@ import { ISimpleType } from "../../internal"; |
@@ -0,0 +0,0 @@ import { IType } from "../../internal"; |
@@ -0,0 +0,0 @@ import { ISimpleType } from "../../internal"; |
@@ -0,0 +0,0 @@ import { IAnyType } from "../../internal"; |
@@ -0,0 +0,0 @@ import { ISimpleType, Primitives } from "../../internal"; |
@@ -0,0 +0,0 @@ import { IType, IAnyType } from "../../internal"; |
@@ -0,0 +0,0 @@ import { IType, IAnyType, ExtractCSTWithSTN } from "../../internal"; |
@@ -0,0 +0,0 @@ import { IType, IAnyType, IAnyStateTreeNode, IAnyComplexType, IMaybe, ReferenceIdentifier, IStateTreeNode } from "../../internal"; |
@@ -0,0 +0,0 @@ import { IAnyType } from "../../internal"; |
@@ -0,0 +0,0 @@ import { IType, IAnyType } from "../../internal"; |
@@ -0,0 +0,0 @@ import { IType, IAnyType, IModelType, ModelProperties, ModelInstanceType, ModelSnapshotType2, ModelCreationType2, _NotCustomized } from "../../internal"; |
@@ -0,0 +0,0 @@ /** |
{ | ||
"name": "mobx-state-tree", | ||
"version": "3.14.1", | ||
"version": "3.15.0", | ||
"description": "Opinionated, transactional, MobX powered state container", | ||
@@ -30,3 +30,4 @@ "main": "dist/mobx-state-tree.js", | ||
"fix-docs": "concat -o ../../docs/API/README.md ../../docs/API_header.md ../../docs/API/README.md", | ||
"build-docs": "shx rm -rf ../../docs/API && typedoc --options ./typedocconfig.js && yarn fix-docs", | ||
"fix-typedoc": "shx rm -rf ../../node_modules/typedoc/node_modules/typescript", | ||
"build-docs": "yarn run fix-typedoc && shx rm -rf ../../docs/API && typedoc --options ./typedocconfig.js && yarn fix-docs", | ||
"lint": "tslint -c ./tslint.json 'src/**/*.ts'" | ||
@@ -52,6 +53,7 @@ }, | ||
"cpr": "^3.0.1", | ||
"cross-env": "^5.2.0", | ||
"cross-env": "^6.0.3", | ||
"jest": "^24.5.0", | ||
"jest-junit": "^6.3.0", | ||
"mobx": "^5.9.0", | ||
"jest-junit": "^8.0.0", | ||
"lerna": "^3.13.1", | ||
"mobx": "^5.13.0", | ||
"rollup": "^1.6.0", | ||
@@ -64,2 +66,3 @@ "rollup-plugin-commonjs": "^10.0.0", | ||
"shx": "^0.3.2", | ||
"size-limit": "^2.1.6", | ||
"spec.ts": "^1.1.3", | ||
@@ -70,4 +73,4 @@ "ts-jest": "^24.0.0", | ||
"tslint": "^5.14.0", | ||
"typedoc": "^0.14.2", | ||
"typedoc-plugin-markdown": "^1.1.27", | ||
"typedoc": "^0.15.0", | ||
"typedoc-plugin-markdown": "^2.0.10", | ||
"typescript": "^3.5.3" | ||
@@ -86,4 +89,3 @@ }, | ||
"state management" | ||
], | ||
"gitHead": "8ef9c35db90314ceeac27d73052f01fd0f8cf9eb" | ||
] | ||
} |
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
Sorry, the diff of this file is too big to display
1139978
21735
1780
10
26
46