1
0
mirror of https://github.com/S2-/minifyfromhtml.git synced 2025-08-03 04:10:04 +02:00

update minify

This commit is contained in:
s2
2020-02-07 22:55:28 +01:00
parent 439b2733a6
commit 9dc253a6be
77 changed files with 6154 additions and 24560 deletions

View File

@@ -1,6 +1,11 @@
/// <reference lib="es2015" />
import { RawSourceMap } from 'source-map';
export type ECMA = 5 | 6 | 7 | 8 | 9;
/** @deprecated since this versions basically do not exist */
type ECMA_UNOFFICIAL = 6 | 7 | 8 | 9;
export type ECMA = 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | ECMA_UNOFFICIAL;
export interface ParseOptions {
bare_returns?: boolean;
@@ -12,21 +17,25 @@ export interface ParseOptions {
export interface CompressOptions {
arguments?: boolean;
arrows?: boolean;
booleans_as_integers?: boolean;
booleans?: boolean;
collapse_vars?: boolean;
comparisons?: boolean;
computed_props?: boolean;
conditionals?: boolean;
dead_code?: boolean;
defaults?: boolean;
directives?: boolean;
drop_console?: boolean;
drop_debugger?: boolean;
ecma?: ECMA;
evaluate?: boolean;
expression?: boolean;
global_defs?: object;
hoist_funs?: boolean;
hoist_props?: boolean;
hoist_vars?: boolean;
ie8?: boolean;
if_return?: boolean;
inline?: boolean | InlineFunctions;
join_vars?: boolean;
@@ -35,6 +44,7 @@ export interface CompressOptions {
keep_fnames?: boolean | RegExp;
keep_infinity?: boolean;
loops?: boolean;
module?: boolean;
negate_iife?: boolean;
passes?: number;
properties?: boolean;
@@ -48,8 +58,8 @@ export interface CompressOptions {
toplevel?: boolean;
top_retain?: null | string | string[] | RegExp;
typeofs?: boolean;
unsafe?: boolean;
unsafe_arrows?: boolean;
unsafe?: boolean;
unsafe_comps?: boolean;
unsafe_Function?: boolean;
unsafe_math?: boolean;
@@ -82,8 +92,8 @@ export interface MangleOptions {
export interface ManglePropertiesOptions {
builtins?: boolean;
debug?: boolean;
keep_quoted?: boolean;
regex?: RegExp;
keep_quoted?: boolean | 'strict';
regex?: RegExp | string;
reserved?: string[];
}
@@ -91,15 +101,16 @@ export interface OutputOptions {
ascii_only?: boolean;
beautify?: boolean;
braces?: boolean;
comments?: boolean | 'all' | 'some' | RegExp;
comments?: boolean | 'all' | 'some' | RegExp | Function;
ecma?: ECMA;
indent_level?: number;
indent_start?: boolean;
inline_script?: boolean;
ie8?: boolean;
indent_level?: number;
indent_start?: number;
inline_script?: boolean;
keep_quoted_props?: boolean;
max_line_len?: boolean;
max_line_len?: number | false;
preamble?: string;
preserve_annotations?: boolean;
quote_keys?: boolean;
quote_style?: OutputQuoteStyle;
safari10?: boolean;
@@ -140,7 +151,7 @@ export interface MinifyOutput {
ast?: AST_Node;
code?: string;
error?: Error;
map?: string;
map?: RawSourceMap | string;
warnings?: string[];
}
@@ -179,21 +190,6 @@ export class TreeTransformer extends TreeWalker {
export function push_uniq<T>(array: T[], el: T): void;
type DictEachCallback = (val: any, key: string) => any;
export class Dictionary {
static fromObject(obj: object): Dictionary;
add(key: string, val: any): this;
clone(): Dictionary;
del(key: string): this;
each(fn: DictEachCallback): void;
get(key: string): any;
has(key: string): boolean;
map(fn: DictEachCallback): any[];
set(key: string, val: any): this;
size(): number;
}
export function minify(files: string | string[] | { [file: string]: string } | AST_Node, options?: MinifyOptions): MinifyOutput;
export class AST_Node {
@@ -292,17 +288,14 @@ declare class AST_Accessor extends AST_Lambda {
declare class AST_Function extends AST_Lambda {
constructor(props?: object);
inlined: boolean;
}
declare class AST_Arrow extends AST_Lambda {
constructor(props?: object);
inlined: boolean;
}
declare class AST_Defun extends AST_Lambda {
constructor(props?: object);
inlined: boolean;
}
declare class AST_Class extends AST_Scope {
@@ -310,7 +303,6 @@ declare class AST_Class extends AST_Scope {
name: AST_SymbolClass | AST_SymbolDefClass | null;
extends: AST_Node | null;
properties: AST_ObjectProperty[];
inlined: boolean;
}
declare class AST_DefClass extends AST_Class {
@@ -739,7 +731,10 @@ declare class AST_Number extends AST_Constant {
declare class AST_RegExp extends AST_Constant {
constructor(props?: object);
value: RegExp;
value: {
source: string,
flags: string
};
}
declare class AST_Atom extends AST_Constant {