@twin.org/engine-models 0.0.2-next.4 → 0.0.2-next.6

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.
@@ -46,12 +46,30 @@ export interface IEngineCore<C extends IEngineCoreConfig = IEngineCoreConfig, S
46
46
  */
47
47
  getState(): S;
48
48
  /**
49
- * Get the types for the component.
50
- * @returns The default types.
49
+ * Get all the registered instances.
50
+ * @returns The registered instances.
51
51
  */
52
- getDefaultTypes(): {
53
- [type: string]: string;
52
+ getRegisteredInstances(): {
53
+ [name: string]: {
54
+ type: string;
55
+ features?: string[];
56
+ }[];
54
57
  };
58
+ /**
59
+ * Get the registered instance type for the component/connector.
60
+ * @param componentConnectorType The type of the component/connector.
61
+ * @param features The requested features of the component, if not specified the default entry will be retrieved.
62
+ * @returns The instance type matching the criteria if one is registered.
63
+ * @throws If a matching instance was not found.
64
+ */
65
+ getRegisteredInstanceType(componentConnectorType: string, features?: string[]): string;
66
+ /**
67
+ * Get the registered instance type for the component/connector.
68
+ * @param componentConnectorType The type of the component/connector.
69
+ * @param features The requested features of the component, if not specified the default entry will be retrieved.
70
+ * @returns The instance type matching the criteria if one is registered.
71
+ */
72
+ getRegisteredInstanceTypeOptional(componentConnectorType: string, features?: string[]): string | undefined;
55
73
  /**
56
74
  * Get the data required to create a clone of the engine.
57
75
  * @returns The clone data.
@@ -18,10 +18,14 @@ export interface IEngineCoreContext<C extends IEngineCoreConfig = IEngineCoreCon
18
18
  */
19
19
  stateDirty: boolean;
20
20
  /**
21
- * The default types to use when components don't have custom types.
21
+ * The registered instances to use when components don't have custom types.
22
+ * The default entry will be the first in the list.
22
23
  */
23
- defaultTypes: {
24
- [type: string]: string;
24
+ registeredInstances: {
25
+ [name: string]: {
26
+ type: string;
27
+ features?: string[];
28
+ }[];
25
29
  };
26
30
  /**
27
31
  * The components.
@@ -8,4 +8,5 @@ export type IEngineCoreTypeConfig<T extends IEngineCoreTypeBaseConfig = {
8
8
  [id: string]: unknown;
9
9
  overrideInstanceType?: string;
10
10
  isDefault?: boolean;
11
+ features?: string[];
11
12
  };
package/docs/changelog.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @twin.org/engine-models - Changelog
2
2
 
3
+ ## [0.0.2-next.6](https://github.com/twinfoundation/engine/compare/engine-models-v0.0.2-next.5...engine-models-v0.0.2-next.6) (2025-08-21)
4
+
5
+
6
+ ### Features
7
+
8
+ * update framework core ([acc0f8d](https://github.com/twinfoundation/engine/commit/acc0f8d455a4b8ec47f1da643139fa0f07775fa6))
9
+
10
+ ## [0.0.2-next.5](https://github.com/twinfoundation/engine/compare/engine-models-v0.0.2-next.4...engine-models-v0.0.2-next.5) (2025-08-14)
11
+
12
+
13
+ ### Features
14
+
15
+ * add synchronised storage support ([5142e34](https://github.com/twinfoundation/engine/commit/5142e3488f09195cf9f48a9c6c6d1014231a4c2c))
16
+
3
17
  ## [0.0.2-next.4](https://github.com/twinfoundation/engine/compare/engine-models-v0.0.2-next.3...engine-models-v0.0.2-next.4) (2025-07-25)
4
18
 
5
19
 
@@ -148,17 +148,77 @@ The state of the engine.
148
148
 
149
149
  ***
150
150
 
151
- ### getDefaultTypes()
151
+ ### getRegisteredInstances()
152
152
 
153
- > **getDefaultTypes**(): `object`
153
+ > **getRegisteredInstances**(): `object`
154
154
 
155
- Get the types for the component.
155
+ Get all the registered instances.
156
156
 
157
157
  #### Returns
158
158
 
159
159
  `object`
160
160
 
161
- The default types.
161
+ The registered instances.
162
+
163
+ ***
164
+
165
+ ### getRegisteredInstanceType()
166
+
167
+ > **getRegisteredInstanceType**(`componentConnectorType`, `features?`): `string`
168
+
169
+ Get the registered instance type for the component/connector.
170
+
171
+ #### Parameters
172
+
173
+ ##### componentConnectorType
174
+
175
+ `string`
176
+
177
+ The type of the component/connector.
178
+
179
+ ##### features?
180
+
181
+ `string`[]
182
+
183
+ The requested features of the component, if not specified the default entry will be retrieved.
184
+
185
+ #### Returns
186
+
187
+ `string`
188
+
189
+ The instance type matching the criteria if one is registered.
190
+
191
+ #### Throws
192
+
193
+ If a matching instance was not found.
194
+
195
+ ***
196
+
197
+ ### getRegisteredInstanceTypeOptional()
198
+
199
+ > **getRegisteredInstanceTypeOptional**(`componentConnectorType`, `features?`): `undefined` \| `string`
200
+
201
+ Get the registered instance type for the component/connector.
202
+
203
+ #### Parameters
204
+
205
+ ##### componentConnectorType
206
+
207
+ `string`
208
+
209
+ The type of the component/connector.
210
+
211
+ ##### features?
212
+
213
+ `string`[]
214
+
215
+ The requested features of the component, if not specified the default entry will be retrieved.
216
+
217
+ #### Returns
218
+
219
+ `undefined` \| `string`
220
+
221
+ The instance type matching the criteria if one is registered.
162
222
 
163
223
  ***
164
224
 
@@ -38,15 +38,16 @@ The state dirty flag, which flags that the state needs saving.
38
38
 
39
39
  ***
40
40
 
41
- ### defaultTypes
41
+ ### registeredInstances
42
42
 
43
- > **defaultTypes**: `object`
43
+ > **registeredInstances**: `object`
44
44
 
45
- The default types to use when components don't have custom types.
45
+ The registered instances to use when components don't have custom types.
46
+ The default entry will be the first in the list.
46
47
 
47
48
  #### Index Signature
48
49
 
49
- \[`type`: `string`\]: `string`
50
+ \[`name`: `string`\]: `object`[]
50
51
 
51
52
  ***
52
53
 
@@ -14,6 +14,10 @@ Configuration for the engine core type.
14
14
 
15
15
  > `optional` **isDefault**: `boolean`
16
16
 
17
+ ### features?
18
+
19
+ > `optional` **features**: `string`[]
20
+
17
21
  ## Type Parameters
18
22
 
19
23
  ### T
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/engine-models",
3
- "version": "0.0.2-next.4",
3
+ "version": "0.0.2-next.6",
4
4
  "description": "Models which define the structure of the engine.",
5
5
  "repository": {
6
6
  "type": "git",