|
1 | | -import required = require("html-minifier-next") |
2 | | -import imported, { minify, MinifierOptions } from "html-minifier-next" |
3 | | -import * as namespaced from "html-minifier-next" |
| 1 | +import required = require("html-minifier-next"); |
| 2 | +import imported, { MinifierOptions, minify } from "html-minifier-next"; |
| 3 | +import * as namespaced from "html-minifier-next"; |
4 | 4 |
|
5 | 5 | // $ExpectType Promise<string> |
6 | | -imported.minify("<p title=\"blah\" id=\"moo\">foo</p>") |
| 6 | +imported.minify("<p title=\"blah\" id=\"moo\">foo</p>"); |
7 | 7 |
|
8 | 8 | // $ExpectType Promise<string> |
9 | | -required.minify("<p title=\"blah\" id=\"moo\">foo</p>") |
| 9 | +required.minify("<p title=\"blah\" id=\"moo\">foo</p>"); |
10 | 10 |
|
11 | 11 | // $ExpectType Promise<string> |
12 | | -namespaced.minify("<p title=\"blah\" id=\"moo\">foo</p>") |
| 12 | +namespaced.minify("<p title=\"blah\" id=\"moo\">foo</p>"); |
13 | 13 |
|
14 | 14 | const options: MinifierOptions = { |
15 | | - caseSensitive: true, |
16 | | - collapseBooleanAttributes: true, |
17 | | - collapseInlineTagWhitespace: true, |
18 | | - collapseWhitespace: true, |
19 | | - conservativeCollapse: true, |
20 | | - continueOnParseError: true, |
21 | | - customAttrAssign: [/.*/], |
22 | | - customAttrCollapse: /ng-class/, |
23 | | - customAttrSurround: [/btn-class/], |
24 | | - customEventAttributes: [/on-click/], |
25 | | - customFragmentQuantifierLimit: 144, |
26 | | - decodeEntities: true, |
27 | | - html5: false, |
28 | | - ignoreCustomComments: [/^!/, /^\s*#/], |
29 | | - ignoreCustomFragments: [/<%[\s\S]*?%>/, /<\?[\s\S]\*?\?>/], |
30 | | - includeAutoGeneratedTags: false, |
31 | | - keepClosingSlash: false, |
32 | | - maxLineLength: 20, |
33 | | - maxInputLength: 1000, |
34 | | - minifyCSS: true, |
35 | | - minifyJS: true, |
36 | | - minifyURLs: true, |
37 | | - noNewlinesBeforeTagClose: true, |
38 | | - preserveLineBreaks: true, |
39 | | - preventAttributesEscaping: true, |
40 | | - processConditionalComments: true, |
41 | | - processScripts: ["text/v-text"], |
42 | | - quoteCharacter: "\"", |
43 | | - removeAttributeQuotes: true, |
44 | | - removeComments: true, |
45 | | - removeEmptyAttributes: true, |
46 | | - removeEmptyElements: true, |
47 | | - removeOptionalTags: true, |
48 | | - removeRedundantAttributes: true, |
49 | | - removeScriptTypeAttributes: true, |
50 | | - removeStyleLinkTypeAttributes: true, |
51 | | - removeTagWhitespace: true, |
52 | | - sortAttributes: true, |
53 | | - sortClassName: true, |
54 | | - trimCustomFragments: true, |
55 | | - useShortDoctype: true, |
56 | | -} |
| 15 | + caseSensitive: true, |
| 16 | + collapseBooleanAttributes: true, |
| 17 | + collapseInlineTagWhitespace: true, |
| 18 | + collapseWhitespace: true, |
| 19 | + conservativeCollapse: true, |
| 20 | + continueOnParseError: true, |
| 21 | + customAttrAssign: [/.*/], |
| 22 | + customAttrCollapse: /ng-class/, |
| 23 | + customAttrSurround: [/btn-class/], |
| 24 | + customEventAttributes: [/on-click/], |
| 25 | + customFragmentQuantifierLimit: 144, |
| 26 | + decodeEntities: true, |
| 27 | + html5: false, |
| 28 | + ignoreCustomComments: [/^!/, /^\s*#/], |
| 29 | + ignoreCustomFragments: [/<%[\s\S]*?%>/, /<\?[\s\S]\*?\?>/], |
| 30 | + includeAutoGeneratedTags: false, |
| 31 | + keepClosingSlash: false, |
| 32 | + maxLineLength: 20, |
| 33 | + maxInputLength: 1000, |
| 34 | + minifyCSS: true, |
| 35 | + minifyJS: true, |
| 36 | + minifyURLs: true, |
| 37 | + noNewlinesBeforeTagClose: true, |
| 38 | + preserveLineBreaks: true, |
| 39 | + preventAttributesEscaping: true, |
| 40 | + processConditionalComments: true, |
| 41 | + processScripts: ["text/v-text"], |
| 42 | + quoteCharacter: "\"", |
| 43 | + removeAttributeQuotes: true, |
| 44 | + removeComments: true, |
| 45 | + removeEmptyAttributes: true, |
| 46 | + removeEmptyElements: true, |
| 47 | + removeOptionalTags: true, |
| 48 | + removeRedundantAttributes: true, |
| 49 | + removeScriptTypeAttributes: true, |
| 50 | + removeStyleLinkTypeAttributes: true, |
| 51 | + removeTagWhitespace: true, |
| 52 | + sortAttributes: true, |
| 53 | + sortClassName: true, |
| 54 | + trimCustomFragments: true, |
| 55 | + useShortDoctype: true, |
| 56 | +}; |
57 | 57 |
|
58 | | -const optionsImported: imported.MinifierOptions = options |
59 | | -const optionsRequired: required.MinifierOptions = options |
60 | | -const optionsNamespaced: namespaced.MinifierOptions = options |
| 58 | +const optionsImported: imported.MinifierOptions = options; |
| 59 | +const optionsRequired: required.MinifierOptions = options; |
| 60 | +const optionsNamespaced: namespaced.MinifierOptions = options; |
61 | 61 |
|
62 | 62 | // $ExpectType Promise<string> |
63 | | -minify("<p title=\"blah\" id=\"moo\">foo</p>", options) |
| 63 | +minify("<p title=\"blah\" id=\"moo\">foo</p>", options); |
64 | 64 |
|
65 | 65 | // $ExpectType Promise<string> |
66 | | -namespaced.default.minify("<p title=\"blah\" id=\"moo\">foo</p>", options) |
| 66 | +namespaced.default.minify("<p title=\"blah\" id=\"moo\">foo</p>", options); |
67 | 67 |
|
68 | 68 | // $ExpectType Promise<string> |
69 | | -required.default.minify("<p title=\"blah\" id=\"moo\">foo</p>", options) |
| 69 | +required.default.minify("<p title=\"blah\" id=\"moo\">foo</p>", options); |
0 commit comments