mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 04:01:52 +00:00
Added new type definition for gulp-help-doc (#10375)
* Added gulp-help-doc definitions * Fixed declaration and tests * Fixed declaration and tests * Definition fixed * Declaration fixed
This commit is contained in:
committed by
Masahiro Wakame
parent
46ed88240c
commit
b1e87b552d
@@ -0,0 +1,27 @@
|
||||
/// <reference path="gulp-help-doc.d.ts" />
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="../gulp/gulp.d.ts" />
|
||||
|
||||
import gulp = require('gulp');
|
||||
import usage = require('gulp-help-doc');
|
||||
|
||||
/**
|
||||
* Demo task
|
||||
*
|
||||
* @task {demo}
|
||||
* @arg {env} environment
|
||||
*/
|
||||
gulp.task('demo', function() {});
|
||||
|
||||
let logger: {
|
||||
output: string,
|
||||
log(msg: string): any
|
||||
} = {
|
||||
output: '',
|
||||
log: msg => logger.output += msg + '\n'
|
||||
};
|
||||
|
||||
usage(gulp, {
|
||||
logger: logger,
|
||||
gulpfile: __filename
|
||||
}).then(() => console.log(logger.output));
|
||||
Vendored
+56
@@ -0,0 +1,56 @@
|
||||
// Type definitions for gulp-help-doc
|
||||
// Project: https://github.com/Mikhus/gulp-help-doc
|
||||
// Definitions by: Mikhus <https://github.com/Mikhus>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="../gulp/gulp.d.ts" />
|
||||
|
||||
declare module "gulp-help-doc" {
|
||||
|
||||
import gulp = require('gulp');
|
||||
|
||||
namespace usage {
|
||||
|
||||
interface UsageOptions {
|
||||
/**
|
||||
* Defines max line width for the printed output lines
|
||||
* (by default is 80 characters long)
|
||||
*/
|
||||
lineWidth?: number,
|
||||
|
||||
/**
|
||||
* Defines max width of the column width tasks or args names
|
||||
* (by default is 20 characters long)
|
||||
*/
|
||||
keysColumnWidth?: number,
|
||||
|
||||
/**
|
||||
* Defines number of empty characters for left-padding of the output
|
||||
*/
|
||||
padding?: number,
|
||||
|
||||
/**
|
||||
* Printing engine (by default is console). Accepted any device
|
||||
* which has log() function defined to do output.
|
||||
*/
|
||||
logger?: { log: Function },
|
||||
|
||||
/**
|
||||
* Path to a gulpfile (default is gulpfile.js)
|
||||
* Normally, there is no need to change this option. It may be used
|
||||
* for some special cases, like mocking gulpfile for testing.
|
||||
*/
|
||||
gulpfile?: string
|
||||
}
|
||||
|
||||
interface Usage {
|
||||
(gulp: gulp.Gulp, options?: UsageOptions): Promise<any>
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var usage: usage.Usage;
|
||||
|
||||
export = usage;
|
||||
}
|
||||
Reference in New Issue
Block a user