diff --git a/gulp-watch/gulp-watch-tests.ts b/gulp-watch/gulp-watch-tests.ts new file mode 100644 index 000000000..5e158a045 --- /dev/null +++ b/gulp-watch/gulp-watch-tests.ts @@ -0,0 +1,19 @@ +/// +/// + +import gulp = require('gulp'); +import watch = require('gulp-watch'); + +gulp.task('stream', () => + gulp.src('css/**/*.css') + .pipe(watch('css/**/*.css')) + .pipe(gulp.dest('build')) +); + +gulp.task('callback', (cb) => + watch('css/**/*.css', () => + gulp.src('css/**/*.css') + .pipe(watch('css/**/*.css')) + .on('end', cb) + ) +); diff --git a/gulp-watch/gulp-watch.d.ts b/gulp-watch/gulp-watch.d.ts new file mode 100644 index 000000000..b3a16bbdd --- /dev/null +++ b/gulp-watch/gulp-watch.d.ts @@ -0,0 +1,27 @@ +// Type definitions for gulp-watch v4.1.1 +// Project: https://github.com/floatdrop/gulp-watch +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module 'gulp-watch' { + interface IOptions { + ignoreInitial?: boolean; + events?: Array; + base?: string; + name?: string; + verbose?: boolean; + readDelay?: number; + } + + interface IWatchStream extends NodeJS.ReadWriteStream { + add(path: string | Array): NodeJS.ReadWriteStream; + unwatch(path: string | Array): NodeJS.ReadWriteStream; + close(): NodeJS.ReadWriteStream; + } + + function watch(glob: string, options?: IOptions, callback?: Function): IWatchStream; + + export = watch; +}