保誠-保戶業務員媒合平台
HelenHuang
2022-06-09 9bdb95c9e34cef640534e5e5a1e2225a80442000
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
// Type definitions for html-minifier-terser 5.1
// Project: https://github.com/terser/html-minifier-terser#readme
// Definitions by: Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
 
/**
 * HTMLMinifier is a highly configurable, well-tested, JavaScript-based HTML minifier.
 */
export function minify(value: string, options?: Options): string;
 
/**
 * Most of the options are disabled by default
 */
export interface Options {
    /**
     * Treat attributes in case sensitive manner (useful for custom HTML tags)
     * @default false
     */
    caseSensitive?: boolean | undefined;
    /**
     * Omit attribute values from boolean attributes
     * @default false
     */
    collapseBooleanAttributes?: boolean | undefined;
    /**
     * Don't leave any spaces between display:inline;
     * elements when collapsing. Must be used in conjunction with collapseWhitespace=true
     * @default false
     */
    collapseInlineTagWhitespace?: boolean | undefined;
    /**
     * Collapse white space that contributes to text nodes in a document tree
     * @default false
     */
    collapseWhitespace?: boolean | undefined;
    /**
     * Always collapse to 1 space (never remove it entirely). Must be used in conjunction with `collapseWhitespace=true`
     * @default false
     */
    conservativeCollapse?: boolean | undefined;
    /**
     * Handle parse errors
     * @default false
     */
    continueOnParseError?: boolean | undefined;
    /**
     * Arrays of regex'es that allow to support custom attribute assign expressions (e.g. `'<div flex?="{{mode != cover}}"></div>'`)
     * @default []
     */
    customAttrAssign?: RegExp[] | undefined;
    /**
     * Regex that specifies custom attribute to strip newlines from (e.g. `/ng-class/`
     */
    customAttrCollapse?: RegExp | undefined;
    /**
     * Arrays of regex'es that allow to support custom attribute surround expressions (e.g. `<input {{#if value}}checked="checked"{{/if}}>`)
     * @default []
     */
    customAttrSurround?: RegExp[] | undefined;
    /**
     * Arrays of regex'es that allow to support custom event attributes for `minifyJS` (e.g. `ng-click`)
     * @default [/^on[a-z]{3,}$/]
     */
    customEventAttributes?: RegExp[] | undefined;
    /**
     * Use direct Unicode characters whenever possible
     * @default false
     */
    decodeEntities?: boolean | undefined;
    /**
     * Parse input according to HTML5 specifications
     * @default true
     */
    html5?: boolean | undefined;
    /**
     * Array of regex'es that allow to ignore certain comments, when matched
     * @default [ /^!/, /^\s*#/ ]
     */
    ignoreCustomComments?: RegExp[] | undefined;
    /**
     * Array of regex'es that allow to ignore certain fragments, when matched (e.g. `<?php ... ?>`, `{{ ... }}`, etc.)
     * @default [/<%[\s\S]*?%>/, /<\?[\s\S]\*?\?>/]
     */
    ignoreCustomFragments?: RegExp[] | undefined;
    /**
     * Insert tags generated by HTML parser
     * @default true
     */
    includeAutoGeneratedTags?: boolean | undefined;
    /**
     * Keep the trailing slash on singleton elements
     * @default false
     */
    keepClosingSlash?: boolean | undefined;
    /**
     * Specify a maximum line length. Compressed output will be split by newlines at valid HTML split-points
     */
    maxLineLength?: number | undefined;
    /**
     * Minify CSS in style elements and style attributes
     * @default false
     */
    minifyCSS?: boolean | object | ((text: string, type?: string) => string) | undefined;
    /**
     * Minify JavaScript in script elements and event attributes
     * @default false
     */
    minifyJS?: boolean | object | ((text: string, inline?: boolean) => string) | undefined;
    /**
     * Minify URLs in various attributes
     * @default false
     */
    minifyURLs?: boolean | string | object | ((text: string) => string) | undefined;
    /**
     * Always collapse to 1 line break (never remove it entirely) when whitespace between tags include a line break.
     * Must be used in conjunction with `collapseWhitespace=true`
     * @default false
     */
    preserveLineBreaks?: boolean | undefined;
    /**
     * Prevents the escaping of the values of attributes
     * @default false
     */
    preventAttributesEscaping?: boolean | undefined;
    /**
     * Process contents of conditional comments through minifier
     * @default false
     */
    processConditionalComments?: boolean | undefined;
    /**
     * Array of strings corresponding to types of script elements to process through minifier
     * (e.g. `text/ng-template`, `text/x-handlebars-template`, etc.)
     * @default []
     */
    processScripts?: string[] | undefined;
    /**
     * Type of quote to use for attribute values (' or ")
     */
    quoteCharacter?: string | undefined;
    /**
     * Remove quotes around attributes when possible
     * @default false
     */
    removeAttributeQuotes?: boolean | undefined;
    /**
     * Strip HTML comments
     * @default false
     */
    removeComments?: boolean | undefined;
    /**
     * Remove all attributes with whitespace-only values
     * @default false
     */
    removeEmptyAttributes?: boolean | ((attrName: string, tag: string) => boolean) | undefined;
    /**
     * Remove all elements with empty contents
     * @default false
     */
    removeEmptyElements?: boolean | undefined;
    /**
     * Remove optional tags
     * @default false
     */
    removeOptionalTags?: boolean | undefined;
    /**
     * Remove attributes when value matches default
     * @default false
     */
    removeRedundantAttributes?: boolean | undefined;
    /**
     * Remove `type="text/javascript"` from `script` tags. Other `type` attribute values are left intact
     * @default false
     */
    removeScriptTypeAttributes?: boolean | undefined;
    /**
     * Remove `type="text/css"` from `style` and `link` tags. Other `type` attribute values are left intact
     * @default false
     */
    removeStyleLinkTypeAttributes?: boolean | undefined;
    /**
     * Remove space between attributes whenever possible. **Note that this will result in invalid HTML!**
     * @default false
     */
    removeTagWhitespace?: boolean | undefined;
    /**
     * Sort attributes by frequency
     * @default false
     */
    sortAttributes?: boolean | undefined;
    /**
     * Sort style classes by frequency
     * @default false
     */
    sortClassName?: boolean | undefined;
    /**
     * Trim white space around `ignoreCustomFragments`
     * @default false
     */
    trimCustomFragments?: boolean | undefined;
    /**
     * Replaces the `doctype` with the short (HTML5) doctype
     * @default false
     */
    useShortDoctype?: boolean | undefined;
}