@twin.org/engine-models 0.0.1-next.12 → 0.0.1-next.13

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.
@@ -36,6 +36,7 @@ export * from "./models/config/typeConfig/vaultConnectorConfig";
36
36
  export * from "./models/config/typeConfig/walletConnectorConfig";
37
37
  export * from "./models/engineTypeInitialiser";
38
38
  export * from "./models/IEngineCore";
39
+ export * from "./models/IEngineCoreClone";
39
40
  export * from "./models/IEngineCoreContext";
40
41
  export * from "./models/IEngineServer";
41
42
  export * from "./models/IEngineState";
@@ -3,6 +3,7 @@ import type { IEngineCoreConfig } from "./config/IEngineCoreConfig";
3
3
  import type { IEngineCoreTypeBaseConfig } from "./config/IEngineCoreTypeBaseConfig";
4
4
  import type { IEngineCoreTypeConfig } from "./config/IEngineCoreTypeConfig";
5
5
  import type { EngineTypeInitialiser } from "./engineTypeInitialiser";
6
+ import type { IEngineCoreClone } from "./IEngineCoreClone";
6
7
  import type { IEngineState } from "./IEngineState";
7
8
  /**
8
9
  * Interface describing the engine core methods.
@@ -52,4 +53,14 @@ export interface IEngineCore<S extends IEngineState = IEngineState> {
52
53
  getDefaultTypes(): {
53
54
  [type: string]: string;
54
55
  };
56
+ /**
57
+ * Get the data required to create a clone of the engine.
58
+ * @returns The clone data.
59
+ */
60
+ getCloneData(): IEngineCoreClone;
61
+ /**
62
+ * Populate the engine from the clone data.
63
+ * @param cloneData The clone data to populate from.
64
+ */
65
+ populateClone(cloneData: IEngineCoreClone): void;
55
66
  }
@@ -0,0 +1,15 @@
1
+ import type { IEngineCoreConfig } from "./config/IEngineCoreConfig";
2
+ import type { IEngineState } from "./IEngineState";
3
+ /**
4
+ * Interface describing the data required to clone an engine.
5
+ */
6
+ export interface IEngineCoreClone<S extends IEngineState = IEngineState> {
7
+ /**
8
+ * The config for the engine.
9
+ */
10
+ config: IEngineCoreConfig;
11
+ /**
12
+ * The state of the engine.
13
+ */
14
+ state: S;
15
+ }
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/engine-models - Changelog
2
2
 
3
- ## v0.0.1-next.12
3
+ ## v0.0.1-next.13
4
4
 
5
5
  - Initial Release
@@ -3,6 +3,7 @@
3
3
  ## Interfaces
4
4
 
5
5
  - [IEngineCore](interfaces/IEngineCore.md)
6
+ - [IEngineCoreClone](interfaces/IEngineCoreClone.md)
6
7
  - [IEngineCoreContext](interfaces/IEngineCoreContext.md)
7
8
  - [IEngineServer](interfaces/IEngineServer.md)
8
9
  - [IEngineState](interfaces/IEngineState.md)
@@ -141,3 +141,35 @@ Get the types for the component.
141
141
  `object`
142
142
 
143
143
  The default types.
144
+
145
+ ***
146
+
147
+ ### getCloneData()
148
+
149
+ > **getCloneData**(): [`IEngineCoreClone`](IEngineCoreClone.md)\<[`IEngineState`](IEngineState.md)\>
150
+
151
+ Get the data required to create a clone of the engine.
152
+
153
+ #### Returns
154
+
155
+ [`IEngineCoreClone`](IEngineCoreClone.md)\<[`IEngineState`](IEngineState.md)\>
156
+
157
+ The clone data.
158
+
159
+ ***
160
+
161
+ ### populateClone()
162
+
163
+ > **populateClone**(`cloneData`): `void`
164
+
165
+ Populate the engine from the clone data.
166
+
167
+ #### Parameters
168
+
169
+ • **cloneData**: [`IEngineCoreClone`](IEngineCoreClone.md)\<[`IEngineState`](IEngineState.md)\>
170
+
171
+ The clone data to populate from.
172
+
173
+ #### Returns
174
+
175
+ `void`
@@ -0,0 +1,23 @@
1
+ # Interface: IEngineCoreClone\<S\>
2
+
3
+ Interface describing the data required to clone an engine.
4
+
5
+ ## Type Parameters
6
+
7
+ • **S** *extends* [`IEngineState`](IEngineState.md) = [`IEngineState`](IEngineState.md)
8
+
9
+ ## Properties
10
+
11
+ ### config
12
+
13
+ > **config**: [`IEngineCoreConfig`](IEngineCoreConfig.md)
14
+
15
+ The config for the engine.
16
+
17
+ ***
18
+
19
+ ### state
20
+
21
+ > **state**: `S`
22
+
23
+ The state of the engine.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/engine-models",
3
- "version": "0.0.1-next.12",
3
+ "version": "0.0.1-next.13",
4
4
  "description": "Models which define the structure of the engine.",
5
5
  "repository": {
6
6
  "type": "git",