|
| 1 | +// Type definitions for gulp-task-listing |
| 2 | +// Project: https://github.com/OverZealous/gulp-task-listing |
| 3 | +// Definitions by: Joe Skeen <http://github.com/joeskeen> |
| 4 | +// Definitions: https://github.com/borisyankov/DefinitelyTyped |
| 5 | + |
| 6 | +/** |
| 7 | + * Provides an easy way to get a listing of your tasks from your gulpfile. By default, the |
| 8 | + * output groups tasks based on whether or not they contain a hyphen (-), underscore (_), |
| 9 | + * or colon (:) in their name. |
| 10 | + * |
| 11 | + * You can optionally override the Regexp used to determine whether a task is a primary or |
| 12 | + * subtask, as well as filter out tasks you don't want to see in the output. |
| 13 | + */ |
| 14 | +declare module 'gulp-task-listing' { |
| 15 | + |
| 16 | + /** |
| 17 | + * Provides an easy way to get a listing of your tasks from your gulpfile. By default, the |
| 18 | + * output groups tasks based on whether or not they contain a hyphen (-), underscore (_), |
| 19 | + * or colon (:) in their name. |
| 20 | + * |
| 21 | + * You can optionally override the Regexp used to determine whether a task is a primary or |
| 22 | + * subtask, as well as filter out tasks you don't want to see in the output. |
| 23 | + */ |
| 24 | + interface GulpTaskListing { |
| 25 | + (cb): void; |
| 26 | + /** |
| 27 | + * Allows for custom filtering of Gulp tasks in the listing |
| 28 | + * |
| 29 | + * @param subTaskFilter a RegExp or Function returning whether the given task is a subtask |
| 30 | + * @param excludeFilter a RegExp or Function returning whether the given task should be excluded from the listing |
| 31 | + */ |
| 32 | + withFilters(subTaskFilter: RegExp | FilterFunction, excludeFilter?: RegExp | FilterFunction): (cb) => void; |
| 33 | + } |
| 34 | + |
| 35 | + type FilterFunction = (task: string) => boolean; |
| 36 | + |
| 37 | + var gulpTaskListing: GulpTaskListing; |
| 38 | + |
| 39 | + export = gulpTaskListing; |
| 40 | +} |
0 commit comments