From eb806511c335c16490bb3bcd17ad2fffc02db5c6 Mon Sep 17 00:00:00 2001 From: Petr Koutny Date: Tue, 19 Dec 2017 20:38:50 +0100 Subject: [PATCH] Added overload of gulp.task method with dependencies --- types/undertaker/index.d.ts | 8 ++++++++ types/undertaker/undertaker-tests.ts | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/types/undertaker/index.d.ts b/types/undertaker/index.d.ts index f4dcb58417..f7775ce28b 100644 --- a/types/undertaker/index.d.ts +++ b/types/undertaker/index.d.ts @@ -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. diff --git a/types/undertaker/undertaker-tests.ts b/types/undertaker/undertaker-tests.ts index c7969a3c52..d9ec56255e 100644 --- a/types/undertaker/undertaker-tests.ts +++ b/types/undertaker/undertaker-tests.ts @@ -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"));