mobx-keystone 2.3.0 → 2.4.0

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 (205) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/mobx-keystone.esm.js +3737 -2722
  3. package/dist/mobx-keystone.esm.mjs +3737 -2722
  4. package/dist/mobx-keystone.umd.js +3750 -2721
  5. package/dist/types/action/CallKind.d.ts +29 -0
  6. package/dist/types/action/applyAction.d.ts +8 -2
  7. package/dist/types/action/applyMethodCall.d.ts +1 -1
  8. package/dist/types/action/index.d.ts +13 -12
  9. package/dist/types/action/isModelAction.d.ts +1 -1
  10. package/dist/types/action/middleware.d.ts +1 -1
  11. package/dist/types/action/resolveCallName.d.ts +1 -0
  12. package/dist/types/actionMiddlewares/actionSerialization/actionSerialization.d.ts +17 -3
  13. package/dist/types/actionMiddlewares/actionSerialization/applySerializedAction.d.ts +8 -2
  14. package/dist/types/actionMiddlewares/actionSerialization/arraySerializer.d.ts +2 -2
  15. package/dist/types/actionMiddlewares/actionSerialization/core.d.ts +7 -0
  16. package/dist/types/actionMiddlewares/actionSerialization/dateSerializer.d.ts +1 -1
  17. package/dist/types/actionMiddlewares/actionSerialization/index.d.ts +3 -3
  18. package/dist/types/actionMiddlewares/actionSerialization/mapSerializer.d.ts +2 -2
  19. package/dist/types/actionMiddlewares/actionSerialization/objectPathSerializer.d.ts +2 -2
  20. package/dist/types/actionMiddlewares/actionSerialization/objectSnapshotSerializer.d.ts +1 -1
  21. package/dist/types/actionMiddlewares/actionSerialization/plainObjectSerializer.d.ts +1 -1
  22. package/dist/types/actionMiddlewares/actionSerialization/primitiveSerializer.d.ts +1 -1
  23. package/dist/types/actionMiddlewares/actionSerialization/setSerializer.d.ts +2 -2
  24. package/dist/types/actionMiddlewares/actionTrackingMiddleware.d.ts +3 -3
  25. package/dist/types/actionMiddlewares/index.d.ts +6 -6
  26. package/dist/types/actionMiddlewares/onActionMiddleware.d.ts +3 -3
  27. package/dist/types/actionMiddlewares/readonlyMiddleware.d.ts +1 -1
  28. package/dist/types/actionMiddlewares/transactionMiddleware.d.ts +2 -2
  29. package/dist/types/actionMiddlewares/undoMiddleware.d.ts +8 -8
  30. package/dist/types/computedTree/index.d.ts +1 -1
  31. package/dist/types/context/index.d.ts +1 -1
  32. package/dist/types/dataModel/BaseDataModel.d.ts +3 -3
  33. package/dist/types/dataModel/DataModel.d.ts +3 -3
  34. package/dist/types/dataModel/getDataModelMetadata.d.ts +3 -3
  35. package/dist/types/dataModel/index.d.ts +4 -4
  36. package/dist/types/dataModel/utils.d.ts +1 -1
  37. package/dist/types/deepChange/index.d.ts +1 -1
  38. package/dist/types/deepChange/onDeepChange.d.ts +1 -1
  39. package/dist/types/frozen/Frozen.d.ts +1 -1
  40. package/dist/types/frozen/index.d.ts +1 -1
  41. package/dist/types/globalConfig/index.d.ts +1 -1
  42. package/dist/types/index.d.ts +25 -24
  43. package/dist/types/model/BaseModel.d.ts +5 -5
  44. package/dist/types/model/Model.d.ts +3 -3
  45. package/dist/types/model/getModelMetadata.d.ts +3 -3
  46. package/dist/types/model/index.d.ts +6 -6
  47. package/dist/types/model/mixins.d.ts +4 -4
  48. package/dist/types/model/utils.d.ts +4 -4
  49. package/dist/types/modelShared/BaseModelShared.d.ts +5 -5
  50. package/dist/types/modelShared/index.d.ts +4 -4
  51. package/dist/types/modelShared/modelDecorator.d.ts +3 -3
  52. package/dist/types/modelShared/modelInfo.d.ts +3 -3
  53. package/dist/types/modelShared/newModel.d.ts +3 -3
  54. package/dist/types/modelShared/prop.d.ts +3 -3
  55. package/dist/types/modelShared/sharedInternalModel.d.ts +4 -4
  56. package/dist/types/parent/findParent.d.ts +1 -1
  57. package/dist/types/parent/index.d.ts +9 -9
  58. package/dist/types/parent/path.d.ts +1 -1
  59. package/dist/types/patch/Patch.d.ts +1 -1
  60. package/dist/types/patch/applyPatches.d.ts +1 -1
  61. package/dist/types/patch/emitPatch.d.ts +7 -1
  62. package/dist/types/patch/index.d.ts +5 -5
  63. package/dist/types/patch/jsonPatch.d.ts +2 -2
  64. package/dist/types/patch/patchRecorder.d.ts +2 -2
  65. package/dist/types/redux/index.d.ts +2 -2
  66. package/dist/types/redux/redux.d.ts +3 -3
  67. package/dist/types/ref/Ref.d.ts +3 -3
  68. package/dist/types/ref/core.d.ts +2 -2
  69. package/dist/types/ref/customRef.d.ts +2 -2
  70. package/dist/types/ref/index.d.ts +4 -4
  71. package/dist/types/ref/rootRef.d.ts +2 -2
  72. package/dist/types/rootStore/index.d.ts +1 -1
  73. package/dist/types/serialization/Call.d.ts +55 -0
  74. package/dist/types/serialization/CallError.d.ts +96 -0
  75. package/dist/types/serialization/JsonValue.d.ts +6 -0
  76. package/dist/types/serialization/Serializer.d.ts +84 -0
  77. package/dist/types/serialization/ValueSerializer.d.ts +88 -0
  78. package/dist/types/serialization/applyCall.d.ts +54 -0
  79. package/dist/types/serialization/builtinSerializers.d.ts +49 -0
  80. package/dist/types/serialization/codec.d.ts +1 -0
  81. package/dist/types/serialization/index.d.ts +8 -0
  82. package/dist/types/serialization/references.d.ts +74 -0
  83. package/dist/types/serialization/resolvedCall.d.ts +1 -0
  84. package/dist/types/snapshot/SnapshotOf.d.ts +5 -5
  85. package/dist/types/snapshot/SnapshotProcessingError.d.ts +2 -2
  86. package/dist/types/snapshot/applySnapshot.d.ts +1 -1
  87. package/dist/types/snapshot/cloneTreeValue.d.ts +1 -1
  88. package/dist/types/snapshot/fromSnapshot.d.ts +2 -2
  89. package/dist/types/snapshot/getSnapshot.d.ts +2 -2
  90. package/dist/types/snapshot/index.d.ts +8 -8
  91. package/dist/types/snapshot/onSnapshot.d.ts +1 -1
  92. package/dist/types/standardActions/index.d.ts +3 -3
  93. package/dist/types/standardActions/objectActions.d.ts +1 -1
  94. package/dist/types/transforms/asMap.d.ts +1 -1
  95. package/dist/types/transforms/asSet.d.ts +2 -2
  96. package/dist/types/transforms/bigint.d.ts +1 -1
  97. package/dist/types/transforms/date.d.ts +1 -1
  98. package/dist/types/transforms/index.d.ts +4 -4
  99. package/dist/types/treeUtils/draft.d.ts +1 -1
  100. package/dist/types/treeUtils/index.d.ts +3 -3
  101. package/dist/types/tweaker/index.d.ts +2 -2
  102. package/dist/types/tweaker/tweak.d.ts +1 -1
  103. package/dist/types/types/SnapshotTypeMismatchError.d.ts +2 -2
  104. package/dist/types/types/TypeCheckError.d.ts +2 -2
  105. package/dist/types/types/TypeChecker.d.ts +3 -3
  106. package/dist/types/types/arrayBased/typesArray.d.ts +2 -2
  107. package/dist/types/types/arrayBased/typesTuple.d.ts +2 -2
  108. package/dist/types/types/getTypeInfo.d.ts +2 -2
  109. package/dist/types/types/index.d.ts +7 -7
  110. package/dist/types/types/objectBased/typesArraySet.d.ts +3 -3
  111. package/dist/types/types/objectBased/typesDataModelData.d.ts +4 -4
  112. package/dist/types/types/objectBased/typesModel.d.ts +4 -4
  113. package/dist/types/types/objectBased/typesObject.d.ts +3 -3
  114. package/dist/types/types/objectBased/typesObjectMap.d.ts +3 -3
  115. package/dist/types/types/objectBased/typesRecord.d.ts +2 -2
  116. package/dist/types/types/objectBased/typesRef.d.ts +3 -3
  117. package/dist/types/types/primitiveBased/typesEnum.d.ts +1 -1
  118. package/dist/types/types/primitiveBased/typesPrimitive.d.ts +3 -3
  119. package/dist/types/types/primitiveBased/typesRefinedPrimitive.d.ts +2 -2
  120. package/dist/types/types/schemas.d.ts +5 -5
  121. package/dist/types/types/tProp.d.ts +4 -4
  122. package/dist/types/types/typeCheck.d.ts +2 -2
  123. package/dist/types/types/types.d.ts +39 -39
  124. package/dist/types/types/utility/typeToStoredData.d.ts +2 -2
  125. package/dist/types/types/utility/typesBigInt.d.ts +1 -1
  126. package/dist/types/types/utility/typesCodec.d.ts +6 -6
  127. package/dist/types/types/utility/typesCodecCore.d.ts +4 -4
  128. package/dist/types/types/utility/typesCodecSupport.d.ts +4 -4
  129. package/dist/types/types/utility/typesDate.d.ts +2 -2
  130. package/dist/types/types/utility/typesMap.d.ts +2 -2
  131. package/dist/types/types/utility/typesMaybe.d.ts +1 -1
  132. package/dist/types/types/utility/typesOr.d.ts +2 -2
  133. package/dist/types/types/utility/typesRefinement.d.ts +3 -3
  134. package/dist/types/types/utility/typesSet.d.ts +3 -3
  135. package/dist/types/types/utility/typesSkipCheck.d.ts +2 -2
  136. package/dist/types/types/utility/typesTag.d.ts +2 -2
  137. package/dist/types/types/utility/typesUnchecked.d.ts +2 -2
  138. package/dist/types/utils/ModelPool.d.ts +1 -1
  139. package/dist/types/wrappers/ArraySet.d.ts +1 -1
  140. package/dist/types/wrappers/ObjectMap.d.ts +1 -1
  141. package/dist/types/wrappers/asMap.d.ts +1 -1
  142. package/dist/types/wrappers/asSet.d.ts +1 -1
  143. package/dist/types/wrappers/index.d.ts +4 -4
  144. package/package.json +5 -18
  145. package/src/action/CallKind.ts +29 -0
  146. package/src/action/applyAction.ts +22 -49
  147. package/src/action/applySet.ts +21 -1
  148. package/src/action/index.ts +1 -0
  149. package/src/action/modelAction.ts +1 -1
  150. package/src/action/modelFlow.ts +1 -1
  151. package/src/action/resolveCallName.ts +207 -0
  152. package/src/actionMiddlewares/actionSerialization/actionSerialization.ts +14 -0
  153. package/src/actionMiddlewares/actionSerialization/applySerializedAction.ts +6 -0
  154. package/src/actionMiddlewares/actionSerialization/core.ts +7 -0
  155. package/src/actionMiddlewares/actionSerialization/index.ts +2 -0
  156. package/src/actionMiddlewares/actionSerialization/objectPathSerializer.ts +3 -2
  157. package/src/dataModel/BaseDataModel.ts +5 -5
  158. package/src/index.ts +1 -0
  159. package/src/model/BaseModel.ts +7 -6
  160. package/src/model/mixins.ts +1 -1
  161. package/src/model/newModel.ts +1 -1
  162. package/src/modelShared/modelDecorator.ts +4 -6
  163. package/src/modelShared/modelInfo.ts +2 -1
  164. package/src/modelShared/sharedInternalModel.ts +1 -1
  165. package/src/parent/path.ts +45 -12
  166. package/src/patch/emitPatch.ts +6 -0
  167. package/src/ref/Ref.ts +1 -1
  168. package/src/serialization/Call.ts +58 -0
  169. package/src/serialization/CallError.ts +153 -0
  170. package/src/serialization/JsonValue.ts +12 -0
  171. package/src/serialization/Serializer.ts +321 -0
  172. package/src/serialization/ValueSerializer.ts +98 -0
  173. package/src/serialization/applyCall.ts +190 -0
  174. package/src/serialization/builtinSerializers.ts +261 -0
  175. package/src/serialization/codec.ts +338 -0
  176. package/src/serialization/index.ts +15 -0
  177. package/src/serialization/references.ts +225 -0
  178. package/src/serialization/resolvedCall.ts +169 -0
  179. package/src/snapshot/SnapshotterAndReconcilerPriority.ts +2 -1
  180. package/src/snapshot/fromModelSnapshot.ts +1 -1
  181. package/src/snapshot/fromSnapshot.ts +1 -1
  182. package/src/standardActions/actions.ts +11 -3
  183. package/src/transforms/ImmutableDate.ts +19 -19
  184. package/src/tweaker/tweakArray.ts +1 -1
  185. package/src/tweaker/tweakFrozen.ts +1 -1
  186. package/src/tweaker/tweakModel.ts +1 -1
  187. package/src/tweaker/tweakPlainObject.ts +1 -1
  188. package/src/types/arrayBased/typesArray.ts +1 -1
  189. package/src/types/arrayBased/typesTuple.ts +1 -1
  190. package/src/types/objectBased/typesArraySet.ts +1 -1
  191. package/src/types/objectBased/typesModel.ts +2 -2
  192. package/src/types/objectBased/typesObject.ts +1 -1
  193. package/src/types/objectBased/typesObjectMap.ts +1 -1
  194. package/src/types/objectBased/typesRecord.ts +1 -1
  195. package/src/types/objectBased/typesRef.ts +2 -2
  196. package/src/types/primitiveBased/typesPrimitive.ts +1 -1
  197. package/src/types/schemas.ts +1 -1
  198. package/src/types/utility/typesCodecCore.ts +1 -1
  199. package/src/types/utility/typesCodecSupport.ts +2 -0
  200. package/src/types/utility/typesOr.ts +2 -2
  201. package/src/types/utility/typesRefinement.ts +1 -1
  202. package/src/utils/errorDiagnostics.ts +9 -4
  203. package/src/utils/index.ts +20 -13
  204. package/src/wrappers/ArraySet.ts +3 -5
  205. package/src/wrappers/ObjectMap.ts +3 -5
@@ -0,0 +1,29 @@
1
+ /**
2
+ * What a call's name resolved to on its target.
3
+ */
4
+ export declare enum CallKind {
5
+ /**
6
+ * An action declared on a class: a model's `@modelAction` / `@modelFlow` (including
7
+ * `withSetter()` setters), or a data model's action.
8
+ */
9
+ ModelAction = "modelAction",
10
+ /**
11
+ * An action the app defines with `standaloneAction` / `standaloneFlow`, under a global name.
12
+ */
13
+ StandaloneAction = "standaloneAction",
14
+ /**
15
+ * A standalone action the library ships for editing any array or plain object
16
+ * (`arrayActions`, `objectActions`).
17
+ */
18
+ StandardAction = "standardAction",
19
+ /**
20
+ * A built-in action, as library functions record when they change a node: `$$applySnapshot`,
21
+ * `$$applyPatches`, `$$detach`, `$$applySet`, `$$applyDelete`, `$$applyMethodCall` (see
22
+ * `BuiltInAction`).
23
+ */
24
+ BuiltInAction = "builtInAction",
25
+ /**
26
+ * Not an action: a method, getter or function field of a model's or data model's own classes.
27
+ */
28
+ View = "view"
29
+ }
@@ -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
  */
@@ -21,13 +21,19 @@ export interface ActionCall {
21
21
  readonly targetPathIds: ReadonlyArray<string | null>;
22
22
  /**
23
23
  * Marks this action call as non-serialized.
24
+ *
25
+ * @deprecated Not needed with `createSerializer`: a `Call` is never serialized, an
26
+ * `EncodedCall` always is.
24
27
  */
25
28
  readonly serialized?: boolean;
26
29
  }
27
30
  /**
28
31
  * Applies (runs) an action over a target object.
29
32
  *
30
- * If you intend to apply serialized actions check one of the `applySerializedAction` methods instead.
33
+ * It runs any kind of action (built-in, standalone, model actions and flows), but not views.
34
+ * To apply calls that come from outside (e.g. as JSON), decode them with a serializer
35
+ * (`defaultSerializer.decodeCall`) and use `applyCall` / `applyCallAsync` instead, which check
36
+ * what may be called.
31
37
  *
32
38
  * @param subtreeRoot Subtree root target object to run the action over.
33
39
  * @param call The action, usually as coming from `onActionMiddleware`.
@@ -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,13 @@
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 "./CallKind";
7
+ export * from "./context";
8
+ export * from "./hookActions";
9
+ export * from "./isModelAction";
10
+ export * from "./middleware";
11
+ export * from "./modelAction";
12
+ export * from "./modelFlow";
13
+ 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
  */
@@ -0,0 +1 @@
1
+ export {};
@@ -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
@@ -8,10 +8,14 @@ import { ActionCallArgumentSerializer } from './core';
8
8
  *
9
9
  * @param serializer Serializer to register.
10
10
  * @returns A disposer to unregister the serializer.
11
+ *
12
+ * @deprecated Use a `ValueSerializer` in the list passed to `createSerializer` instead.
11
13
  */
12
14
  export declare function registerActionCallArgumentSerializer(serializer: ActionCallArgumentSerializer<any, any>): () => void;
13
15
  /**
14
16
  * Serialized action call argument.
17
+ *
18
+ * @deprecated Replaced by the marked value `{ "$mobxKeystone": tag, "v": payload }` of `createSerializer`.
15
19
  */
16
20
  export interface SerializedActionCallArgument {
17
21
  /**
@@ -25,6 +29,8 @@ export interface SerializedActionCallArgument {
25
29
  }
26
30
  /**
27
31
  * A serialized action call.
32
+ *
33
+ * @deprecated Use `EncodedCall` instead.
28
34
  */
29
35
  export interface SerializedActionCall extends Omit<ActionCall, "serialized"> {
30
36
  /**
@@ -54,6 +60,8 @@ export interface SerializedActionCall extends Omit<ActionCall, "serialized"> {
54
60
  * @param argValue Argument value to be transformed into its serializable form.
55
61
  * @param [targetRoot] Target root node of the model where this action is being performed.
56
62
  * @returns The serializable form of the passed value.
63
+ *
64
+ * @deprecated Use `serializer.encodeValue(root, value)` instead (e.g. with `defaultSerializer`).
57
65
  */
58
66
  export declare function serializeActionCallArgument(argValue: any, targetRoot?: object): SerializedActionCallArgument | JSONPrimitiveValue;
59
67
  /**
@@ -63,6 +71,8 @@ export declare function serializeActionCallArgument(argValue: any, targetRoot?:
63
71
  * @param actionCall Action call to convert.
64
72
  * @param [targetRoot] Target root node of the model where this action is being performed.
65
73
  * @returns The serializable action call.
74
+ *
75
+ * @deprecated Use `serializer.encodeCall(root, call)` instead (e.g. with `defaultSerializer`).
66
76
  */
67
77
  export declare function serializeActionCall(actionCall: ActionCall, targetRoot?: object): SerializedActionCall;
68
78
  /**
@@ -71,6 +81,8 @@ export declare function serializeActionCall(actionCall: ActionCall, targetRoot?:
71
81
  * @param argValue Argument value to be transformed into its deserialized form.
72
82
  * @param [targetRoot] Target root node of the model where this action is being performed.
73
83
  * @returns The deserialized form of the passed value.
84
+ *
85
+ * @deprecated Use `serializer.decodeValue(root, json)` instead (e.g. with `defaultSerializer`).
74
86
  */
75
87
  export declare function deserializeActionCallArgument(argValue: SerializedActionCallArgument | JSONPrimitiveValue, targetRoot?: object): any;
76
88
  /**
@@ -80,5 +92,7 @@ export declare function deserializeActionCallArgument(argValue: SerializedAction
80
92
  * @param actionCall Action call to convert.
81
93
  * @param [targetRoot] Target root node of the model where this action is being performed.
82
94
  * @returns The deserialized action call.
95
+ *
96
+ * @deprecated Use `serializer.decodeCall(root, json)` instead (e.g. with `defaultSerializer`), then `applyCall`.
83
97
  */
84
98
  export declare function deserializeActionCall(actionCall: SerializedActionCall, targetRoot?: object): ActionCall;
@@ -1,9 +1,11 @@
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`.
6
6
  * To be applied with `applySerializedActionAndSyncNewModelIds`.
7
+ *
8
+ * @deprecated Use `EncodedCall` instead; model id overrides aren't needed when replicas apply the patches the server broadcasts.
7
9
  */
8
10
  export interface SerializedActionCallWithModelIdOverrides extends SerializedActionCall {
9
11
  /**
@@ -24,6 +26,8 @@ export interface SerializedActionCallWithModelIdOverrides extends SerializedActi
24
26
  * @param call The serialized action, usually as coming from the server/client.
25
27
  * @returns The return value of the action, if any, plus a new serialized action
26
28
  * with model overrides.
29
+ *
30
+ * @deprecated Use `applyCall` / `applyCallAsync` on the server instead, broadcasting the patches the call produces.
27
31
  */
28
32
  export declare function applySerializedActionAndTrackNewModelIds<TRet = any>(subtreeRoot: object, call: SerializedActionCall): {
29
33
  returnValue: TRet;
@@ -41,5 +45,7 @@ export declare function applySerializedActionAndTrackNewModelIds<TRet = any>(sub
41
45
  * @param subtreeRoot Subtree root target object to run the action over.
42
46
  * @param call The serialized action, usually as coming from the server/client.
43
47
  * @returns The return value of the action, if any.
48
+ *
49
+ * @deprecated Use `applyPatches` on the patches the server broadcasts instead.
44
50
  */
45
51
  export declare function applySerializedActionAndSyncNewModelIds<TRet = any>(subtreeRoot: object, call: SerializedActionCallWithModelIdOverrides): TRet;
@@ -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,6 +1,13 @@
1
+ /**
2
+ * Returned by an `ActionCallArgumentSerializer` that can't serialize a value.
3
+ *
4
+ * @deprecated Use `ValueSerializer.is` returning false instead.
5
+ */
1
6
  export declare const cannotSerialize: unique symbol;
2
7
  /**
3
8
  * Serializer of action call arguments.
9
+ *
10
+ * @deprecated Use `ValueSerializer` instead.
4
11
  */
5
12
  export interface ActionCallArgumentSerializer<TOriginal, TSerialized> {
6
13
  /**
@@ -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,25 @@
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 "./serialization";
17
+ export * from "./snapshot";
18
+ export * from "./standardActions";
19
+ export * from "./transforms";
20
+ export * from "./treeUtils";
21
+ export * from "./tweaker";
22
+ export * from "./types";
23
+ export * from "./utils";
24
+ export * from "./utils/tag";
25
+ 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
  *