mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-07 10:40:13 +00:00
feat(undertaker): task returns a wrapped fn
Undertaker's task setter wraps the original function: https://github.com/gulpjs/undertaker/blob/master/lib/set-task.js
This commit is contained in:
13
types/undertaker/index.d.ts
vendored
13
types/undertaker/index.d.ts
vendored
@@ -19,12 +19,19 @@ declare namespace Undertaker {
|
||||
[arg: string]: string;
|
||||
}
|
||||
|
||||
interface TaskFunction extends TaskFunctionParams {
|
||||
interface TaskFunctionBase {
|
||||
(done: (error?: any) => void): void | Duplex | NodeJS.Process | Promise<never> | any;
|
||||
}
|
||||
|
||||
interface TaskFunction extends TaskFunctionBase, TaskFunctionParams {}
|
||||
|
||||
type Task = string | TaskFunction;
|
||||
|
||||
interface TaskFunctionWrapped extends TaskFunctionBase {
|
||||
displayName: string;
|
||||
unwrap(): TaskFunction;
|
||||
}
|
||||
|
||||
interface TreeOptions {
|
||||
/**
|
||||
* Whether or not the whole tree should be returned.
|
||||
@@ -50,10 +57,10 @@ declare class Undertaker extends EventEmitter {
|
||||
constructor(registry?: Registry);
|
||||
|
||||
/**
|
||||
* Returns the registered function.
|
||||
* Returns the wrapped registered function.
|
||||
* @param taskName - Task name.
|
||||
*/
|
||||
task(taskName: string): Undertaker.TaskFunction;
|
||||
task(taskName: string): Undertaker.TaskFunctionWrapped;
|
||||
|
||||
/**
|
||||
* Register the task by the taskName.
|
||||
|
||||
Reference in New Issue
Block a user