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,5 +1,5 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
1
|
+
export * from "./applyPatches";
|
|
2
|
+
export * from "./emitPatch";
|
|
3
|
+
export * from "./jsonPatch";
|
|
4
|
+
export * from "./Patch";
|
|
5
|
+
export * from "./patchRecorder";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Path } from
|
|
2
|
-
import { Patch } from
|
|
1
|
+
import type { Path } from "../parent/pathTypes";
|
|
2
|
+
import type { Patch } from "./Patch";
|
|
3
3
|
export type JsonPatch = JsonPatchAddOperation<any> | JsonPatchRemoveOperation | JsonPatchReplaceOperation<any>;
|
|
4
4
|
export interface JsonPatchBaseOperation {
|
|
5
5
|
path: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from "./connectReduxDevTools";
|
|
2
|
+
export * from "./redux";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ActionCall } from
|
|
2
|
-
import { OnSnapshotDisposer, OnSnapshotListener } from
|
|
3
|
-
import { SnapshotOutOf } from
|
|
1
|
+
import { type ActionCall } from "../action";
|
|
2
|
+
import { type OnSnapshotDisposer, type OnSnapshotListener } from "../snapshot/onSnapshot";
|
|
3
|
+
import type { SnapshotOutOf } from "../snapshot/SnapshotOf";
|
|
4
4
|
export declare const reduxActionType = "applyAction";
|
|
5
5
|
/**
|
|
6
6
|
* A redux action for mobx-keystone.
|
package/dist/types/ref/Ref.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ModelClass } from
|
|
2
|
-
declare const Ref_base: import(
|
|
1
|
+
import type { ModelClass } from "../modelShared/BaseModelShared";
|
|
2
|
+
declare const Ref_base: import("..")._Model<unknown, {
|
|
3
3
|
/**
|
|
4
4
|
* Reference id.
|
|
5
5
|
*/
|
|
6
|
-
id: import(
|
|
6
|
+
id: import("..").TypedMaybeOptionalModelProp<import("..").IdentityType<string>>;
|
|
7
7
|
}, never, never>;
|
|
8
8
|
/**
|
|
9
9
|
* A reference model base type.
|
package/dist/types/ref/core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RefIdResolver, RefOnResolvedValueChange, RefResolver } from
|
|
2
|
-
import { RefConstructor } from
|
|
1
|
+
import { type RefIdResolver, type RefOnResolvedValueChange, type RefResolver } from "./core";
|
|
2
|
+
import type { RefConstructor } from "./Ref";
|
|
3
3
|
/**
|
|
4
4
|
* Custom reference options.
|
|
5
5
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
1
|
+
export * from "./core";
|
|
2
|
+
export * from "./customRef";
|
|
3
|
+
export * from "./Ref";
|
|
4
|
+
export * from "./rootRef";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RefIdResolver, RefOnResolvedValueChange } from
|
|
2
|
-
import { RefConstructor } from
|
|
1
|
+
import { type RefIdResolver, type RefOnResolvedValueChange } from "./core";
|
|
2
|
+
import type { RefConstructor } from "./Ref";
|
|
3
3
|
/**
|
|
4
4
|
* Custom reference options.
|
|
5
5
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./rootStore";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Frozen, frozenKey } from
|
|
2
|
-
import { AnyModel } from
|
|
3
|
-
import { modelIdKey, modelTypeKey } from
|
|
4
|
-
import { ModelFromSnapshot, ModelToSnapshot } from
|
|
5
|
-
import { ArraySet, ObjectMap } from
|
|
1
|
+
import type { Frozen, frozenKey } from "../frozen/Frozen";
|
|
2
|
+
import type { AnyModel } from "../model/BaseModel";
|
|
3
|
+
import type { modelIdKey, modelTypeKey } from "../model/metadata";
|
|
4
|
+
import type { ModelFromSnapshot, ModelToSnapshot } from "../modelShared/BaseModelShared";
|
|
5
|
+
import type { ArraySet, ObjectMap } from "../wrappers";
|
|
6
6
|
export type FrozenData<D> = {
|
|
7
7
|
[frozenKey]: true;
|
|
8
8
|
data: D;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Path } from
|
|
2
|
-
import { MobxKeystoneError } from
|
|
1
|
+
import type { Path } from "../parent/pathTypes";
|
|
2
|
+
import { MobxKeystoneError } from "../utils";
|
|
3
3
|
export interface SnapshotProcessingErrorData {
|
|
4
4
|
message: string;
|
|
5
5
|
path?: Path;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SnapshotInOf, SnapshotOutOf } from
|
|
1
|
+
import type { SnapshotInOf, SnapshotOutOf } from "./SnapshotOf";
|
|
2
2
|
/**
|
|
3
3
|
* Applies a full snapshot over an object, reconciling it with the current contents of the object.
|
|
4
4
|
* If it throws, the changes it made are rolled back (errors thrown by listeners do not roll them back).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyType, TypeToData, TypeToSnapshotIn, TypeToSnapshotOut } from
|
|
2
|
-
import { SnapshotInOf, SnapshotOutOf } from
|
|
1
|
+
import type { AnyType, TypeToData, TypeToSnapshotIn, TypeToSnapshotOut } from "../types/schemas";
|
|
2
|
+
import type { SnapshotInOf, SnapshotOutOf } from "./SnapshotOf";
|
|
3
3
|
/**
|
|
4
4
|
* From snapshot options.
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyType, TypeToData, TypeToSnapshotOut } from
|
|
2
|
-
import { SnapshotOutOf } from
|
|
1
|
+
import type { AnyType, TypeToData, TypeToSnapshotOut } from "../types/schemas";
|
|
2
|
+
import type { SnapshotOutOf } from "./SnapshotOf";
|
|
3
3
|
/**
|
|
4
4
|
* Retrieves an immutable snapshot for a data structure.
|
|
5
5
|
* Since returned snapshots are immutable they will respect shallow equality, this is,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
1
|
+
export * from "./applySnapshot";
|
|
2
|
+
export * from "./clone";
|
|
3
|
+
export * from "./cloneTreeValue";
|
|
4
|
+
export * from "./fromSnapshot";
|
|
5
|
+
export * from "./getSnapshot";
|
|
6
|
+
export * from "./onSnapshot";
|
|
7
|
+
export * from "./SnapshotOf";
|
|
8
|
+
export * from "./SnapshotProcessingError";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from "./arrayActions";
|
|
2
|
+
export * from "./objectActions";
|
|
3
|
+
export * from "./standaloneActions";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyFunction } from
|
|
1
|
+
import type { AnyFunction } from "../utils/AnyFunction";
|
|
2
2
|
export declare const objectActions: {
|
|
3
3
|
set: <T extends object, K extends keyof T>(target: T, key: K, value: T[K]) => void;
|
|
4
4
|
assign: <T extends object>(target: T, partialObject: Partial<T>) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModelPropTransform } from
|
|
1
|
+
import type { ModelPropTransform } from "../modelShared/prop";
|
|
2
2
|
/**
|
|
3
3
|
* @deprecated Prefer the codec equivalent: `tProp(types.mapFromObject(valueType))`.
|
|
4
4
|
* Use `tProp(types.skipCheck(types.mapFromObject(valueType)))` if you don't need runtime validation.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ObservableSet } from
|
|
2
|
-
import { ModelPropTransform } from
|
|
1
|
+
import type { ObservableSet } from "mobx";
|
|
2
|
+
import type { ModelPropTransform } from "../modelShared/prop";
|
|
3
3
|
/**
|
|
4
4
|
* @deprecated Prefer the codec equivalent: `tProp(types.setFromArray(valueType))`.
|
|
5
5
|
* Use `tProp(types.skipCheck(types.setFromArray(valueType)))` if you don't need runtime validation.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModelPropTransform } from
|
|
1
|
+
import type { ModelPropTransform } from "../modelShared/prop";
|
|
2
2
|
/**
|
|
3
3
|
* @deprecated Prefer the codec equivalent: `tProp(types.bigint)`.
|
|
4
4
|
* Use `tProp(types.skipCheck(types.bigint))` if you don't need runtime validation.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModelPropTransform } from
|
|
1
|
+
import type { ModelPropTransform } from "../modelShared/prop";
|
|
2
2
|
/**
|
|
3
3
|
* @deprecated Prefer the codec equivalent: `tProp(types.dateAsTimestamp)`.
|
|
4
4
|
* Use `tProp(types.skipCheck(types.dateAsTimestamp))` if you don't need runtime validation.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
1
|
+
export * from "./asMap";
|
|
2
|
+
export * from "./asSet";
|
|
3
|
+
export * from "./bigint";
|
|
4
|
+
export * from "./date";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from "./deepEquals";
|
|
2
|
+
export * from "./draft";
|
|
3
|
+
export * from "./sandbox";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from "./core";
|
|
2
|
+
export * from "./tweak";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Path } from
|
|
2
|
-
import { MobxKeystoneError } from
|
|
1
|
+
import type { Path } from "../parent/pathTypes";
|
|
2
|
+
import { MobxKeystoneError } from "../utils";
|
|
3
3
|
export interface SnapshotTypeMismatchErrorData {
|
|
4
4
|
path?: Path;
|
|
5
5
|
expectedTypeName: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Path } from
|
|
2
|
-
import { MobxKeystoneError } from
|
|
1
|
+
import type { Path } from "../parent/pathTypes";
|
|
2
|
+
import { MobxKeystoneError } from "../utils";
|
|
3
3
|
export interface TypeCheckErrorData {
|
|
4
4
|
/** Path relative to the value being type checked. */
|
|
5
5
|
path: Path;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Path } from
|
|
2
|
-
import { AnyStandardType } from
|
|
3
|
-
import { TypeCheckError } from
|
|
1
|
+
import type { Path } from "../parent/pathTypes";
|
|
2
|
+
import type { AnyStandardType } from "./schemas";
|
|
3
|
+
import type { TypeCheckError } from "./TypeCheckError";
|
|
4
4
|
type CheckFunction = (value: any, path: Path, typeCheckedValue: any) => TypeCheckError | null;
|
|
5
5
|
/** @ignore */
|
|
6
6
|
export type SnapshotProcessor = (snapshot: any) => unknown;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyStandardType, AnyType, ArrayType } from
|
|
2
|
-
import { TypeInfo } from
|
|
1
|
+
import type { AnyStandardType, AnyType, ArrayType } from "../schemas";
|
|
2
|
+
import { TypeInfo } from "../TypeChecker";
|
|
3
3
|
/**
|
|
4
4
|
* A type that represents an array of values of a given type.
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyStandardType, AnyType, ArrayType } from
|
|
2
|
-
import { TypeInfo } from
|
|
1
|
+
import type { AnyStandardType, AnyType, ArrayType } from "../schemas";
|
|
2
|
+
import { TypeInfo } from "../TypeChecker";
|
|
3
3
|
/**
|
|
4
4
|
* A type that represents an tuple of values of a given type.
|
|
5
5
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export { typeCheck } from
|
|
6
|
-
export * from
|
|
7
|
-
export type { CodecFromEncoded } from
|
|
1
|
+
export * from "./SnapshotTypeMismatchError";
|
|
2
|
+
export * from "./schemas";
|
|
3
|
+
export * from "./TypeCheckError";
|
|
4
|
+
export * from "./tProp";
|
|
5
|
+
export { typeCheck } from "./typeCheck";
|
|
6
|
+
export * from "./types";
|
|
7
|
+
export type { CodecFromEncoded } from "./utility/typesCodecCore";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ArraySet } from
|
|
2
|
-
import { AnyStandardType, AnyType, ModelType, TypeToData } from
|
|
3
|
-
import { TypeInfo } from
|
|
1
|
+
import { ArraySet } from "../../wrappers/ArraySet";
|
|
2
|
+
import type { AnyStandardType, AnyType, ModelType, TypeToData } from "../schemas";
|
|
3
|
+
import { TypeInfo } from "../TypeChecker";
|
|
4
4
|
/**
|
|
5
5
|
* A type that represents an array backed set ArraySet.
|
|
6
6
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AnyDataModel } from
|
|
2
|
-
import { ModelClass, ModelData, ModelUntransformedData } from
|
|
3
|
-
import { AnyStandardType, IdentityType } from
|
|
4
|
-
import { TypeInfo } from
|
|
1
|
+
import type { AnyDataModel } from "../../dataModel/BaseDataModel";
|
|
2
|
+
import type { ModelClass, ModelData, ModelUntransformedData } from "../../modelShared/BaseModelShared";
|
|
3
|
+
import type { AnyStandardType, IdentityType } from "../schemas";
|
|
4
|
+
import { TypeInfo } from "../TypeChecker";
|
|
5
5
|
type _Class<T> = abstract new (...args: any[]) => T;
|
|
6
6
|
type _ClassOrObject<M, K> = K extends M ? object : _Class<K> | (() => _Class<K>);
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AnyModel } from
|
|
2
|
-
import { ModelClass } from
|
|
3
|
-
import { AnyStandardType, ModelType } from
|
|
4
|
-
import { TypeInfo } from
|
|
1
|
+
import type { AnyModel } from "../../model/BaseModel";
|
|
2
|
+
import type { ModelClass } from "../../modelShared/BaseModelShared";
|
|
3
|
+
import type { AnyStandardType, ModelType } from "../schemas";
|
|
4
|
+
import { TypeInfo } from "../TypeChecker";
|
|
5
5
|
type _Class<T> = abstract new (...args: any[]) => T;
|
|
6
6
|
type _ClassOrObject<M, K> = K extends M ? object : _Class<K> | (() => _Class<K>);
|
|
7
7
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Frozen } from
|
|
2
|
-
import { AnyStandardType, AnyType, ModelType, ObjectTypeFunction, TypeToData } from
|
|
3
|
-
import { TypeInfo } from
|
|
1
|
+
import { Frozen } from "../../frozen/Frozen";
|
|
2
|
+
import type { AnyStandardType, AnyType, ModelType, ObjectTypeFunction, TypeToData } from "../schemas";
|
|
3
|
+
import { TypeInfo } from "../TypeChecker";
|
|
4
4
|
/**
|
|
5
5
|
* A type that represents a plain object.
|
|
6
6
|
* Note that the parameter must be a function that returns an object. This is done so objects can support self / cross types.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ObjectMap } from
|
|
2
|
-
import { AnyStandardType, AnyType, ModelType, TypeToData } from
|
|
3
|
-
import { TypeInfo } from
|
|
1
|
+
import { ObjectMap } from "../../wrappers/ObjectMap";
|
|
2
|
+
import type { AnyStandardType, AnyType, ModelType, TypeToData } from "../schemas";
|
|
3
|
+
import { TypeInfo } from "../TypeChecker";
|
|
4
4
|
/**
|
|
5
5
|
* A type that represents an object-like map ObjectMap.
|
|
6
6
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyStandardType, AnyType, RecordType } from
|
|
2
|
-
import { TypeInfo } from
|
|
1
|
+
import type { AnyStandardType, AnyType, RecordType } from "../schemas";
|
|
2
|
+
import { TypeInfo } from "../TypeChecker";
|
|
3
3
|
/**
|
|
4
4
|
* A type that represents an object-like map, an object with string keys and values all of a same given type.
|
|
5
5
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Ref, RefConstructor } from
|
|
2
|
-
import { ModelType } from
|
|
3
|
-
import { TypeInfo } from
|
|
1
|
+
import type { Ref, RefConstructor } from "../../ref/Ref";
|
|
2
|
+
import type { ModelType } from "../schemas";
|
|
3
|
+
import { TypeInfo } from "../TypeChecker";
|
|
4
4
|
/**
|
|
5
5
|
* A type that represents a reference to an object or model.
|
|
6
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PrimitiveValue } from
|
|
2
|
-
import { AnyStandardType, IdentityType } from
|
|
3
|
-
import { TypeInfo } from
|
|
1
|
+
import type { PrimitiveValue } from "../../utils/types";
|
|
2
|
+
import type { AnyStandardType, IdentityType } from "../schemas";
|
|
3
|
+
import { TypeInfo } from "../TypeChecker";
|
|
4
4
|
/**
|
|
5
5
|
* A type that represents a certain value of a primitive (for example an *exact* number or string).
|
|
6
6
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* types.integer
|
|
7
7
|
* ```
|
|
8
8
|
*/
|
|
9
|
-
export declare const typesInteger: import(
|
|
9
|
+
export declare const typesInteger: import("..").IdentityType<number>;
|
|
10
10
|
/**
|
|
11
11
|
* A type that represents any string value other than "".
|
|
12
12
|
* Syntactic sugar for `types.refinement(types.string, s => s !== "", "nonEmpty")`
|
|
@@ -15,4 +15,4 @@ export declare const typesInteger: import('..').IdentityType<number>;
|
|
|
15
15
|
* types.nonEmptyString
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
export declare const typesNonEmptyString: import(
|
|
18
|
+
export declare const typesNonEmptyString: import("..").IdentityType<string>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AnyDataModel } from
|
|
2
|
-
import { AnyModel } from
|
|
3
|
-
import { ModelClass } from
|
|
4
|
-
import { SnapshotInOf, SnapshotOutOf } from
|
|
5
|
-
import { IsOptionalValue, SimplifyObject } from
|
|
1
|
+
import type { AnyDataModel } from "../dataModel/BaseDataModel";
|
|
2
|
+
import type { AnyModel } from "../model/BaseModel";
|
|
3
|
+
import type { ModelClass } from "../modelShared/BaseModelShared";
|
|
4
|
+
import type { SnapshotInOf, SnapshotOutOf } from "../snapshot/SnapshotOf";
|
|
5
|
+
import type { IsOptionalValue, SimplifyObject } from "../utils/types";
|
|
6
6
|
export interface Type<Name, Data> {
|
|
7
7
|
/** @ignore */
|
|
8
8
|
$$type: Name;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { MaybeOptionalModelProp, OptionalModelProp } from
|
|
2
|
-
import { typesBoolean, typesNumber, typesString } from
|
|
3
|
-
import { AnyType, TypeToData, TypeToSnapshotIn } from
|
|
4
|
-
import { TypeToStoredData } from
|
|
1
|
+
import { type MaybeOptionalModelProp, type OptionalModelProp } from "../modelShared/prop";
|
|
2
|
+
import { typesBoolean, typesNumber, typesString } from "./primitiveBased/typesPrimitive";
|
|
3
|
+
import type { AnyType, TypeToData, TypeToSnapshotIn } from "./schemas";
|
|
4
|
+
import type { TypeToStoredData } from "./utility/typeToStoredData";
|
|
5
5
|
type StoredRequiredPropMetadata<TType extends AnyType> = {
|
|
6
6
|
$storedValueType: TypeToStoredData<TType>;
|
|
7
7
|
$storedCreationValueType: TypeToStoredData<TType>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyType, TypeToData } from
|
|
2
|
-
import { TypeCheckError } from
|
|
1
|
+
import type { AnyType, TypeToData } from "./schemas";
|
|
2
|
+
import type { TypeCheckError } from "./TypeCheckError";
|
|
3
3
|
/**
|
|
4
4
|
* Checks if a value conforms to a given type.
|
|
5
5
|
*
|