diff --git a/types/gulp-intercept/gulp-intercept-tests.ts b/types/gulp-intercept/gulp-intercept-tests.ts new file mode 100644 index 0000000000..36952e438f --- /dev/null +++ b/types/gulp-intercept/gulp-intercept-tests.ts @@ -0,0 +1,14 @@ +import gulpIntercept = require('gulp-intercept'); +import gulp = require('gulp'); +import Vinyl = require('vinyl'); + +gulp.task('testTask', () => { + return gulp.src(['src/*.html']) + + .pipe(gulpIntercept((sourceFile: Vinyl) => { + console.log(sourceFile.path); + return sourceFile; + })) + + .pipe(gulp.dest('dist/')); +}); diff --git a/types/gulp-intercept/index.d.ts b/types/gulp-intercept/index.d.ts new file mode 100644 index 0000000000..1a73d899ae --- /dev/null +++ b/types/gulp-intercept/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for gulp-intercept 0.1 +// Project: https://github.com/khilnani/gulp-intercept +// Definitions by: Takesi Tokugawa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import Vinyl = require('vinyl'); + +declare namespace intercept { + interface Intercept { + (interceptFunction: InterceptFunction): NodeJS.ReadWriteStream; + } + + interface InterceptFunction { + (file: Vinyl): Vinyl; + } +} + +declare var intercept: intercept.Intercept; + +export = intercept; diff --git a/types/gulp-intercept/tsconfig.json b/types/gulp-intercept/tsconfig.json new file mode 100644 index 0000000000..07acf8c416 --- /dev/null +++ b/types/gulp-intercept/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "gulp-intercept-tests.ts" + ] +} diff --git a/types/gulp-intercept/tslint.json b/types/gulp-intercept/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/gulp-intercept/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}