mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-09 22:40:18 +08:00
Added overload of gulp.task method with dependencies
This commit is contained in:
8
types/undertaker/index.d.ts
vendored
8
types/undertaker/index.d.ts
vendored
@@ -57,6 +57,14 @@ declare class Undertaker extends EventEmitter {
|
||||
*/
|
||||
task(taskName: string, fn: Undertaker.TaskFunction): void;
|
||||
|
||||
/**
|
||||
* Register the task by the taskName.
|
||||
* @param taskName - Task name.
|
||||
* @param dependencies - Task dependencies.
|
||||
* @param fn - Task function.
|
||||
*/
|
||||
task(taskName: string, dependencies: string[], fn: Undertaker.TaskFunction): void;
|
||||
|
||||
/**
|
||||
* Register the task by the name property of the function.
|
||||
* @param fn - Task function.
|
||||
|
||||
@@ -22,6 +22,13 @@ taker.task("task3", () => {
|
||||
});
|
||||
});
|
||||
|
||||
taker.task("task3", ["task1"], () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
// do things depending on "task1"
|
||||
resolve(); // when everything is done
|
||||
});
|
||||
});
|
||||
|
||||
taker.task("combined", taker.series("task1", "task2"));
|
||||
|
||||
taker.task("all", taker.parallel("combined", "task3"));
|
||||
|
||||
Reference in New Issue
Block a user