From edcc9824cc9b497c093a8d52e4ffba80796129e5 Mon Sep 17 00:00:00 2001 From: progre Date: Mon, 22 Sep 2014 21:02:16 +0900 Subject: [PATCH 1/2] fix: return values --- gulp/gulp.d.ts | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/gulp/gulp.d.ts b/gulp/gulp.d.ts index 908fc4c27..d8b1a6e65 100644 --- a/gulp/gulp.d.ts +++ b/gulp/gulp.d.ts @@ -3,6 +3,8 @@ // Definitions by: Drew Noakes // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + declare module gulp { /** @@ -193,7 +195,7 @@ declare module gulp { * @param name the name of the task. Tasks that you want to run from the command line should not have spaces in them. * @param fn the function that performs the task's operations. Generally this takes the form of gulp.src().pipe(someplugin()). */ - task(name:string, fn:ITaskCallback): Gulp; + task(name:string, fn:ITaskCallback): any; /** * Define a task. @@ -202,7 +204,7 @@ declare module gulp { * @param dep an array of tasks to be executed and completed before your task will run. * @param fn the function that performs the task's operations. Generally this takes the form of gulp.src().pipe(someplugin()). */ - task(name:string, dep:string[], fn?:ITaskCallback): Gulp; + task(name:string, dep:string[], fn?:ITaskCallback): any; /** @@ -210,14 +212,14 @@ declare module gulp { * @param glob a glob string, using node-glob syntax * @param opt an optional option object */ - src(glob:string, opt?:ISrcOptions): Gulp; + src(glob:string, opt?:ISrcOptions): NodeJS.ReadWriteStream; /** * Takes a glob and represents a file structure. Can be piped to plugins. * @param glob an array of glob strings, using node-glob syntax * @param opt an optional option object */ - src(glob:string[], opt?:ISrcOptions): Gulp; + src(glob:string[], opt?:ISrcOptions): NodeJS.ReadWriteStream; /** @@ -227,7 +229,7 @@ declare module gulp { * @param outFolder the path (output folder) to write files to. * @param opt */ - dest(outFolder:string, opt?:IDestOptions): Gulp; + dest(outFolder:string, opt?:IDestOptions): NodeJS.ReadWriteStream; /** * Can be piped to and it will write files. Re-emits all data passed to it so you can pipe to multiple folders. @@ -236,15 +238,7 @@ declare module gulp { * @param outFolder a function that converts a vinyl File instance into an output path * @param opt */ - dest(outFolder:(file:string)=>string, opt?:IDestOptions): Gulp; - - - /** - * Forwards the current Gulp instance, along with its contained files, to the specified receiver. - * - * @param receiver the receiver - */ - pipe(receiver:any): Gulp; + dest(outFolder:(file:string)=>string, opt?:IDestOptions): NodeJS.ReadWriteStream; /** From 81ff395285ed26afeea689958e7f054ab6288569 Mon Sep 17 00:00:00 2001 From: progre Date: Mon, 22 Sep 2014 21:47:57 +0900 Subject: [PATCH 2/2] fix: watch() can abbreviate opt --- gulp/gulp.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gulp/gulp.d.ts b/gulp/gulp.d.ts index d8b1a6e65..d12c3edc1 100644 --- a/gulp/gulp.d.ts +++ b/gulp/gulp.d.ts @@ -241,6 +241,15 @@ declare module gulp { dest(outFolder:(file:string)=>string, opt?:IDestOptions): NodeJS.ReadWriteStream; + /** + * Watch files and do something when a file changes. This always returns an EventEmitter that emits change events. + * + * @param glob a single glob or array of globs that indicate which files to watch for changes. + * @param tasks names of task(s) to run when a file changes, added with gulp.task() + */ + watch(glob:string, tasks:string[]): EventEmitter; + watch(glob:string[], tasks:string[]): EventEmitter; + /** * Watch files and do something when a file changes. This always returns an EventEmitter that emits change events. *