/** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @format */ 'use strict'; type _Input = | string // code or file name | Array // array of file names | {[filename: string]: string}; // file names and corresponding code type _Options = { // https://github.com/mishoo/UglifyJS2/tree/harmony#compress-options compress?: false | Object, ie8?: boolean, mangle?: | boolean | { eval?: boolean, keep_fnames?: boolean, properties?: | boolean | { builtins?: boolean, debug?: boolean, keep_quoted?: boolean, regex?: RegExp, reserved?: Array, }, reserved?: Array, safari10?: boolean, toplevel?: boolean, }, output?: { ascii_only?: boolean, beautify?: boolean, bracketize?: boolean, comments?: boolean | 'all' | 'some' | RegExp | Function, ecma?: 5 | 6, indent_level?: number, indent_start?: number, inline_script?: number, keep_quoted_props?: boolean, max_line_len?: false | number, preamble?: string, preserve_line?: boolean, quote_keys?: boolean, quote_style?: 0 | 1 | 2 | 3, semicolons?: boolean, shebang?: boolean, width?: number, wrap_iife?: boolean, }, parse?: { bare_returns: boolean, html5_comments: boolean, shebang: boolean, }, sourceMap?: false, toplevel?: boolean, warnings?: boolean | 'verbose', }; type _SourceMap = { file?: string, mappings: string, names: Array, sourceRoot?: string, sources: Array, sourcesContent?: Array, version: number, }; type _SourceMapOptions = | true | { filename?: string, content?: ?string | _SourceMap, includeSources?: boolean, root?: string, url?: string, }; type _Error = {|error: Error|}; type _Result = {|code: string, warnings?: Array|}; declare module 'uglify-es' { declare function minify(code: _Input, options?: _Options): _Error | _Result; declare function minify( code: _Input, options: {..._Options, sourceMap: _SourceMapOptions}, ): _Error | {|..._Result, map: string|}; }