From c9e7cb88b09dcfa9f6de45bdca298186c6970cf9 Mon Sep 17 00:00:00 2001 From: TokugawaT_YD <41653501+TokugawaTakesi@users.noreply.github.com> Date: Sat, 27 Apr 2019 06:19:33 +0900 Subject: [PATCH] New types for Gulp-html-prettify (#35005) * clear to tests * clear to tests --- .../gulp-html-prettify-tests.ts | 11 +++++++++ types/gulp-html-prettify/index.d.ts | 18 ++++++++++++++ types/gulp-html-prettify/tsconfig.json | 24 +++++++++++++++++++ types/gulp-html-prettify/tslint.json | 3 +++ 4 files changed, 56 insertions(+) create mode 100644 types/gulp-html-prettify/gulp-html-prettify-tests.ts create mode 100644 types/gulp-html-prettify/index.d.ts create mode 100644 types/gulp-html-prettify/tsconfig.json create mode 100644 types/gulp-html-prettify/tslint.json diff --git a/types/gulp-html-prettify/gulp-html-prettify-tests.ts b/types/gulp-html-prettify/gulp-html-prettify-tests.ts new file mode 100644 index 0000000000..c28cd13f3a --- /dev/null +++ b/types/gulp-html-prettify/gulp-html-prettify-tests.ts @@ -0,0 +1,11 @@ +import * as gulp from 'gulp'; +import prettifyHtml = require('gulp-html-prettify'); + +gulp.task('prettifyHtml', () => { + gulp.src('source/*.html') + .pipe(prettifyHtml({ + indent_char: ' ', + indent_size: 2 + })) + .pipe(gulp.dest('./dist/')); +}); diff --git a/types/gulp-html-prettify/index.d.ts b/types/gulp-html-prettify/index.d.ts new file mode 100644 index 0000000000..e79c7310c4 --- /dev/null +++ b/types/gulp-html-prettify/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for npm i gulp-html-prettify 0.0 +// Project: https://www.npmjs.com/package/gulp-html-prettify +// Definitions by: Takesi Tokugawa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +interface GulpHtmlPrettifyOptions { + indent_char?: string; + indent_size?: number; +} + +interface GulpHtmlPrettify { + (options?: GulpHtmlPrettifyOptions): NodeJS.ReadWriteStream; +} + +declare var gulpHtmlPrettify: GulpHtmlPrettify; +export = gulpHtmlPrettify; diff --git a/types/gulp-html-prettify/tsconfig.json b/types/gulp-html-prettify/tsconfig.json new file mode 100644 index 0000000000..4b38fdf592 --- /dev/null +++ b/types/gulp-html-prettify/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "esModuleInterop": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "gulp-html-prettify-tests.ts" + ] +} diff --git a/types/gulp-html-prettify/tslint.json b/types/gulp-html-prettify/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/gulp-html-prettify/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}