Task constructor for E-mc.
npm install @e-mc/task* NodeJS 18.20.5 LTS
* ES2022
``typescript
import type { IFileManager, IHost, ModuleConstructor } from "./index";
import type { ExternalAsset, IFileThread } from "./asset";
import type { IClient } from "./core";
import type { TaskModule } from "./settings";
import type { Command, SpawnResult } from "./task";
interface ITask extends IClient
using?(data: IFileThread): Promise
collect?(items: unknown[], preceding?: boolean): Promise
map?(tasks: Command[]): Promise
series?(tasks: Command[]): Promise
parallel?(tasks: Command[]): Promise
spawn?(task: Record
execute?(manager: IFileManager, task: Record
}
interface TaskConstructor extends ModuleConstructor {
finalize(this: IHost, instance: ITask, assets: ExternalAsset[]): Promise
readonly prototype: ITask;
new(module?: TaskModule, ...args: unknown[]): ITask;
}
`
`typescript
import type { PermittedDirectories } from "./core";
interface TaskModule {
// handler: "@pi-r/gulp";
settings?: {
broadcast_id?: string | string[];
users?: Record
exec?: {
uid?: number;
gid?: number;
};
};
permission?: PermittedDirectories;
}
``
NOTE: Usage without a Host is conducted through static methods. The using class method is called by the Host to perform the transformation.
- https://www.unpkg.com/@e-mc/types@0.13.7/lib/asset.d.ts
- https://www.unpkg.com/@e-mc/types@0.13.7/lib/core.d.ts
- https://www.unpkg.com/@e-mc/types@0.13.7/lib/settings.d.ts
- https://www.unpkg.com/@e-mc/types@0.13.7/lib/task.d.ts
BSD 3-Clause