forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Adds flow type defs for uglify, and fixes the two issues found Reviewed By: jeanlauliac Differential Revision: D5029190 fbshipit-source-id: eb5947b051844938da241e002b727edc1384e3a6
- Loading branch information
1 parent
f088bca
commit f1a220b
Showing
5 changed files
with
87 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/** | ||
* 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. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
type _SourceMap = { | ||
file?: string, | ||
mappings: string, | ||
names: Array<string>, | ||
sourceRoot?: string, | ||
sources: Array<string>, | ||
sourcesContent?: Array<?string>, | ||
version: number, | ||
}; | ||
|
||
type _Result<MapT> = { | ||
code: string, | ||
map: MapT, | ||
}; | ||
|
||
type _Options = { | ||
compress?: false | {||}, | ||
fromString?: boolean, | ||
inSourceMap?: string | ?_SourceMap, | ||
mangle?: boolean | {| | ||
except?: Array<string>, | ||
toplevel?: boolean, | ||
eval?: boolean, | ||
keep_fnames?: boolean, | ||
|}, | ||
mangleProperties?: boolean | {| | ||
regex?: RegExp, | ||
ignore_quoted?: boolean, | ||
debug?: false | string, | ||
|}, | ||
outFileName?: string, | ||
output?: {| | ||
ascii_only?: boolean, | ||
screw_ie8?: boolean, | ||
|}, | ||
parse?: {| | ||
strict?: boolean, | ||
bare_returns?: boolean, | ||
filename?: string, | ||
|}, | ||
sourceMapUrl?: string, | ||
sourceRoot?: string, | ||
warnings?: boolean, | ||
}; | ||
|
||
type _Input = | ||
| string // code or file name | ||
| Array<string> // array of file names | ||
| {[filename: string]: string}; // file names and corresponding code | ||
|
||
declare module 'uglify-js' { | ||
declare function minify( | ||
fileOrFilesOrCode: _Input, | ||
options?: _Options & {outSourceMap?: ?false | ''}, | ||
): _Result<void>; | ||
declare function minify( | ||
fileOrFilesOrCode: _Input, | ||
options?: _Options & {outSourceMap: true | string}, | ||
): _Result<string>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters