@twin.org/background-task-models 0.0.1-next.2 → 0.0.1-next.4
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.
- package/dist/types/index.d.ts +0 -1
- package/dist/types/models/IBackgroundTaskConnector.d.ts +3 -3
- package/docs/changelog.md +1 -1
- package/docs/reference/index.md +0 -1
- package/docs/reference/interfaces/IBackgroundTaskConnector.md +7 -9
- package/package.json +2 -2
- package/dist/types/models/backgroundTaskHandler.d.ts +0 -4
- package/docs/reference/type-aliases/BackgroundTaskHandler.md +0 -19
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { IComponent } from "@twin.org/core";
|
|
2
2
|
import type { SortDirection } from "@twin.org/entity";
|
|
3
|
-
import type { BackgroundTaskHandler } from "./backgroundTaskHandler";
|
|
4
3
|
import type { IBackgroundTask } from "./IBackgroundTask";
|
|
5
4
|
import type { TaskStatus } from "./taskStatus";
|
|
6
5
|
/**
|
|
@@ -10,10 +9,11 @@ export interface IBackgroundTaskConnector extends IComponent {
|
|
|
10
9
|
/**
|
|
11
10
|
* Register a handler for a task.
|
|
12
11
|
* @param taskType The type of the task the handler can process.
|
|
13
|
-
* @param
|
|
12
|
+
* @param module The module the handler is in.
|
|
13
|
+
* @param method The method in the module to execute.
|
|
14
14
|
* @returns Nothing.
|
|
15
15
|
*/
|
|
16
|
-
registerHandler
|
|
16
|
+
registerHandler(taskType: string, module: string, method: string): Promise<void>;
|
|
17
17
|
/**
|
|
18
18
|
* Unregister a handler for a task.
|
|
19
19
|
* @param taskType The type of the task handler to remove.
|
package/docs/changelog.md
CHANGED
package/docs/reference/index.md
CHANGED
|
@@ -10,25 +10,23 @@ Interface describing a background task connector.
|
|
|
10
10
|
|
|
11
11
|
### registerHandler()
|
|
12
12
|
|
|
13
|
-
> **registerHandler
|
|
13
|
+
> **registerHandler**(`taskType`, `module`, `method`): `Promise`\<`void`\>
|
|
14
14
|
|
|
15
15
|
Register a handler for a task.
|
|
16
16
|
|
|
17
|
-
#### Type Parameters
|
|
18
|
-
|
|
19
|
-
• **T**
|
|
20
|
-
|
|
21
|
-
• **U**
|
|
22
|
-
|
|
23
17
|
#### Parameters
|
|
24
18
|
|
|
25
19
|
• **taskType**: `string`
|
|
26
20
|
|
|
27
21
|
The type of the task the handler can process.
|
|
28
22
|
|
|
29
|
-
• **
|
|
23
|
+
• **module**: `string`
|
|
24
|
+
|
|
25
|
+
The module the handler is in.
|
|
26
|
+
|
|
27
|
+
• **method**: `string`
|
|
30
28
|
|
|
31
|
-
The
|
|
29
|
+
The method in the module to execute.
|
|
32
30
|
|
|
33
31
|
#### Returns
|
|
34
32
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/background-task-models",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.4",
|
|
4
4
|
"description": "Models which define the structure of the background task contracts and connectors",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"import": "./dist/esm/index.mjs",
|
|
28
28
|
"types": "./dist/types/index.d.ts"
|
|
29
29
|
},
|
|
30
|
-
"./locales": "./locales"
|
|
30
|
+
"./locales/*.json": "./locales/*.json"
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
33
|
"dist/cjs",
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# Type Alias: BackgroundTaskHandler()\<T, U\>
|
|
2
|
-
|
|
3
|
-
> **BackgroundTaskHandler**\<`T`, `U`\>: (`payload`) => `Promise`\<`U`\>
|
|
4
|
-
|
|
5
|
-
Interface describing a task handler, exceptions thrown in the handler will be caught.
|
|
6
|
-
|
|
7
|
-
## Type Parameters
|
|
8
|
-
|
|
9
|
-
• **T** = `any`
|
|
10
|
-
|
|
11
|
-
• **U** = `any`
|
|
12
|
-
|
|
13
|
-
## Parameters
|
|
14
|
-
|
|
15
|
-
• **payload**: `T`
|
|
16
|
-
|
|
17
|
-
## Returns
|
|
18
|
-
|
|
19
|
-
`Promise`\<`U`\>
|