UNPKG

1.44 kBTypeScriptView Raw
1import { Dependency, TaskDep } from './task';
2import { TaskContext } from './task-manager';
3export declare class DepBuilder<O = any> {
4 private _dep;
5 readonly _isDepBuilder = true;
6 constructor(name: Dependency);
7 /**
8 *
9 * Dependences are executed serially by default.
10 * If order doesn't matter and you want better performance via parallel, you can mark it as asynchronized.
11 * Asynchronized will run immediately whether there are synchronized tasks before them or not.
12 * You can pass a number as the priority of asynchronized tasks, bigger is formmer.
13 * @param priority
14 */
15 async(priority?: number | boolean): this;
16 force(): this;
17 options(opts: O | ((ctx: TaskContext) => O)): this;
18 toTaskDep(): TaskDep<O>;
19}
20export declare function dep(dep: Dependency): DepBuilder<any>;
21declare global {
22 interface String {
23 /**
24 * Dependences are executed serially by default.
25 * If order doesn't matter and you want better performance via parallel, you can mark it as asynchronized.
26 * Asynchronized will run immediately whether there are synchronized tasks before them or not.
27 * You can pass a number as the priority of asynchronized tasks, bigger is formmer.
28 */
29 async(priority?: number | boolean): DepBuilder;
30 force(): DepBuilder;
31 options<O>(opts: O | NonNullable<TaskDep['resolveOptions']>): DepBuilder;
32 }
33}