Merge pull request #28301 from romain-faust/koa-html-minifier

[@types/koa-html-minifier] Fix imports; add type alias to html-minifier Options
This commit is contained in:
Daniel Rosenwasser
2018-08-24 17:07:00 -07:00
committed by GitHub
2 changed files with 11 additions and 11 deletions

View File

@@ -4,11 +4,13 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import { Options as HtmlMinifierOptions } from 'html-minifier';
import { Middleware } from 'koa';
import { Options } from 'html-minifier';
declare function minifier(options?: Options): Middleware;
declare function koaHtmlMinifier(options?: koaHtmlMinifier.Options): Middleware;
declare namespace minifier {}
declare namespace koaHtmlMinifier {
type Options = HtmlMinifierOptions;
}
export = minifier;
export = koaHtmlMinifier;

View File

@@ -1,8 +1,6 @@
import * as Koa from 'koa';
import * as KoaHtmlMinifier from 'koa-html-minifier';
import Koa = require('koa');
import koaHtmlMinifier = require('koa-html-minifier');
const app = new Koa()
.use(KoaHtmlMinifier())
.use(KoaHtmlMinifier({
collapseWhitespace: true
}));
const app = new Koa();
app.use(koaHtmlMinifier());
app.use(koaHtmlMinifier({ collapseWhitespace: true }));