@twin.org/background-task-models 0.0.1-next.4 → 0.0.1-next.5
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.
|
@@ -11,9 +11,10 @@ export interface IBackgroundTaskConnector extends IComponent {
|
|
|
11
11
|
* @param taskType The type of the task the handler can process.
|
|
12
12
|
* @param module The module the handler is in.
|
|
13
13
|
* @param method The method in the module to execute.
|
|
14
|
+
* @param stateChangeCallback The callback to execute when the task state is updated.
|
|
14
15
|
* @returns Nothing.
|
|
15
16
|
*/
|
|
16
|
-
registerHandler(taskType: string, module: string, method: string): Promise<void>;
|
|
17
|
+
registerHandler<T, U>(taskType: string, module: string, method: string, stateChangeCallback?: (task: IBackgroundTask<T, U>) => Promise<void>): Promise<void>;
|
|
17
18
|
/**
|
|
18
19
|
* Unregister a handler for a task.
|
|
19
20
|
* @param taskType The type of the task handler to remove.
|
package/docs/changelog.md
CHANGED
|
@@ -10,10 +10,16 @@ Interface describing a background task connector.
|
|
|
10
10
|
|
|
11
11
|
### registerHandler()
|
|
12
12
|
|
|
13
|
-
> **registerHandler
|
|
13
|
+
> **registerHandler**\<`T`, `U`\>(`taskType`, `module`, `method`, `stateChangeCallback`?): `Promise`\<`void`\>
|
|
14
14
|
|
|
15
15
|
Register a handler for a task.
|
|
16
16
|
|
|
17
|
+
#### Type Parameters
|
|
18
|
+
|
|
19
|
+
• **T**
|
|
20
|
+
|
|
21
|
+
• **U**
|
|
22
|
+
|
|
17
23
|
#### Parameters
|
|
18
24
|
|
|
19
25
|
• **taskType**: `string`
|
|
@@ -28,6 +34,10 @@ The module the handler is in.
|
|
|
28
34
|
|
|
29
35
|
The method in the module to execute.
|
|
30
36
|
|
|
37
|
+
• **stateChangeCallback?**
|
|
38
|
+
|
|
39
|
+
The callback to execute when the task state is updated.
|
|
40
|
+
|
|
31
41
|
#### Returns
|
|
32
42
|
|
|
33
43
|
`Promise`\<`void`\>
|
package/package.json
CHANGED