[gulp-newer] Add type definitions

This commit is contained in:
Thomas Corbière
2015-08-20 12:28:13 +02:00
parent 38fb591c6e
commit a0357a3bb1
2 changed files with 63 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
/// <reference path="../gulp/gulp.d.ts" />
/// <reference path="../gulp-minify-html/gulp-minify-html.d.ts" />
/// <reference path="./gulp-newer.d.ts" />
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"));
+46
View File
@@ -0,0 +1,46 @@
// Type definitions for gulp-newer
// Project: https://github.com/tschaub/gulp-newer
// Definitions by: Thomas Corbière <https://github.com/tomc974>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts"/>
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;
}