This commit is contained in:
Tanguy Krotoff
2015-07-06 14:39:25 +02:00
parent 5e981dddcc
commit 2a0e473e34
2 changed files with 46 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
/// <reference path="gulp-watch.d.ts" />
/// <reference path="../gulp/gulp.d.ts" />
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)
)
);
+27
View File
@@ -0,0 +1,27 @@
// Type definitions for gulp-watch v4.1.1
// Project: https://github.com/floatdrop/gulp-watch
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module 'gulp-watch' {
interface IOptions {
ignoreInitial?: boolean;
events?: Array<string>;
base?: string;
name?: string;
verbose?: boolean;
readDelay?: number;
}
interface IWatchStream extends NodeJS.ReadWriteStream {
add(path: string | Array<string>): NodeJS.ReadWriteStream;
unwatch(path: string | Array<string>): NodeJS.ReadWriteStream;
close(): NodeJS.ReadWriteStream;
}
function watch(glob: string, options?: IOptions, callback?: Function): IWatchStream;
export = watch;
}