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.
Files changed (165) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/mobx-keystone.esm.js +151 -312
  3. package/dist/mobx-keystone.esm.mjs +151 -312
  4. package/dist/mobx-keystone.umd.js +151 -312
  5. package/dist/types/action/applyAction.d.ts +1 -1
  6. package/dist/types/action/applyMethodCall.d.ts +1 -1
  7. package/dist/types/action/index.d.ts +12 -12
  8. package/dist/types/action/isModelAction.d.ts +1 -1
  9. package/dist/types/action/middleware.d.ts +1 -1
  10. package/dist/types/actionMiddlewares/actionSerialization/actionSerialization.d.ts +3 -3
  11. package/dist/types/actionMiddlewares/actionSerialization/applySerializedAction.d.ts +2 -2
  12. package/dist/types/actionMiddlewares/actionSerialization/arraySerializer.d.ts +2 -2
  13. package/dist/types/actionMiddlewares/actionSerialization/dateSerializer.d.ts +1 -1
  14. package/dist/types/actionMiddlewares/actionSerialization/index.d.ts +3 -3
  15. package/dist/types/actionMiddlewares/actionSerialization/mapSerializer.d.ts +2 -2
  16. package/dist/types/actionMiddlewares/actionSerialization/objectPathSerializer.d.ts +2 -2
  17. package/dist/types/actionMiddlewares/actionSerialization/objectSnapshotSerializer.d.ts +1 -1
  18. package/dist/types/actionMiddlewares/actionSerialization/plainObjectSerializer.d.ts +1 -1
  19. package/dist/types/actionMiddlewares/actionSerialization/primitiveSerializer.d.ts +1 -1
  20. package/dist/types/actionMiddlewares/actionSerialization/setSerializer.d.ts +2 -2
  21. package/dist/types/actionMiddlewares/actionTrackingMiddleware.d.ts +3 -3
  22. package/dist/types/actionMiddlewares/index.d.ts +6 -6
  23. package/dist/types/actionMiddlewares/onActionMiddleware.d.ts +3 -3
  24. package/dist/types/actionMiddlewares/readonlyMiddleware.d.ts +1 -1
  25. package/dist/types/actionMiddlewares/transactionMiddleware.d.ts +2 -2
  26. package/dist/types/actionMiddlewares/undoMiddleware.d.ts +8 -8
  27. package/dist/types/computedTree/index.d.ts +1 -1
  28. package/dist/types/context/index.d.ts +1 -1
  29. package/dist/types/dataModel/BaseDataModel.d.ts +3 -3
  30. package/dist/types/dataModel/DataModel.d.ts +3 -3
  31. package/dist/types/dataModel/getDataModelMetadata.d.ts +3 -3
  32. package/dist/types/dataModel/index.d.ts +4 -4
  33. package/dist/types/dataModel/utils.d.ts +1 -1
  34. package/dist/types/deepChange/index.d.ts +1 -1
  35. package/dist/types/deepChange/onDeepChange.d.ts +1 -1
  36. package/dist/types/frozen/Frozen.d.ts +1 -1
  37. package/dist/types/frozen/index.d.ts +1 -1
  38. package/dist/types/globalConfig/index.d.ts +1 -1
  39. package/dist/types/index.d.ts +24 -24
  40. package/dist/types/model/BaseModel.d.ts +5 -5
  41. package/dist/types/model/Model.d.ts +3 -3
  42. package/dist/types/model/getModelMetadata.d.ts +3 -3
  43. package/dist/types/model/index.d.ts +6 -6
  44. package/dist/types/model/mixins.d.ts +4 -4
  45. package/dist/types/model/utils.d.ts +4 -4
  46. package/dist/types/modelShared/BaseModelShared.d.ts +5 -5
  47. package/dist/types/modelShared/index.d.ts +4 -4
  48. package/dist/types/modelShared/modelDecorator.d.ts +3 -3
  49. package/dist/types/modelShared/modelInfo.d.ts +3 -3
  50. package/dist/types/modelShared/newModel.d.ts +3 -3
  51. package/dist/types/modelShared/prop.d.ts +3 -3
  52. package/dist/types/modelShared/sharedInternalModel.d.ts +4 -4
  53. package/dist/types/parent/findParent.d.ts +1 -1
  54. package/dist/types/parent/index.d.ts +9 -9
  55. package/dist/types/parent/path.d.ts +1 -1
  56. package/dist/types/patch/Patch.d.ts +1 -1
  57. package/dist/types/patch/applyPatches.d.ts +1 -1
  58. package/dist/types/patch/emitPatch.d.ts +1 -1
  59. package/dist/types/patch/index.d.ts +5 -5
  60. package/dist/types/patch/jsonPatch.d.ts +2 -2
  61. package/dist/types/patch/patchRecorder.d.ts +2 -2
  62. package/dist/types/redux/index.d.ts +2 -2
  63. package/dist/types/redux/redux.d.ts +3 -3
  64. package/dist/types/ref/Ref.d.ts +3 -3
  65. package/dist/types/ref/core.d.ts +2 -2
  66. package/dist/types/ref/customRef.d.ts +2 -2
  67. package/dist/types/ref/index.d.ts +4 -4
  68. package/dist/types/ref/rootRef.d.ts +2 -2
  69. package/dist/types/rootStore/index.d.ts +1 -1
  70. package/dist/types/snapshot/SnapshotOf.d.ts +5 -5
  71. package/dist/types/snapshot/SnapshotProcessingError.d.ts +2 -2
  72. package/dist/types/snapshot/applySnapshot.d.ts +1 -1
  73. package/dist/types/snapshot/cloneTreeValue.d.ts +1 -1
  74. package/dist/types/snapshot/fromSnapshot.d.ts +2 -2
  75. package/dist/types/snapshot/getSnapshot.d.ts +2 -2
  76. package/dist/types/snapshot/index.d.ts +8 -8
  77. package/dist/types/snapshot/onSnapshot.d.ts +1 -1
  78. package/dist/types/standardActions/index.d.ts +3 -3
  79. package/dist/types/standardActions/objectActions.d.ts +1 -1
  80. package/dist/types/transforms/asMap.d.ts +1 -1
  81. package/dist/types/transforms/asSet.d.ts +2 -2
  82. package/dist/types/transforms/bigint.d.ts +1 -1
  83. package/dist/types/transforms/date.d.ts +1 -1
  84. package/dist/types/transforms/index.d.ts +4 -4
  85. package/dist/types/treeUtils/draft.d.ts +1 -1
  86. package/dist/types/treeUtils/index.d.ts +3 -3
  87. package/dist/types/tweaker/index.d.ts +2 -2
  88. package/dist/types/tweaker/tweak.d.ts +1 -1
  89. package/dist/types/types/SnapshotTypeMismatchError.d.ts +2 -2
  90. package/dist/types/types/TypeCheckError.d.ts +2 -2
  91. package/dist/types/types/TypeChecker.d.ts +3 -3
  92. package/dist/types/types/arrayBased/typesArray.d.ts +2 -2
  93. package/dist/types/types/arrayBased/typesTuple.d.ts +2 -2
  94. package/dist/types/types/getTypeInfo.d.ts +2 -2
  95. package/dist/types/types/index.d.ts +7 -7
  96. package/dist/types/types/objectBased/typesArraySet.d.ts +3 -3
  97. package/dist/types/types/objectBased/typesDataModelData.d.ts +4 -4
  98. package/dist/types/types/objectBased/typesModel.d.ts +4 -4
  99. package/dist/types/types/objectBased/typesObject.d.ts +3 -3
  100. package/dist/types/types/objectBased/typesObjectMap.d.ts +3 -3
  101. package/dist/types/types/objectBased/typesRecord.d.ts +2 -2
  102. package/dist/types/types/objectBased/typesRef.d.ts +3 -3
  103. package/dist/types/types/primitiveBased/typesEnum.d.ts +1 -1
  104. package/dist/types/types/primitiveBased/typesPrimitive.d.ts +3 -3
  105. package/dist/types/types/primitiveBased/typesRefinedPrimitive.d.ts +2 -2
  106. package/dist/types/types/schemas.d.ts +5 -5
  107. package/dist/types/types/tProp.d.ts +4 -4
  108. package/dist/types/types/typeCheck.d.ts +2 -2
  109. package/dist/types/types/types.d.ts +39 -39
  110. package/dist/types/types/utility/typeToStoredData.d.ts +2 -2
  111. package/dist/types/types/utility/typesBigInt.d.ts +1 -1
  112. package/dist/types/types/utility/typesCodec.d.ts +6 -6
  113. package/dist/types/types/utility/typesCodecCore.d.ts +4 -4
  114. package/dist/types/types/utility/typesCodecSupport.d.ts +4 -4
  115. package/dist/types/types/utility/typesDate.d.ts +2 -2
  116. package/dist/types/types/utility/typesMap.d.ts +2 -2
  117. package/dist/types/types/utility/typesMaybe.d.ts +1 -1
  118. package/dist/types/types/utility/typesOr.d.ts +2 -2
  119. package/dist/types/types/utility/typesRefinement.d.ts +3 -3
  120. package/dist/types/types/utility/typesSet.d.ts +3 -3
  121. package/dist/types/types/utility/typesSkipCheck.d.ts +2 -2
  122. package/dist/types/types/utility/typesTag.d.ts +2 -2
  123. package/dist/types/types/utility/typesUnchecked.d.ts +2 -2
  124. package/dist/types/utils/ModelPool.d.ts +1 -1
  125. package/dist/types/wrappers/ArraySet.d.ts +1 -1
  126. package/dist/types/wrappers/ObjectMap.d.ts +1 -1
  127. package/dist/types/wrappers/asMap.d.ts +1 -1
  128. package/dist/types/wrappers/asSet.d.ts +1 -1
  129. package/dist/types/wrappers/index.d.ts +4 -4
  130. package/package.json +5 -18
  131. package/src/action/modelAction.ts +1 -1
  132. package/src/action/modelFlow.ts +1 -1
  133. package/src/dataModel/BaseDataModel.ts +5 -5
  134. package/src/model/BaseModel.ts +7 -6
  135. package/src/model/mixins.ts +1 -1
  136. package/src/model/newModel.ts +1 -1
  137. package/src/modelShared/modelDecorator.ts +4 -6
  138. package/src/modelShared/modelInfo.ts +2 -1
  139. package/src/modelShared/sharedInternalModel.ts +1 -1
  140. package/src/ref/Ref.ts +1 -1
  141. package/src/snapshot/SnapshotterAndReconcilerPriority.ts +2 -1
  142. package/src/snapshot/fromModelSnapshot.ts +1 -1
  143. package/src/snapshot/fromSnapshot.ts +1 -1
  144. package/src/transforms/ImmutableDate.ts +19 -19
  145. package/src/tweaker/tweakArray.ts +1 -1
  146. package/src/tweaker/tweakFrozen.ts +1 -1
  147. package/src/tweaker/tweakModel.ts +1 -1
  148. package/src/tweaker/tweakPlainObject.ts +1 -1
  149. package/src/types/arrayBased/typesArray.ts +1 -1
  150. package/src/types/arrayBased/typesTuple.ts +1 -1
  151. package/src/types/objectBased/typesArraySet.ts +1 -1
  152. package/src/types/objectBased/typesModel.ts +2 -2
  153. package/src/types/objectBased/typesObject.ts +1 -1
  154. package/src/types/objectBased/typesObjectMap.ts +1 -1
  155. package/src/types/objectBased/typesRecord.ts +1 -1
  156. package/src/types/objectBased/typesRef.ts +2 -2
  157. package/src/types/primitiveBased/typesPrimitive.ts +1 -1
  158. package/src/types/schemas.ts +1 -1
  159. package/src/types/utility/typesCodecCore.ts +1 -1
  160. package/src/types/utility/typesCodecSupport.ts +2 -0
  161. package/src/types/utility/typesOr.ts +2 -2
  162. package/src/types/utility/typesRefinement.ts +1 -1
  163. package/src/utils/index.ts +20 -13
  164. package/src/wrappers/ArraySet.ts +3 -5
  165. package/src/wrappers/ObjectMap.ts +3 -5
@@ -1,4 +1,4 @@
1
- import { Path } from '../parent/pathTypes';
1
+ import type { Path } from "../parent/pathTypes";
2
2
  /**
3
3
  * An action call.
4
4
  */
@@ -1,4 +1,4 @@
1
- import { AnyFunction } from '../utils/AnyFunction';
1
+ import type { AnyFunction } from "../utils/AnyFunction";
2
2
  /**
3
3
  * Calls an object method wrapped in an action.
4
4
  *
@@ -1,12 +1,12 @@
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
+ 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,4 +1,4 @@
1
- import { AnyFunction } from '../utils/AnyFunction';
1
+ import type { AnyFunction } from "../utils/AnyFunction";
2
2
  /**
3
3
  * Returns if the given function is a model action or not.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { ActionContext } from './context';
1
+ import type { ActionContext } from "./context";
2
2
  /**
3
3
  * An action middleware.
4
4
  */
@@ -1,6 +1,6 @@
1
- import { ActionCall } from '../../action/applyAction';
2
- import { JSONPrimitiveValue } from '../../utils/types';
3
- import { ActionCallArgumentSerializer } from './core';
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 '../../patch/Patch';
2
- import { SerializedActionCall } from './actionSerialization';
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 'mobx';
2
- import { ActionCallArgumentSerializer } from './core';
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 './core';
1
+ import { type ActionCallArgumentSerializer } from "./core";
2
2
  export declare const dateSerializer: ActionCallArgumentSerializer<Date, number | null>;
@@ -1,3 +1,3 @@
1
- export * from './actionSerialization';
2
- export * from './applySerializedAction';
3
- export * from './core';
1
+ export * from "./actionSerialization";
2
+ export * from "./applySerializedAction";
3
+ export * from "./core";
@@ -1,5 +1,5 @@
1
- import { ObservableMap } from 'mobx';
2
- import { ActionCallArgumentSerializer } from './core';
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 '../../parent/pathTypes';
2
- import { ActionCallArgumentSerializer } from './core';
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 './core';
1
+ import { type ActionCallArgumentSerializer } from "./core";
2
2
  export declare const objectSnapshotSerializer: ActionCallArgumentSerializer<object, object>;
@@ -1,2 +1,2 @@
1
- import { ActionCallArgumentSerializer } from './core';
1
+ import { type ActionCallArgumentSerializer } from "./core";
2
2
  export declare const plainObjectSerializer: ActionCallArgumentSerializer<object, object>;
@@ -1,2 +1,2 @@
1
- import { ActionCallArgumentSerializer } from './core';
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 'mobx';
2
- import { ActionCallArgumentSerializer } from './core';
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 '../action/context';
2
- import { ActionMiddlewareDisposer } from '../action/middleware';
3
- import { AnyModel } from '../model/BaseModel';
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 './actionSerialization';
2
- export * from './actionTrackingMiddleware';
3
- export * from './onActionMiddleware';
4
- export * from './readonlyMiddleware';
5
- export * from './transactionMiddleware';
6
- export * from './undoMiddleware';
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 '../action/applyAction';
2
- import { ActionMiddlewareDisposer } from '../action/middleware';
3
- import { ActionTrackingReturn, SimpleActionContext } from './actionTrackingMiddleware';
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,4 +1,4 @@
1
- import { ActionMiddlewareDisposer } from '../action/middleware';
1
+ import type { ActionMiddlewareDisposer } from "../action/middleware";
2
2
  /**
3
3
  * Return type for readonly middleware.
4
4
  */
@@ -1,5 +1,5 @@
1
- import { ActionMiddlewareDisposer } from '../action/middleware';
2
- import { AnyModel } from '../model/BaseModel';
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 '../action/middleware';
2
- import { Frozen } from '../frozen';
3
- import { Path } from '../parent/pathTypes';
4
- import { Patch } from '../patch';
5
- import { FrozenData } from '../snapshot';
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('..')._Model<unknown, {
80
- undoEvents: import('..').TypedOptionalModelProp<import('..').ArrayType<import('..').ModelType<Frozen<UndoEvent>>[]>>;
81
- redoEvents: import('..').TypedOptionalModelProp<import('..').ArrayType<import('..').ModelType<Frozen<UndoEvent>>[]>>;
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 './computedTree';
1
+ export * from "./computedTree";
@@ -1 +1 @@
1
- export * from './context';
1
+ export * from "./context";
@@ -1,6 +1,6 @@
1
- import { propsTypeSymbol } from '../modelShared/BaseModelShared';
2
- import { ModelProps, ModelPropsToTransformedCreationData, ModelPropsToUntransformedCreationData, ModelPropsToUntransformedData } from '../modelShared/prop';
3
- import { TypeCheckError } from '../types/TypeCheckError';
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 '../modelShared/BaseModelShared';
2
- import { ModelProps, ModelPropsToSetter, ModelPropsToTransformedCreationData, ModelPropsToTransformedData, ModelPropsToUntransformedCreationData } from '../modelShared/prop';
3
- import { AnyDataModel, BaseDataModel, BaseDataModelKeys } from './BaseDataModel';
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 '../modelShared/BaseModelShared';
2
- import { AnyType } from '../types/schemas';
3
- import { AnyDataModel } from './BaseDataModel';
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 './BaseDataModel';
2
- export * from './DataModel';
3
- export * from './getDataModelMetadata';
4
- export * from './utils';
1
+ export * from "./BaseDataModel";
2
+ export * from "./DataModel";
3
+ export * from "./getDataModelMetadata";
4
+ export * from "./utils";
@@ -1,4 +1,4 @@
1
- import { AnyDataModel } from './BaseDataModel';
1
+ import type { AnyDataModel } from "./BaseDataModel";
2
2
  /**
3
3
  * Checks if an object is a data model instance.
4
4
  *
@@ -1 +1 @@
1
- export * from './onDeepChange';
1
+ export * from "./onDeepChange";
@@ -1,4 +1,4 @@
1
- import { Path } from '../parent/pathTypes';
1
+ import type { Path } from "../parent/pathTypes";
2
2
  /**
3
3
  * Disposer function to stop listening to deep changes.
4
4
  */
@@ -1,4 +1,4 @@
1
- import { FrozenData } from '../snapshot';
1
+ import type { FrozenData } from "../snapshot";
2
2
  /**
3
3
  * Should freeze and plain json checks be done when creating the frozen object?
4
4
  */
@@ -1 +1 @@
1
- export * from './Frozen';
1
+ export * from "./Frozen";
@@ -1 +1 @@
1
- export * from './globalConfig';
1
+ export * from "./globalConfig";
@@ -1,24 +1,24 @@
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
+ 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 '../modelShared/BaseModelShared';
2
- import { ModelProps, ModelPropsToTransformedCreationData, ModelPropsToUntransformedData } from '../modelShared/prop';
3
- import { SnapshotInOfModel, SnapshotOutOfModel } from '../snapshot/SnapshotOf';
4
- import { TypeCheckError } from '../types/TypeCheckError';
5
- import { modelIdKey, modelTypeKey } from './metadata';
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 '../modelShared/BaseModelShared';
2
- import { ModelProps, ModelPropsToSetter, ModelPropsToSnapshotCreationData, ModelPropsToSnapshotData, ModelPropsToTransformedCreationData, ModelPropsToTransformedData } from '../modelShared/prop';
3
- import { AnyModel, BaseModel, BaseModelKeys, ModelIdPropertyName } from './BaseModel';
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 '../modelShared/BaseModelShared';
2
- import { AnyType } from '../types/schemas';
3
- import { AnyModel } from './BaseModel';
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 './BaseModel';
2
- export * from './getModelMetadata';
3
- export * from './Model';
4
- export * from './metadata';
5
- export * from './mixins';
6
- export * from './utils';
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 '../modelShared/BaseModelShared';
2
- import { ModelProps, ModelPropsToTransformedData } from '../modelShared/prop';
3
- import { AnyModel, BaseModelKeys } from './BaseModel';
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('./Model')._Model<unknown, {}, never, never>;
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 '../dataModel/BaseDataModel';
2
- import { ModelClass } from '../modelShared/BaseModelShared';
3
- import { ModelInfo } from '../modelShared/modelInfo';
4
- import { AnyModel } from './BaseModel';
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 '../dataModel/BaseDataModel';
2
- import { AnyModel } from '../model/BaseModel';
3
- import { modelTypeKey } from '../model/metadata';
4
- import { Flatten, IsNeverType } from '../utils/types';
5
- import { ModelProps, ModelPropsToSnapshotCreationData, ModelPropsToSnapshotData, ModelPropsToTransformedCreationData, ModelPropsToTransformedData, ModelPropsToUntransformedCreationData } from './prop';
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 './BaseModelShared';
2
- export * from './modelDecorator';
3
- export * from './modelInfo';
4
- export * from './prop';
1
+ export * from "./BaseModelShared";
2
+ export * from "./modelDecorator";
3
+ export * from "./modelInfo";
4
+ export * from "./prop";
@@ -1,6 +1,6 @@
1
- import { AnyDataModel } from '../dataModel/BaseDataModel';
2
- import { AnyModel } from '../model/BaseModel';
3
- import { AnyFunction } from '../utils/AnyFunction';
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 '../dataModel/BaseDataModel';
2
- import { AnyModel } from '../model/BaseModel';
3
- import { ModelClass } from './BaseModelShared';
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 '../dataModel/BaseDataModel';
2
- import { AnyModel } from '../model/BaseModel';
3
- import { ModelClass } from '../modelShared/BaseModelShared';
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 '../snapshot/SnapshotOf';
2
- import { AnyStandardType } from '../types/schemas';
3
- import { IsNeverType, IsOptionalValue, SimplifyObject } from '../utils/types';
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 '../dataModel/BaseDataModel';
2
- import { AnyModel } from '../model/BaseModel';
3
- import { ModelClass } from './BaseModelShared';
4
- import { ModelProps } from './prop';
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,4 +1,4 @@
1
- import { Path } from './pathTypes';
1
+ import type { Path } from "./pathTypes";
2
2
  /**
3
3
  * Iterates through all the parents (from the nearest until the root)
4
4
  * until one of them matches the given predicate.
@@ -1,9 +1,9 @@
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';
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";
@@ -1,4 +1,4 @@
1
- import { Path, PathElement } from './pathTypes';
1
+ import type { Path, PathElement } from "./pathTypes";
2
2
  /**
3
3
  * Path from an object to its immediate parent.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { Path } from '../parent/pathTypes';
1
+ import type { Path } from "../parent/pathTypes";
2
2
  export type Patch = PatchAddOperation<any> | PatchRemoveOperation | PatchReplaceOperation<any>;
3
3
  export interface PatchBaseOperation {
4
4
  path: Path;
@@ -1,4 +1,4 @@
1
- import { Patch } from '../patch/Patch';
1
+ import type { Patch } from "../patch/Patch";
2
2
  /**
3
3
  * Applies the given patches to the given target object.
4
4
  * Automatic type checking validates the completed batch, including nested lists.
@@ -1,4 +1,4 @@
1
- import { Patch } from './Patch';
1
+ import type { Patch } from "./Patch";
2
2
  /**
3
3
  * A function that gets called when a patch is emitted.
4
4
  */