diff --git a/gulp-newer/gulp-newer-tests.ts b/gulp-newer/gulp-newer-tests.ts new file mode 100644 index 000000000..43f0c55cc --- /dev/null +++ b/gulp-newer/gulp-newer-tests.ts @@ -0,0 +1,17 @@ +/// +/// +/// + +import * as gulp from "gulp"; +import newer = require("gulp-newer"); +import minifyHtml = require("gulp-minify-html"); + +gulp.src("*.html") + .pipe(newer("build")) + .pipe(minifyHtml()) + .pipe(gulp.dest("build")); + +gulp.src("*.html") + .pipe(newer({ dest: "build" })) + .pipe(minifyHtml()) + .pipe(gulp.dest("build")); diff --git a/gulp-newer/gulp-newer.d.ts b/gulp-newer/gulp-newer.d.ts new file mode 100644 index 000000000..ca4fdc9a1 --- /dev/null +++ b/gulp-newer/gulp-newer.d.ts @@ -0,0 +1,46 @@ +// Type definitions for gulp-newer +// Project: https://github.com/tschaub/gulp-newer +// Definitions by: Thomas Corbière +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "gulp-newer" +{ + interface IOptions + { + /** + * Path to destination directory or file. + */ + dest: string; + + /** + * Source files will be matched to destination files with the provided extension. + */ + ext?: string; + + /** + * Map relative source paths to relative destination paths. + */ + map?: (relativePath: string) => string; + } + + interface IGulpNewer + { + /** + * Create a transform stream that passes through files whose modification time + * is more recent than the corresponding destination file's modification time. + * @param dest Path to destination directory or file. + */ + (dest: string): NodeJS.ReadWriteStream; + + /** + * Create a transform stream that passes through files whose modification time + * is more recent than the corresponding destination file's modification time. + */ + (options: IOptions): NodeJS.ReadWriteStream; + } + + const newer: IGulpNewer; + export = newer; +}