From 239748d8be7f308682ff3bfcbf41b84daefe8efe Mon Sep 17 00:00:00 2001 From: TokugawaT_YD <41653501+TokugawaTakesi@users.noreply.github.com> Date: Tue, 26 Mar 2019 01:31:33 +0900 Subject: [PATCH] Types for gulp-tap (#31917) * Types for "gulp-tap" added * Types for "gulp-tap" added * Requested changes applied * Requested changes applied --- types/gulp-tap/gulp-tap-tests.ts | 11 +++++++++++ types/gulp-tap/index.d.ts | 22 ++++++++++++++++++++++ types/gulp-tap/tsconfig.json | 23 +++++++++++++++++++++++ types/gulp-tap/tslint.json | 3 +++ 4 files changed, 59 insertions(+) create mode 100644 types/gulp-tap/gulp-tap-tests.ts create mode 100644 types/gulp-tap/index.d.ts create mode 100644 types/gulp-tap/tsconfig.json create mode 100644 types/gulp-tap/tslint.json diff --git a/types/gulp-tap/gulp-tap-tests.ts b/types/gulp-tap/gulp-tap-tests.ts new file mode 100644 index 0000000000..7d89c50ba0 --- /dev/null +++ b/types/gulp-tap/gulp-tap-tests.ts @@ -0,0 +1,11 @@ +import gulpTap = require('gulp-tap'); +import gulp = require('gulp'); +import Vinyl = require('vinyl'); + +gulp.task('testTask', () => { + return gulp.src(['src/*.html']) + .pipe(gulpTap((sourceFile: Vinyl) => { + console.log(sourceFile.path); + })) + .pipe(gulp.dest('dist/')); +}); diff --git a/types/gulp-tap/index.d.ts b/types/gulp-tap/index.d.ts new file mode 100644 index 0000000000..30af7663f8 --- /dev/null +++ b/types/gulp-tap/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for gulp-tap 1.0 +// Project: https://github.com/geejs/gulp-tap +// Definitions by: Takesi Tokugawa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import Vinyl = require('vinyl'); + +declare namespace tap { + interface Tap { + (tapFunction: TapFunction, t?: any): NodeJS.ReadWriteStream; + } + + interface TapFunction { + (file: Vinyl): any; + } +} + +declare function tap(tapFunction: (file: Vinyl, t?: {}) => void): NodeJS.ReadWriteStream; + +export = tap; diff --git a/types/gulp-tap/tsconfig.json b/types/gulp-tap/tsconfig.json new file mode 100644 index 0000000000..d48ac90475 --- /dev/null +++ b/types/gulp-tap/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-tap-tests.ts" + ] +} diff --git a/types/gulp-tap/tslint.json b/types/gulp-tap/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/gulp-tap/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}