diff --git a/types/gulp-diff/gulp-diff-tests.ts b/types/gulp-diff/gulp-diff-tests.ts new file mode 100644 index 00000000000000..23748d11e805ee --- /dev/null +++ b/types/gulp-diff/gulp-diff-tests.ts @@ -0,0 +1,8 @@ +import * as gulp from 'gulp'; +import * as diff from 'gulp-diff'; + +gulp.task('task', () => { + return gulp.src('src') + .pipe(diff('dest')) + .pipe(diff.reporter({fail: true})); +}); diff --git a/types/gulp-diff/index.d.ts b/types/gulp-diff/index.d.ts new file mode 100644 index 00000000000000..482ea983911e12 --- /dev/null +++ b/types/gulp-diff/index.d.ts @@ -0,0 +1,32 @@ +// Type definitions for gulp-diff 1.0 +// Project: https://github.com/creativelive/gulp-diff +// Definitions by: Ika +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import stream = require('stream'); + +/** + * Gulp task to diff files in the stream against a destination. + * @param dest target directory to diff against, defaults to diff against original source file + */ +declare function gulp_diff(dest?: string): stream.Transform; + +declare namespace gulp_diff { + const diff: typeof gulp_diff; + + function reporter(opts?: ReporterOptions): stream.Transform; + interface ReporterOptions { + /** + * do not show diff information, defaults to `false` + */ + quiet?: boolean; + /** + * emit an error on finding diffs, defaults to `false` + */ + fail?: boolean; + } +} + +export = gulp_diff; diff --git a/types/gulp-diff/tsconfig.json b/types/gulp-diff/tsconfig.json new file mode 100644 index 00000000000000..fd166337b24918 --- /dev/null +++ b/types/gulp-diff/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "gulp-diff-tests.ts" + ] +} diff --git a/types/gulp-diff/tslint.json b/types/gulp-diff/tslint.json new file mode 100644 index 00000000000000..d88586e5bd00db --- /dev/null +++ b/types/gulp-diff/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}