@e-mc/task 0.8.3 → 0.8.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.
Files changed (2) hide show
  1. package/README.md +45 -3
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,7 +1,49 @@
1
- ### @e-mc/task
1
+ # @e-mc/task
2
2
 
3
- https://e-mc.readthedocs.io
3
+ * NodeJS 14
4
+ * ES2020
4
5
 
5
- ### LICENSE
6
+ ## General Usage
7
+
8
+ * [Read the Docs](https://e-mc.readthedocs.io)
9
+
10
+ ## Interface
11
+
12
+ - https://www.unpkg.com/@e-mc/types@0.8.4/lib/index.d.ts
13
+
14
+ ```typescript
15
+ import type { IFileManager, IHost, ModuleConstructor } from "./index";
16
+ import type { ExternalAsset, IFileThread } from "./asset";
17
+ import type { IClient } from "./core";
18
+ import type { TaskModule } from "./settings";
19
+ import type { Command, SpawnResult } from "./task";
20
+
21
+ interface ITask extends IClient<IHost, TaskModule> {
22
+ using?(data: IFileThread): Promise<unknown>;
23
+ collect?(items: unknown[], preceding?: boolean): Promise<SpawnResult>[];
24
+ map?(tasks: Command[]): Promise<SpawnResult | undefined>[];
25
+ series?(tasks: Command[]): Promise<unknown>;
26
+ parallel?(tasks: Command[]): Promise<unknown>;
27
+ spawn?(task: Record<string | number | symbol, unknown>, callback: (result?: SpawnResult) => void): void;
28
+ execute?(manager: IFileManager, task: Record<string | number | symbol, unknown>, callback: (value?: unknown) => void): void;
29
+ }
30
+
31
+ interface TaskConstructor extends ModuleConstructor {
32
+ finalize(this: IHost, instance: ITask, assets: ExternalAsset[]): Promise<unknown>;
33
+ /* @deprecated - ITask.using */
34
+ using?(this: IHost, instance: ITask, assets: ExternalAsset[], preceding?: boolean): Promise<unknown>;
35
+ readonly prototype: ITask;
36
+ new(module?: TaskModule, ...args: unknown[]): ITask;
37
+ }
38
+ ```
39
+
40
+ ## References
41
+
42
+ - https://www.unpkg.com/@e-mc/types@0.8.4/lib/asset.d.ts
43
+ - https://www.unpkg.com/@e-mc/types@0.8.4/lib/core.d.ts
44
+ - https://www.unpkg.com/@e-mc/types@0.8.4/lib/settings.d.ts
45
+ - https://www.unpkg.com/@e-mc/types@0.8.4/lib/task.d.ts
46
+
47
+ ## LICENSE
6
48
 
7
49
  BSD 3-Clause
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/task",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
4
4
  "description": "Task constructor for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -20,6 +20,6 @@
20
20
  "license": "BSD 3-Clause",
21
21
  "homepage": "https://github.com/anpham6/e-mc#readme",
22
22
  "dependencies": {
23
- "@e-mc/core": "0.8.3"
23
+ "@e-mc/core": "0.8.4"
24
24
  }
25
25
  }