Add gulp-strip-comments type

This commit is contained in:
L&H 2018-06-06 18:58:35 +08:00
parent b3cad84aa3
commit b09582f973
4 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,12 @@
import * as gulp from 'gulp';
import * as stripComments from 'gulp-strip-comments';
gulp.task('default', () => {
return gulp.src('src/app.js')
.pipe(stripComments({
safe: true,
}))
.pipe(stripComments.html())
.pipe(stripComments.text())
.pipe(gulp.dest('dist'));
});

26
types/gulp-strip-comments/index.d.ts vendored Normal file
View File

@ -0,0 +1,26 @@
// Type definitions for gulp-strip-comments 2.5
// Project: https://github.com/RnbWd/gulp-strip-comments
// Definitions by: Aqours <https://github.com/Aqours>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
declare namespace stripComments {
interface StripOptions {
safe?: boolean;
ignore?: RegExp | RegExp[];
space?: boolean;
trim?: boolean;
}
interface Strip {
(options?: StripOptions): NodeJS.ReadWriteStream;
text(options?: StripOptions): NodeJS.ReadWriteStream;
html(options?: StripOptions): NodeJS.ReadWriteStream;
getEOL(): string;
}
}
declare const strip: stripComments.Strip;
export = strip;

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"gulp-strip-comments-tests.ts"
]
}

View File

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