mirror of
https://github.com/danbulant/oxc
synced 2026-05-22 21:58:36 +00:00
70 lines
1.4 KiB
TypeScript
70 lines
1.4 KiB
TypeScript
/* auto-generated by NAPI-RS */
|
|
/* eslint-disable */
|
|
export interface CodegenOptions {
|
|
/**
|
|
* Remove whitespace.
|
|
*
|
|
* @default true
|
|
*/
|
|
whitespace?: boolean
|
|
}
|
|
|
|
export interface CompressOptions {
|
|
/**
|
|
* Enables optional catch or nullish-coalescing operator if targeted higher.
|
|
*
|
|
* @default 'es2015'
|
|
*/
|
|
target?: string
|
|
/**
|
|
* Pass true to discard calls to `console.*`.
|
|
*
|
|
* @default false
|
|
*/
|
|
dropConsole?: boolean
|
|
/**
|
|
* Remove `debugger;` statements.
|
|
*
|
|
* @default true
|
|
*/
|
|
dropDebugger?: boolean
|
|
}
|
|
|
|
export interface MangleOptions {
|
|
/** Pass true to mangle names declared in the top level scope. */
|
|
toplevel?: boolean
|
|
/** Debug mangled names. */
|
|
debug?: boolean
|
|
}
|
|
|
|
/**
|
|
* Minify synchronously.
|
|
*
|
|
* # Errors
|
|
*
|
|
* * Fails to parse the options.
|
|
*/
|
|
export declare function minify(filename: string, sourceText: string, options?: MinifyOptions | undefined | null): MinifyResult
|
|
|
|
export interface MinifyOptions {
|
|
compress?: boolean | CompressOptions
|
|
mangle?: boolean | MangleOptions
|
|
codegen?: boolean | CodegenOptions
|
|
sourcemap?: boolean
|
|
}
|
|
|
|
export interface MinifyResult {
|
|
code: string
|
|
map?: SourceMap
|
|
}
|
|
|
|
export interface SourceMap {
|
|
file?: string
|
|
mappings: string
|
|
names: Array<string>
|
|
sourceRoot?: string
|
|
sources: Array<string>
|
|
sourcesContent?: Array<string>
|
|
version: number
|
|
x_google_ignoreList?: Array<number>
|
|
}
|