Types for gulp-tap (#31917)

* Types for "gulp-tap" added

* Types for "gulp-tap" added

* Requested changes applied

* Requested changes applied
This commit is contained in:
TokugawaT_YD 2019-03-26 01:31:33 +09:00 committed by timolinn
parent 79108a1ef2
commit 239748d8be
4 changed files with 59 additions and 0 deletions

View File

@ -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/'));
});

22
types/gulp-tap/index.d.ts vendored Normal file
View File

@ -0,0 +1,22 @@
// Type definitions for gulp-tap 1.0
// Project: https://github.com/geejs/gulp-tap
// Definitions by: Takesi Tokugawa <https://github.com/TokugawaTakesi>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
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;

View File

@ -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"
]
}

View File

@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}