@twin.org/engine-core 0.0.3-next.5 → 0.0.3-next.50

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.
@@ -1,5 +1,5 @@
1
1
  import { type IContextIds } from "@twin.org/context";
2
- import { type IError } from "@twin.org/core";
2
+ import { type IComponent, type IError } from "@twin.org/core";
3
3
  import type { IEngineCore, IEngineCoreClone, IEngineCoreConfig, IEngineCoreContext, IEngineCoreTypeConfig, IEngineState } from "@twin.org/engine-models";
4
4
  import type { IEngineCoreOptions } from "./models/IEngineCoreOptions.js";
5
5
  /**
@@ -75,9 +75,10 @@ export declare class EngineCore<C extends IEngineCoreConfig = IEngineCoreConfig,
75
75
  getContextIds(): IContextIds | undefined;
76
76
  /**
77
77
  * Start the engine core.
78
- * @returns True if the start was successful.
78
+ * @param skipComponentStart Should the component start be skipped.
79
+ * @returns Nothing.
79
80
  */
80
- start(): Promise<boolean>;
81
+ start(skipComponentStart?: boolean): Promise<void>;
81
82
  /**
82
83
  * Stop the engine core.
83
84
  * @returns Nothing.
@@ -118,6 +119,10 @@ export declare class EngineCore<C extends IEngineCoreConfig = IEngineCoreConfig,
118
119
  * @returns The state of the engine.
119
120
  */
120
121
  getState(): S;
122
+ /**
123
+ * Set the state to dirty so it gets saved.
124
+ */
125
+ setStateDirty(): void;
121
126
  /**
122
127
  * Get all the registered instances.
123
128
  * @returns The registered instances.
@@ -144,6 +149,28 @@ export declare class EngineCore<C extends IEngineCoreConfig = IEngineCoreConfig,
144
149
  * @returns The instance type matching the criteria if one is registered.
145
150
  */
146
151
  getRegisteredInstanceTypeOptional(componentConnectorType: string, features?: string[]): string | undefined;
152
+ /**
153
+ * Get the registered logger for the component/connector.
154
+ * @param componentName The name of the component to get the logger for.
155
+ * @returns The logger type name if one is registered and not silenced.
156
+ */
157
+ getRegisteredLoggerType(componentName: string): string | undefined;
158
+ /**
159
+ * Get the registered components.
160
+ * @returns The registered components.
161
+ */
162
+ getRegisteredComponents(): Promise<{
163
+ instanceType: string;
164
+ component: IComponent;
165
+ initialised: boolean;
166
+ }[]>;
167
+ /**
168
+ * Add a registered component to the engine.
169
+ * @param instanceType The instance type to register the component under.
170
+ * @param component The component to register.
171
+ * @returns Nothing.
172
+ */
173
+ addRegisteredComponent(instanceType: string, component: IComponent): Promise<void>;
147
174
  /**
148
175
  * Get the data required to create a clone of the engine.
149
176
  * @returns The clone data.
@@ -152,7 +179,8 @@ export declare class EngineCore<C extends IEngineCoreConfig = IEngineCoreConfig,
152
179
  /**
153
180
  * Populate the engine from the clone data.
154
181
  * @param cloneData The clone data to populate from.
182
+ * @param contextIds The context IDs to use for the clone.
155
183
  * @param silent Should the clone be silent.
156
184
  */
157
- populateClone(cloneData: IEngineCoreClone<C, S>, silent?: boolean): void;
185
+ populateClone(cloneData: IEngineCoreClone<C, S>, contextIds?: IContextIds, silent?: boolean): void;
158
186
  }