From 51d29560b24fa132dd8feb36cbe836f315aeb4c0 Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Mon, 6 Jul 2015 13:20:44 +0200 Subject: [PATCH] Add definitions for gulp-minify-html (https://github.com/murphydanger/gulp-minify-html) --- gulp-minify-html/gulp-minify-html-tests.ts | 19 ++++++++++++ gulp-minify-html/gulp-minify-html.d.ts | 35 ++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 gulp-minify-html/gulp-minify-html-tests.ts create mode 100644 gulp-minify-html/gulp-minify-html.d.ts diff --git a/gulp-minify-html/gulp-minify-html-tests.ts b/gulp-minify-html/gulp-minify-html-tests.ts new file mode 100644 index 000000000..9714818f5 --- /dev/null +++ b/gulp-minify-html/gulp-minify-html-tests.ts @@ -0,0 +1,19 @@ +/// +/// + +import gulp = require('gulp'); +import minifyHtml = require('gulp-minify-html'); + +minifyHtml(); +minifyHtml({conditionals: true, loose: true}); + +gulp.task('minify-html', () => { + var opts = { + conditionals: true, + spare: true + }; + + return gulp.src('./static/html/*.html') + .pipe(minifyHtml(opts)) + .pipe(gulp.dest('./dist/')); +}); diff --git a/gulp-minify-html/gulp-minify-html.d.ts b/gulp-minify-html/gulp-minify-html.d.ts new file mode 100644 index 000000000..747104084 --- /dev/null +++ b/gulp-minify-html/gulp-minify-html.d.ts @@ -0,0 +1,35 @@ +// Type definitions for gulp-minify-html v1.0.2 +// Project: https://github.com/murphydanger/gulp-minify-html +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module 'gulp-minify-html' { + interface IOptions { + // Do not remove empty attributes + empty?: boolean; + + // Do not strip CDATA from scripts + cdata?: boolean; + + // Do not remove comments + comments?: boolean; + + // Do not remove conditional internet explorer comments + conditionals?: boolean; + + // Do not remove redundant attributes + spare?: boolean; + + // Do not remove arbitrary quotes + quotes?: boolean; + + // Preserve one whitespace + loose?: boolean; + } + + function minifyHtml(options?: IOptions): NodeJS.ReadWriteStream; + + export = minifyHtml; +}