mobx-keystone 2.3.0 → 2.3.1
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/CHANGELOG.md +4 -0
- package/dist/mobx-keystone.esm.js +151 -312
- package/dist/mobx-keystone.esm.mjs +151 -312
- package/dist/mobx-keystone.umd.js +151 -312
- package/dist/types/action/applyAction.d.ts +1 -1
- package/dist/types/action/applyMethodCall.d.ts +1 -1
- package/dist/types/action/index.d.ts +12 -12
- package/dist/types/action/isModelAction.d.ts +1 -1
- package/dist/types/action/middleware.d.ts +1 -1
- package/dist/types/actionMiddlewares/actionSerialization/actionSerialization.d.ts +3 -3
- package/dist/types/actionMiddlewares/actionSerialization/applySerializedAction.d.ts +2 -2
- package/dist/types/actionMiddlewares/actionSerialization/arraySerializer.d.ts +2 -2
- package/dist/types/actionMiddlewares/actionSerialization/dateSerializer.d.ts +1 -1
- package/dist/types/actionMiddlewares/actionSerialization/index.d.ts +3 -3
- package/dist/types/actionMiddlewares/actionSerialization/mapSerializer.d.ts +2 -2
- package/dist/types/actionMiddlewares/actionSerialization/objectPathSerializer.d.ts +2 -2
- package/dist/types/actionMiddlewares/actionSerialization/objectSnapshotSerializer.d.ts +1 -1
- package/dist/types/actionMiddlewares/actionSerialization/plainObjectSerializer.d.ts +1 -1
- package/dist/types/actionMiddlewares/actionSerialization/primitiveSerializer.d.ts +1 -1
- package/dist/types/actionMiddlewares/actionSerialization/setSerializer.d.ts +2 -2
- package/dist/types/actionMiddlewares/actionTrackingMiddleware.d.ts +3 -3
- package/dist/types/actionMiddlewares/index.d.ts +6 -6
- package/dist/types/actionMiddlewares/onActionMiddleware.d.ts +3 -3
- package/dist/types/actionMiddlewares/readonlyMiddleware.d.ts +1 -1
- package/dist/types/actionMiddlewares/transactionMiddleware.d.ts +2 -2
- package/dist/types/actionMiddlewares/undoMiddleware.d.ts +8 -8
- package/dist/types/computedTree/index.d.ts +1 -1
- package/dist/types/context/index.d.ts +1 -1
- package/dist/types/dataModel/BaseDataModel.d.ts +3 -3
- package/dist/types/dataModel/DataModel.d.ts +3 -3
- package/dist/types/dataModel/getDataModelMetadata.d.ts +3 -3
- package/dist/types/dataModel/index.d.ts +4 -4
- package/dist/types/dataModel/utils.d.ts +1 -1
- package/dist/types/deepChange/index.d.ts +1 -1
- package/dist/types/deepChange/onDeepChange.d.ts +1 -1
- package/dist/types/frozen/Frozen.d.ts +1 -1
- package/dist/types/frozen/index.d.ts +1 -1
- package/dist/types/globalConfig/index.d.ts +1 -1
- package/dist/types/index.d.ts +24 -24
- package/dist/types/model/BaseModel.d.ts +5 -5
- package/dist/types/model/Model.d.ts +3 -3
- package/dist/types/model/getModelMetadata.d.ts +3 -3
- package/dist/types/model/index.d.ts +6 -6
- package/dist/types/model/mixins.d.ts +4 -4
- package/dist/types/model/utils.d.ts +4 -4
- package/dist/types/modelShared/BaseModelShared.d.ts +5 -5
- package/dist/types/modelShared/index.d.ts +4 -4
- package/dist/types/modelShared/modelDecorator.d.ts +3 -3
- package/dist/types/modelShared/modelInfo.d.ts +3 -3
- package/dist/types/modelShared/newModel.d.ts +3 -3
- package/dist/types/modelShared/prop.d.ts +3 -3
- package/dist/types/modelShared/sharedInternalModel.d.ts +4 -4
- package/dist/types/parent/findParent.d.ts +1 -1
- package/dist/types/parent/index.d.ts +9 -9
- package/dist/types/parent/path.d.ts +1 -1
- package/dist/types/patch/Patch.d.ts +1 -1
- package/dist/types/patch/applyPatches.d.ts +1 -1
- package/dist/types/patch/emitPatch.d.ts +1 -1
- package/dist/types/patch/index.d.ts +5 -5
- package/dist/types/patch/jsonPatch.d.ts +2 -2
- package/dist/types/patch/patchRecorder.d.ts +2 -2
- package/dist/types/redux/index.d.ts +2 -2
- package/dist/types/redux/redux.d.ts +3 -3
- package/dist/types/ref/Ref.d.ts +3 -3
- package/dist/types/ref/core.d.ts +2 -2
- package/dist/types/ref/customRef.d.ts +2 -2
- package/dist/types/ref/index.d.ts +4 -4
- package/dist/types/ref/rootRef.d.ts +2 -2
- package/dist/types/rootStore/index.d.ts +1 -1
- package/dist/types/snapshot/SnapshotOf.d.ts +5 -5
- package/dist/types/snapshot/SnapshotProcessingError.d.ts +2 -2
- package/dist/types/snapshot/applySnapshot.d.ts +1 -1
- package/dist/types/snapshot/cloneTreeValue.d.ts +1 -1
- package/dist/types/snapshot/fromSnapshot.d.ts +2 -2
- package/dist/types/snapshot/getSnapshot.d.ts +2 -2
- package/dist/types/snapshot/index.d.ts +8 -8
- package/dist/types/snapshot/onSnapshot.d.ts +1 -1
- package/dist/types/standardActions/index.d.ts +3 -3
- package/dist/types/standardActions/objectActions.d.ts +1 -1
- package/dist/types/transforms/asMap.d.ts +1 -1
- package/dist/types/transforms/asSet.d.ts +2 -2
- package/dist/types/transforms/bigint.d.ts +1 -1
- package/dist/types/transforms/date.d.ts +1 -1
- package/dist/types/transforms/index.d.ts +4 -4
- package/dist/types/treeUtils/draft.d.ts +1 -1
- package/dist/types/treeUtils/index.d.ts +3 -3
- package/dist/types/tweaker/index.d.ts +2 -2
- package/dist/types/tweaker/tweak.d.ts +1 -1
- package/dist/types/types/SnapshotTypeMismatchError.d.ts +2 -2
- package/dist/types/types/TypeCheckError.d.ts +2 -2
- package/dist/types/types/TypeChecker.d.ts +3 -3
- package/dist/types/types/arrayBased/typesArray.d.ts +2 -2
- package/dist/types/types/arrayBased/typesTuple.d.ts +2 -2
- package/dist/types/types/getTypeInfo.d.ts +2 -2
- package/dist/types/types/index.d.ts +7 -7
- package/dist/types/types/objectBased/typesArraySet.d.ts +3 -3
- package/dist/types/types/objectBased/typesDataModelData.d.ts +4 -4
- package/dist/types/types/objectBased/typesModel.d.ts +4 -4
- package/dist/types/types/objectBased/typesObject.d.ts +3 -3
- package/dist/types/types/objectBased/typesObjectMap.d.ts +3 -3
- package/dist/types/types/objectBased/typesRecord.d.ts +2 -2
- package/dist/types/types/objectBased/typesRef.d.ts +3 -3
- package/dist/types/types/primitiveBased/typesEnum.d.ts +1 -1
- package/dist/types/types/primitiveBased/typesPrimitive.d.ts +3 -3
- package/dist/types/types/primitiveBased/typesRefinedPrimitive.d.ts +2 -2
- package/dist/types/types/schemas.d.ts +5 -5
- package/dist/types/types/tProp.d.ts +4 -4
- package/dist/types/types/typeCheck.d.ts +2 -2
- package/dist/types/types/types.d.ts +39 -39
- package/dist/types/types/utility/typeToStoredData.d.ts +2 -2
- package/dist/types/types/utility/typesBigInt.d.ts +1 -1
- package/dist/types/types/utility/typesCodec.d.ts +6 -6
- package/dist/types/types/utility/typesCodecCore.d.ts +4 -4
- package/dist/types/types/utility/typesCodecSupport.d.ts +4 -4
- package/dist/types/types/utility/typesDate.d.ts +2 -2
- package/dist/types/types/utility/typesMap.d.ts +2 -2
- package/dist/types/types/utility/typesMaybe.d.ts +1 -1
- package/dist/types/types/utility/typesOr.d.ts +2 -2
- package/dist/types/types/utility/typesRefinement.d.ts +3 -3
- package/dist/types/types/utility/typesSet.d.ts +3 -3
- package/dist/types/types/utility/typesSkipCheck.d.ts +2 -2
- package/dist/types/types/utility/typesTag.d.ts +2 -2
- package/dist/types/types/utility/typesUnchecked.d.ts +2 -2
- package/dist/types/utils/ModelPool.d.ts +1 -1
- package/dist/types/wrappers/ArraySet.d.ts +1 -1
- package/dist/types/wrappers/ObjectMap.d.ts +1 -1
- package/dist/types/wrappers/asMap.d.ts +1 -1
- package/dist/types/wrappers/asSet.d.ts +1 -1
- package/dist/types/wrappers/index.d.ts +4 -4
- package/package.json +5 -18
- package/src/action/modelAction.ts +1 -1
- package/src/action/modelFlow.ts +1 -1
- package/src/dataModel/BaseDataModel.ts +5 -5
- package/src/model/BaseModel.ts +7 -6
- package/src/model/mixins.ts +1 -1
- package/src/model/newModel.ts +1 -1
- package/src/modelShared/modelDecorator.ts +4 -6
- package/src/modelShared/modelInfo.ts +2 -1
- package/src/modelShared/sharedInternalModel.ts +1 -1
- package/src/ref/Ref.ts +1 -1
- package/src/snapshot/SnapshotterAndReconcilerPriority.ts +2 -1
- package/src/snapshot/fromModelSnapshot.ts +1 -1
- package/src/snapshot/fromSnapshot.ts +1 -1
- package/src/transforms/ImmutableDate.ts +19 -19
- package/src/tweaker/tweakArray.ts +1 -1
- package/src/tweaker/tweakFrozen.ts +1 -1
- package/src/tweaker/tweakModel.ts +1 -1
- package/src/tweaker/tweakPlainObject.ts +1 -1
- package/src/types/arrayBased/typesArray.ts +1 -1
- package/src/types/arrayBased/typesTuple.ts +1 -1
- package/src/types/objectBased/typesArraySet.ts +1 -1
- package/src/types/objectBased/typesModel.ts +2 -2
- package/src/types/objectBased/typesObject.ts +1 -1
- package/src/types/objectBased/typesObjectMap.ts +1 -1
- package/src/types/objectBased/typesRecord.ts +1 -1
- package/src/types/objectBased/typesRef.ts +2 -2
- package/src/types/primitiveBased/typesPrimitive.ts +1 -1
- package/src/types/schemas.ts +1 -1
- package/src/types/utility/typesCodecCore.ts +1 -1
- package/src/types/utility/typesCodecSupport.ts +2 -0
- package/src/types/utility/typesOr.ts +2 -2
- package/src/types/utility/typesRefinement.ts +1 -1
- package/src/utils/index.ts +20 -13
- package/src/wrappers/ArraySet.ts +3 -5
- package/src/wrappers/ObjectMap.ts +3 -5
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
1
|
+
export * from "./applyAction";
|
|
2
|
+
export * from "./applyDelete";
|
|
3
|
+
export * from "./applyMethodCall";
|
|
4
|
+
export * from "./applySet";
|
|
5
|
+
export * from "./builtInActions";
|
|
6
|
+
export * from "./context";
|
|
7
|
+
export * from "./hookActions";
|
|
8
|
+
export * from "./isModelAction";
|
|
9
|
+
export * from "./middleware";
|
|
10
|
+
export * from "./modelAction";
|
|
11
|
+
export * from "./modelFlow";
|
|
12
|
+
export * from "./runUnprotected";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ActionCall } from
|
|
2
|
-
import { JSONPrimitiveValue } from
|
|
3
|
-
import { ActionCallArgumentSerializer } from
|
|
1
|
+
import type { ActionCall } from "../../action/applyAction";
|
|
2
|
+
import type { JSONPrimitiveValue } from "../../utils/types";
|
|
3
|
+
import { type ActionCallArgumentSerializer } from "./core";
|
|
4
4
|
/**
|
|
5
5
|
* Registers a new action call argument serializers.
|
|
6
6
|
* Serializers are called in the inverse order they are registered, meaning the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Patch } from
|
|
2
|
-
import { SerializedActionCall } from
|
|
1
|
+
import type { Patch } from "../../patch/Patch";
|
|
2
|
+
import { type SerializedActionCall } from "./actionSerialization";
|
|
3
3
|
/**
|
|
4
4
|
* Serialized action call with model ID overrides.
|
|
5
5
|
* Can be generated with `applySerializedActionAndTrackNewModelIds`.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IObservableArray } from
|
|
2
|
-
import { ActionCallArgumentSerializer } from
|
|
1
|
+
import type { IObservableArray } from "mobx";
|
|
2
|
+
import { type ActionCallArgumentSerializer } from "./core";
|
|
3
3
|
export declare const arraySerializer: ActionCallArgumentSerializer<any[] | IObservableArray<any>, any[]>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ActionCallArgumentSerializer } from
|
|
1
|
+
import { type ActionCallArgumentSerializer } from "./core";
|
|
2
2
|
export declare const dateSerializer: ActionCallArgumentSerializer<Date, number | null>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from "./actionSerialization";
|
|
2
|
+
export * from "./applySerializedAction";
|
|
3
|
+
export * from "./core";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ObservableMap } from
|
|
2
|
-
import { ActionCallArgumentSerializer } from
|
|
1
|
+
import { type ObservableMap } from "mobx";
|
|
2
|
+
import { type ActionCallArgumentSerializer } from "./core";
|
|
3
3
|
export declare const mapSerializer: ActionCallArgumentSerializer<Map<any, any> | ObservableMap<any, any>, [
|
|
4
4
|
any,
|
|
5
5
|
any
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Path } from
|
|
2
|
-
import { ActionCallArgumentSerializer } from
|
|
1
|
+
import type { Path } from "../../parent/pathTypes";
|
|
2
|
+
import { type ActionCallArgumentSerializer } from "./core";
|
|
3
3
|
interface ObjectPath {
|
|
4
4
|
targetPath: Path;
|
|
5
5
|
targetPathIds: (string | null)[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ActionCallArgumentSerializer } from
|
|
1
|
+
import { type ActionCallArgumentSerializer } from "./core";
|
|
2
2
|
export declare const objectSnapshotSerializer: ActionCallArgumentSerializer<object, object>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ActionCallArgumentSerializer } from
|
|
1
|
+
import { type ActionCallArgumentSerializer } from "./core";
|
|
2
2
|
export declare const plainObjectSerializer: ActionCallArgumentSerializer<object, object>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ActionCallArgumentSerializer } from
|
|
1
|
+
import { type ActionCallArgumentSerializer } from "./core";
|
|
2
2
|
export declare const primitiveSerializer: ActionCallArgumentSerializer<number | bigint | undefined, string>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ObservableSet } from
|
|
2
|
-
import { ActionCallArgumentSerializer } from
|
|
1
|
+
import { type ObservableSet } from "mobx";
|
|
2
|
+
import { type ActionCallArgumentSerializer } from "./core";
|
|
3
3
|
export declare const setSerializer: ActionCallArgumentSerializer<Set<any> | ObservableSet<any>, any[]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ActionContext, ActionContextActionType } from
|
|
2
|
-
import { ActionMiddlewareDisposer } from
|
|
3
|
-
import { AnyModel } from
|
|
1
|
+
import { type ActionContext, ActionContextActionType } from "../action/context";
|
|
2
|
+
import { type ActionMiddlewareDisposer } from "../action/middleware";
|
|
3
|
+
import type { AnyModel } from "../model/BaseModel";
|
|
4
4
|
/**
|
|
5
5
|
* Simplified version of action context.
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
1
|
+
export * from "./actionSerialization";
|
|
2
|
+
export * from "./actionTrackingMiddleware";
|
|
3
|
+
export * from "./onActionMiddleware";
|
|
4
|
+
export * from "./readonlyMiddleware";
|
|
5
|
+
export * from "./transactionMiddleware";
|
|
6
|
+
export * from "./undoMiddleware";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ActionCall } from
|
|
2
|
-
import { ActionMiddlewareDisposer } from
|
|
3
|
-
import { ActionTrackingReturn, SimpleActionContext } from
|
|
1
|
+
import type { ActionCall } from "../action/applyAction";
|
|
2
|
+
import type { ActionMiddlewareDisposer } from "../action/middleware";
|
|
3
|
+
import { type ActionTrackingReturn, type SimpleActionContext } from "./actionTrackingMiddleware";
|
|
4
4
|
/**
|
|
5
5
|
* Attaches an action middleware that invokes a listener for all actions of a given tree.
|
|
6
6
|
* Note that the listener will only be invoked for the topmost level actions, so it won't run for child actions or intermediary flow steps.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ActionMiddlewareDisposer } from
|
|
2
|
-
import { AnyModel } from
|
|
1
|
+
import type { ActionMiddlewareDisposer } from "../action/middleware";
|
|
2
|
+
import type { AnyModel } from "../model/BaseModel";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a transaction middleware, which reverts changes made by an action / child
|
|
5
5
|
* actions when the root action throws an exception, restoring the values those changes replaced.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ActionMiddlewareDisposer } from
|
|
2
|
-
import { Frozen } from
|
|
3
|
-
import { Path } from
|
|
4
|
-
import { Patch } from
|
|
5
|
-
import { FrozenData } from
|
|
1
|
+
import type { ActionMiddlewareDisposer } from "../action/middleware";
|
|
2
|
+
import { type Frozen } from "../frozen";
|
|
3
|
+
import type { Path } from "../parent/pathTypes";
|
|
4
|
+
import { type Patch } from "../patch";
|
|
5
|
+
import type { FrozenData } from "../snapshot";
|
|
6
6
|
/**
|
|
7
7
|
* An undo/redo event without attached state.
|
|
8
8
|
*/
|
|
@@ -76,9 +76,9 @@ export interface UndoEventGroup {
|
|
|
76
76
|
*/
|
|
77
77
|
readonly events: ReadonlyArray<UndoEventWithoutAttachedState>;
|
|
78
78
|
}
|
|
79
|
-
declare const UndoStore_base: import(
|
|
80
|
-
undoEvents: import(
|
|
81
|
-
redoEvents: import(
|
|
79
|
+
declare const UndoStore_base: import("..")._Model<unknown, {
|
|
80
|
+
undoEvents: import("..").TypedOptionalModelProp<import("..").ArrayType<import("..").ModelType<Frozen<UndoEvent>>[]>>;
|
|
81
|
+
redoEvents: import("..").TypedOptionalModelProp<import("..").ArrayType<import("..").ModelType<Frozen<UndoEvent>>[]>>;
|
|
82
82
|
}, {
|
|
83
83
|
undoEvents?: ReadonlyArray<UndoEvent | FrozenData<UndoEvent>>;
|
|
84
84
|
redoEvents?: ReadonlyArray<UndoEvent | FrozenData<UndoEvent>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./computedTree";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./context";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { propsTypeSymbol } from
|
|
2
|
-
import { ModelProps, ModelPropsToTransformedCreationData, ModelPropsToUntransformedCreationData, ModelPropsToUntransformedData } from
|
|
3
|
-
import { TypeCheckError } from
|
|
1
|
+
import { type propsTypeSymbol } from "../modelShared/BaseModelShared";
|
|
2
|
+
import { type ModelProps, type ModelPropsToTransformedCreationData, type ModelPropsToUntransformedCreationData, type ModelPropsToUntransformedData } from "../modelShared/prop";
|
|
3
|
+
import type { TypeCheckError } from "../types/TypeCheckError";
|
|
4
4
|
/**
|
|
5
5
|
* Base abstract class for data models. Use `DataModel` instead when extending.
|
|
6
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AbstractModelClass, ModelCreationData, ModelUntransformedCreationData } from
|
|
2
|
-
import { ModelProps, ModelPropsToSetter, ModelPropsToTransformedCreationData, ModelPropsToTransformedData, ModelPropsToUntransformedCreationData } from
|
|
3
|
-
import { AnyDataModel, BaseDataModel, BaseDataModelKeys } from
|
|
1
|
+
import type { AbstractModelClass, ModelCreationData, ModelUntransformedCreationData } from "../modelShared/BaseModelShared";
|
|
2
|
+
import type { ModelProps, ModelPropsToSetter, ModelPropsToTransformedCreationData, ModelPropsToTransformedData, ModelPropsToUntransformedCreationData } from "../modelShared/prop";
|
|
3
|
+
import type { AnyDataModel, BaseDataModel, BaseDataModelKeys } from "./BaseDataModel";
|
|
4
4
|
export type _ComposedData<SuperModel, TProps extends ModelProps> = SuperModel extends AnyDataModel ? (ModelPropsToUntransformedCreationData<TProps> & ModelUntransformedCreationData<SuperModel>) | (ModelPropsToTransformedCreationData<TProps> & ModelCreationData<SuperModel>) : ModelPropsToUntransformedCreationData<TProps> | ModelPropsToTransformedCreationData<TProps>;
|
|
5
5
|
export interface _DataModel<SuperModel, TProps extends ModelProps> {
|
|
6
6
|
new (data: _ComposedData<SuperModel, TProps>): SuperModel & BaseDataModel<TProps> & Omit<ModelPropsToTransformedData<TProps>, BaseDataModelKeys> & ModelPropsToSetter<TProps>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ModelClass } from
|
|
2
|
-
import { AnyType } from
|
|
3
|
-
import { AnyDataModel } from
|
|
1
|
+
import type { ModelClass } from "../modelShared/BaseModelShared";
|
|
2
|
+
import type { AnyType } from "../types/schemas";
|
|
3
|
+
import type { AnyDataModel } from "./BaseDataModel";
|
|
4
4
|
/**
|
|
5
5
|
* Associated data model metadata.
|
|
6
6
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
1
|
+
export * from "./BaseDataModel";
|
|
2
|
+
export * from "./DataModel";
|
|
3
|
+
export * from "./getDataModelMetadata";
|
|
4
|
+
export * from "./utils";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./onDeepChange";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./Frozen";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./globalConfig";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
23
|
-
export * from
|
|
24
|
-
export * from
|
|
1
|
+
export * from "./action";
|
|
2
|
+
export * from "./actionMiddlewares";
|
|
3
|
+
export * from "./computedTree";
|
|
4
|
+
export * from "./context";
|
|
5
|
+
export * from "./dataModel";
|
|
6
|
+
export * from "./deepChange";
|
|
7
|
+
export * from "./frozen";
|
|
8
|
+
export * from "./globalConfig";
|
|
9
|
+
export * from "./model";
|
|
10
|
+
export * from "./modelShared";
|
|
11
|
+
export * from "./parent";
|
|
12
|
+
export * from "./patch";
|
|
13
|
+
export * from "./redux";
|
|
14
|
+
export * from "./ref";
|
|
15
|
+
export * from "./rootStore";
|
|
16
|
+
export * from "./snapshot";
|
|
17
|
+
export * from "./standardActions";
|
|
18
|
+
export * from "./transforms";
|
|
19
|
+
export * from "./treeUtils";
|
|
20
|
+
export * from "./tweaker";
|
|
21
|
+
export * from "./types";
|
|
22
|
+
export * from "./utils";
|
|
23
|
+
export * from "./utils/tag";
|
|
24
|
+
export * from "./wrappers";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { fromSnapshotOverrideTypeSymbol, ModelClass, propsTypeSymbol, toSnapshotOverrideTypeSymbol } from
|
|
2
|
-
import { ModelProps, ModelPropsToTransformedCreationData, ModelPropsToUntransformedData } from
|
|
3
|
-
import { SnapshotInOfModel, SnapshotOutOfModel } from
|
|
4
|
-
import { TypeCheckError } from
|
|
5
|
-
import { modelIdKey, modelTypeKey } from
|
|
1
|
+
import { type fromSnapshotOverrideTypeSymbol, type ModelClass, type propsTypeSymbol, type toSnapshotOverrideTypeSymbol } from "../modelShared/BaseModelShared";
|
|
2
|
+
import type { ModelProps, ModelPropsToTransformedCreationData, ModelPropsToUntransformedData } from "../modelShared/prop";
|
|
3
|
+
import type { SnapshotInOfModel, SnapshotOutOfModel } from "../snapshot/SnapshotOf";
|
|
4
|
+
import type { TypeCheckError } from "../types/TypeCheckError";
|
|
5
|
+
import { modelIdKey, modelTypeKey } from "./metadata";
|
|
6
6
|
/**
|
|
7
7
|
* @ignore
|
|
8
8
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AbstractModelClass, ModelCreationData } from
|
|
2
|
-
import { ModelProps, ModelPropsToSetter, ModelPropsToSnapshotCreationData, ModelPropsToSnapshotData, ModelPropsToTransformedCreationData, ModelPropsToTransformedData } from
|
|
3
|
-
import { AnyModel, BaseModel, BaseModelKeys, ModelIdPropertyName } from
|
|
1
|
+
import type { AbstractModelClass, ModelCreationData } from "../modelShared/BaseModelShared";
|
|
2
|
+
import type { ModelProps, ModelPropsToSetter, ModelPropsToSnapshotCreationData, ModelPropsToSnapshotData, ModelPropsToTransformedCreationData, ModelPropsToTransformedData } from "../modelShared/prop";
|
|
3
|
+
import type { AnyModel, BaseModel, BaseModelKeys, ModelIdPropertyName } from "./BaseModel";
|
|
4
4
|
export type _ComposedCreationData<SuperModel, TProps extends ModelProps> = SuperModel extends AnyModel ? ModelPropsToTransformedCreationData<TProps> & ModelCreationData<SuperModel> : ModelPropsToTransformedCreationData<TProps>;
|
|
5
5
|
/**
|
|
6
6
|
* The default type used by fromSnapshot before processors are applied.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ModelClass } from
|
|
2
|
-
import { AnyType } from
|
|
3
|
-
import { AnyModel } from
|
|
1
|
+
import type { ModelClass } from "../modelShared/BaseModelShared";
|
|
2
|
+
import type { AnyType } from "../types/schemas";
|
|
3
|
+
import type { AnyModel } from "./BaseModel";
|
|
4
4
|
/**
|
|
5
5
|
* Associated model metadata.
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
1
|
+
export * from "./BaseModel";
|
|
2
|
+
export * from "./getModelMetadata";
|
|
3
|
+
export * from "./Model";
|
|
4
|
+
export * from "./metadata";
|
|
5
|
+
export * from "./mixins";
|
|
6
|
+
export * from "./utils";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AbstractModelClass, ModelClass, propsTypeSymbol } from
|
|
2
|
-
import { ModelProps, ModelPropsToTransformedData } from
|
|
3
|
-
import { AnyModel, BaseModelKeys } from
|
|
1
|
+
import { type AbstractModelClass, type ModelClass, type propsTypeSymbol } from "../modelShared/BaseModelShared";
|
|
2
|
+
import type { ModelProps, ModelPropsToTransformedData } from "../modelShared/prop";
|
|
3
|
+
import type { AnyModel, BaseModelKeys } from "./BaseModel";
|
|
4
4
|
type ReqObj<Req> = [unknown] extends [Req] ? unknown : Req extends object ? Req : never;
|
|
5
5
|
declare const reqMarkerBrand: unique symbol;
|
|
6
6
|
/**
|
|
@@ -130,7 +130,7 @@ export declare function defineModelMixin<MP extends ModelProps, C extends Abstra
|
|
|
130
130
|
* )
|
|
131
131
|
*/
|
|
132
132
|
export declare function defineModelMixin<Req extends object, MP extends ModelProps, C extends AbstractModelClass<AnyModel & ModelPropsToTransformedData<MP>>>(props: MP, requirement: ReqMarker<Req>, build: (base: AbstractModelClass<AnyModel & ModelPropsToTransformedData<MP> & Req>) => C): ModelMixin<Omit<InstanceType<C>, BaseModelKeys>, Req, MP>;
|
|
133
|
-
declare const MixinEmptyBase_base: import(
|
|
133
|
+
declare const MixinEmptyBase_base: import("./Model")._Model<unknown, {}, never, never>;
|
|
134
134
|
declare class MixinEmptyBase extends MixinEmptyBase_base {
|
|
135
135
|
}
|
|
136
136
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AnyDataModel } from
|
|
2
|
-
import { ModelClass } from
|
|
3
|
-
import { ModelInfo } from
|
|
4
|
-
import { AnyModel } from
|
|
1
|
+
import type { AnyDataModel } from "../dataModel/BaseDataModel";
|
|
2
|
+
import type { ModelClass } from "../modelShared/BaseModelShared";
|
|
3
|
+
import { type ModelInfo } from "../modelShared/modelInfo";
|
|
4
|
+
import { type AnyModel } from "./BaseModel";
|
|
5
5
|
/**
|
|
6
6
|
* Checks if an object is a model instance.
|
|
7
7
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AnyDataModel } from
|
|
2
|
-
import { AnyModel } from
|
|
3
|
-
import { modelTypeKey } from
|
|
4
|
-
import { Flatten, IsNeverType } from
|
|
5
|
-
import { ModelProps, ModelPropsToSnapshotCreationData, ModelPropsToSnapshotData, ModelPropsToTransformedCreationData, ModelPropsToTransformedData, ModelPropsToUntransformedCreationData } from
|
|
1
|
+
import type { AnyDataModel } from "../dataModel/BaseDataModel";
|
|
2
|
+
import type { AnyModel } from "../model/BaseModel";
|
|
3
|
+
import type { modelTypeKey } from "../model/metadata";
|
|
4
|
+
import type { Flatten, IsNeverType } from "../utils/types";
|
|
5
|
+
import type { ModelProps, ModelPropsToSnapshotCreationData, ModelPropsToSnapshotData, ModelPropsToTransformedCreationData, ModelPropsToTransformedData, ModelPropsToUntransformedCreationData } from "./prop";
|
|
6
6
|
/**
|
|
7
7
|
* @ignore
|
|
8
8
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
1
|
+
export * from "./BaseModelShared";
|
|
2
|
+
export * from "./modelDecorator";
|
|
3
|
+
export * from "./modelInfo";
|
|
4
|
+
export * from "./prop";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AnyDataModel } from
|
|
2
|
-
import { AnyModel } from
|
|
3
|
-
import { AnyFunction } from
|
|
1
|
+
import type { AnyDataModel } from "../dataModel/BaseDataModel";
|
|
2
|
+
import type { AnyModel } from "../model/BaseModel";
|
|
3
|
+
import type { AnyFunction } from "../utils/AnyFunction";
|
|
4
4
|
/**
|
|
5
5
|
* Decorator that marks this class (which MUST inherit from the `Model` or `DataModel` abstract classes)
|
|
6
6
|
* as a model.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AnyDataModel } from
|
|
2
|
-
import { AnyModel } from
|
|
3
|
-
import { ModelClass } from
|
|
1
|
+
import type { AnyDataModel } from "../dataModel/BaseDataModel";
|
|
2
|
+
import type { AnyModel } from "../model/BaseModel";
|
|
3
|
+
import type { ModelClass } from "./BaseModelShared";
|
|
4
4
|
/**
|
|
5
5
|
* Information about a registered model.
|
|
6
6
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyDataModel } from
|
|
2
|
-
import { AnyModel } from
|
|
3
|
-
import { ModelClass } from
|
|
1
|
+
import type { AnyDataModel } from "../dataModel/BaseDataModel";
|
|
2
|
+
import type { AnyModel } from "../model/BaseModel";
|
|
3
|
+
import type { ModelClass } from "../modelShared/BaseModelShared";
|
|
4
4
|
export declare function applyModelInitializers(modelClass: ModelClass<AnyModel | AnyDataModel>, modelObj: any): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SnapshotInOf, SnapshotOutOf } from
|
|
2
|
-
import { AnyStandardType } from
|
|
3
|
-
import { IsNeverType, IsOptionalValue, SimplifyObject } from
|
|
1
|
+
import type { SnapshotInOf, SnapshotOutOf } from "../snapshot/SnapshotOf";
|
|
2
|
+
import type { AnyStandardType } from "../types/schemas";
|
|
3
|
+
import type { IsNeverType, IsOptionalValue, SimplifyObject } from "../utils/types";
|
|
4
4
|
/**
|
|
5
5
|
* @ignore
|
|
6
6
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AnyDataModel } from
|
|
2
|
-
import { AnyModel } from
|
|
3
|
-
import { ModelClass } from
|
|
4
|
-
import { ModelProps } from
|
|
1
|
+
import { type AnyDataModel } from "../dataModel/BaseDataModel";
|
|
2
|
+
import { type AnyModel } from "../model/BaseModel";
|
|
3
|
+
import { type ModelClass } from "./BaseModelShared";
|
|
4
|
+
import { type ModelProps } from "./prop";
|
|
5
5
|
type FromSnapshotProcessorFn = (sn: any) => any;
|
|
6
6
|
type ToSnapshotProcessorFn = (sn: any, instance: any) => any;
|
|
7
7
|
export declare function sharedInternalModel<TProps extends ModelProps, TBaseModel extends AnyModel | AnyDataModel>({ modelProps, baseModel, type, valueType, fromSnapshotProcessor, toSnapshotProcessor, }: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
1
|
+
export * from "./detach";
|
|
2
|
+
export * from "./findChildren";
|
|
3
|
+
export * from "./findParent";
|
|
4
|
+
export * from "./getChildrenObjects";
|
|
5
|
+
export * from "./onChildAttachedTo";
|
|
6
|
+
export * from "./path";
|
|
7
|
+
export * from "./path2";
|
|
8
|
+
export * from "./pathTypes";
|
|
9
|
+
export * from "./walkTree";
|