@@ -37,6 +37,9 @@ SUCH DAMAGE.
37
37
export namespace Terser {
38
38
export type ECMA = 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020
39
39
40
+ export type ConsoleProperty = keyof typeof console
41
+ type DropConsoleOption = boolean | ConsoleProperty [ ]
42
+
40
43
export interface ParseOptions {
41
44
bare_returns ?: boolean
42
45
/** @deprecated legacy option. Currently, all supported EcmaScript is valid to parse. */
@@ -57,7 +60,7 @@ export namespace Terser {
57
60
dead_code ?: boolean
58
61
defaults ?: boolean
59
62
directives ?: boolean
60
- drop_console ?: boolean
63
+ drop_console ?: DropConsoleOption
61
64
drop_debugger ?: boolean
62
65
ecma ?: ECMA
63
66
evaluate ?: boolean
@@ -80,6 +83,7 @@ export namespace Terser {
80
83
passes ?: number
81
84
properties ?: boolean
82
85
pure_funcs ?: string [ ]
86
+ pure_new ?: boolean
83
87
pure_getters ?: boolean | 'strict'
84
88
reduce_funcs ?: boolean
85
89
reduce_vars ?: boolean
@@ -129,7 +133,7 @@ export namespace Terser {
129
133
* Obtains the nth most favored (usually shortest) identifier to rename a variable to.
130
134
* The mangler will increment n and retry until the return value is not in use in scope, and is not a reserved word.
131
135
* This function is expected to be stable; Evaluating get(n) === get(n) should always return true.
132
- * @param n - The ordinal of the identifier.
136
+ * @param n The ordinal of the identifier.
133
137
*/
134
138
get ( n : number ) : string
135
139
}
@@ -141,8 +145,8 @@ export namespace Terser {
141
145
/**
142
146
* Modifies the internal weighting of the input characters by the specified delta.
143
147
* Will be invoked on the entire printed AST, and then deduct mangleable identifiers.
144
- * @param chars - The characters to modify the weighting of.
145
- * @param delta - The numeric weight to add to the characters.
148
+ * @param chars The characters to modify the weighting of.
149
+ * @param delta The numeric weight to add to the characters.
146
150
*/
147
151
consider ( chars : string , delta : number ) : number
148
152
/**
@@ -225,7 +229,7 @@ export namespace Terser {
225
229
module ?: boolean
226
230
nameCache ?: object
227
231
format ?: FormatOptions
228
- /** @deprecated deprecated */
232
+ /** @deprecated */
229
233
output ?: FormatOptions
230
234
parse ?: ParseOptions
231
235
safari10 ?: boolean
@@ -245,6 +249,7 @@ export namespace Terser {
245
249
includeSources ?: boolean
246
250
filename ?: string
247
251
root ?: string
252
+ asObject ?: boolean
248
253
url ?: string | 'inline'
249
254
}
250
255
}
0 commit comments