1 | /// <reference types="node" />
|
2 |
|
3 | import gulp = require("gulp");
|
4 | import undertaker = require("undertaker");
|
5 |
|
6 | declare namespace r {
|
7 | type Task = string | string[] | null | undefined;
|
8 |
|
9 | interface RunSequence {
|
10 | /**
|
11 | * Runs a sequence of gulp tasks in the specified order.
|
12 | * This function is designed to solve the situation where
|
13 | * you have defined run-order, but choose not to or cannot use dependencies.
|
14 | *
|
15 | * Each argument to run-sequence is run in order.
|
16 | * This works by listening to the `task_stop` and `task_err` events,
|
17 | * and keeping track of which tasks have been completed.
|
18 | * You can still run some of the tasks in parallel,
|
19 | * by providing an array of task names for one or more of the arguments.
|
20 | *
|
21 | * If the final argument is a function, it will be used as a callback
|
22 | * after all the functions are either finished or an error has occurred.
|
23 | */
|
24 | (...tasks: [...r.Task[], undertaker.TaskCallback]): NodeJS.ReadWriteStream;
|
25 | (...tasks: r.Task[]): NodeJS.ReadWriteStream;
|
26 |
|
27 | /**
|
28 | * If you have a complex gulp setup with your tasks split up across different files,
|
29 | * you may get the error that run-sequence is unable to find your tasks.
|
30 | * In this case, you can configure run-sequence to look at the gulp within the submodule.
|
31 | */
|
32 | use(gulp: gulp.Gulp): RunSequence;
|
33 |
|
34 | /**
|
35 | * There are a few global options you can configure on the `runSequence` function.
|
36 | *
|
37 | * Please note these are **global to the module**,
|
38 | * and once set will affect every use of `runSequence`.
|
39 | */
|
40 | options: {
|
41 | /**
|
42 | * When set to `false`, this suppresses the full stack trace from errors captured
|
43 | * during a sequence.
|
44 | *
|
45 | * @default true
|
46 | */
|
47 | showErrorStackTrace: boolean;
|
48 |
|
49 | /**
|
50 | * When set to `true`, this enables you to pass falsey values
|
51 | * in which will be stripped from the task set before validation and sequencing.
|
52 | *
|
53 | * @default false
|
54 | */
|
55 | ignoreUndefinedTasks: boolean;
|
56 | };
|
57 | }
|
58 | }
|
59 |
|
60 | declare const r: r.RunSequence;
|
61 | export = r;
|