mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-18 12:08:59 +08:00
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:
10
types/koa-html-minifier/index.d.ts
vendored
10
types/koa-html-minifier/index.d.ts
vendored
@@ -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;
|
||||
|
||||
@@ -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 }));
|
||||
|
||||
Reference in New Issue
Block a user