From b09582f9730995cf1c7148f0df0d174443bef90d Mon Sep 17 00:00:00 2001 From: L&H Date: Wed, 6 Jun 2018 18:58:35 +0800 Subject: [PATCH 1/2] Add gulp-strip-comments type --- .../gulp-strip-comments-tests.ts | 12 +++++++++ types/gulp-strip-comments/index.d.ts | 26 +++++++++++++++++++ types/gulp-strip-comments/tsconfig.json | 23 ++++++++++++++++ types/gulp-strip-comments/tslint.json | 1 + 4 files changed, 62 insertions(+) create mode 100644 types/gulp-strip-comments/gulp-strip-comments-tests.ts create mode 100644 types/gulp-strip-comments/index.d.ts create mode 100644 types/gulp-strip-comments/tsconfig.json create mode 100644 types/gulp-strip-comments/tslint.json diff --git a/types/gulp-strip-comments/gulp-strip-comments-tests.ts b/types/gulp-strip-comments/gulp-strip-comments-tests.ts new file mode 100644 index 0000000000..7f1c88af77 --- /dev/null +++ b/types/gulp-strip-comments/gulp-strip-comments-tests.ts @@ -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')); +}); diff --git a/types/gulp-strip-comments/index.d.ts b/types/gulp-strip-comments/index.d.ts new file mode 100644 index 0000000000..a516bd7c87 --- /dev/null +++ b/types/gulp-strip-comments/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for gulp-strip-comments 2.5 +// Project: https://github.com/RnbWd/gulp-strip-comments +// Definitions by: Aqours +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +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; diff --git a/types/gulp-strip-comments/tsconfig.json b/types/gulp-strip-comments/tsconfig.json new file mode 100644 index 0000000000..08db2f47d9 --- /dev/null +++ b/types/gulp-strip-comments/tsconfig.json @@ -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" + ] +} diff --git a/types/gulp-strip-comments/tslint.json b/types/gulp-strip-comments/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/gulp-strip-comments/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 02e40a2806e478196a42737605d0505fbb2d1ea8 Mon Sep 17 00:00:00 2001 From: L&H Date: Thu, 7 Jun 2018 08:16:42 +0800 Subject: [PATCH 2/2] Update gulp-strip-comments-tests.ts --- types/gulp-strip-comments/gulp-strip-comments-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/gulp-strip-comments/gulp-strip-comments-tests.ts b/types/gulp-strip-comments/gulp-strip-comments-tests.ts index 7f1c88af77..737f2c16a2 100644 --- a/types/gulp-strip-comments/gulp-strip-comments-tests.ts +++ b/types/gulp-strip-comments/gulp-strip-comments-tests.ts @@ -1,5 +1,5 @@ import * as gulp from 'gulp'; -import * as stripComments from 'gulp-strip-comments'; +import stripComments = require('gulp-strip-comments'); gulp.task('default', () => { return gulp.src('src/app.js')