forked from emscripten-core/emscripten
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclosure-externs.js
More file actions
208 lines (185 loc) · 4.58 KB
/
Copy pathclosure-externs.js
File metadata and controls
208 lines (185 loc) · 4.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
/**
* Copyright 2014 The Emscripten Authors. All rights reserved.
* Emscripten is available under two separate licenses, the MIT license and the
* University of Illinois/NCSA Open Source License. Both these licenses can be
* found in the LICENSE file.
*
* This file contains definitions for things that we'd really rather the closure compiler *didn't* minify.
* See http://code.google.com/p/closure-compiler/wiki/FAQ#How_do_I_write_an_externs_file
* See also the discussion here: https://github.com/emscripten-core/emscripten/issues/1979
*
* The closure_compiler() method in tools/shared.py refers to this file when calling closure.
*/
// Don't minify createRequire
var createRequire;
// Closure externs used by library_sockfs.js
/**
* Don't minify Math.*
*/
/**
* @suppress {duplicate}
*/
var Math = {};
Math.abs = function() {};
Math.cos = function() {};
Math.sin = function() {};
Math.tan = function() {};
Math.acos = function() {};
Math.asin = function() {};
Math.atan = function() {};
Math.atan2 = function() {};
Math.exp = function() {};
Math.log = function() {};
Math.sqrt = function() {};
Math.ceil = function() {};
Math.floor = function() {};
Math.pow = function() {};
Math.imul = function() {};
Math.fround = function() {};
Math.round = function() {};
Math.min = function() {};
Math.max = function() {};
Math.clz32 = function() {};
Math.trunc = function() {};
/**
* @const
* @suppress {duplicate, checkTypes}
*/
var WebAssembly = {};
/**
* @param {!WebAssembly.Tag} tag
* @param {number} index
*/
WebAssembly.Exception.getArg = function(tag, index) {};
/**
* @param {!WebAssembly.Tag} tag
*/
WebAssembly.Exception.is = function(tag) {};
/**
* @type {string}
*/
WebAssembly.Exception.stack;
/**
* Note: Closure compiler does not support function overloading, omit this overload for now.
* {function(!WebAssembly.Module, Object=):!Promise<!WebAssembly.Instance>}
*/
/**
* @returns {ArrayBuffer}
*/
WebAssembly.Memory.prototype.toResizableBuffer = function() {};
/**
* @param {!Function} func
* @returns {Function}
*/
WebAssembly.promising = function(func) {};
/**
* @constructor
* @param {!Function} func
*/
WebAssembly.Suspending = function(func) {};
/**
* @record
*/
function FunctionType() {}
/**
* @type {Array<string>}
*/
FunctionType.prototype.parameters;
/**
* @type {Array<string>}
*/
FunctionType.prototype.results;
/**
* @constructor
* @param {!FunctionType} type
* @param {!Function} func
*/
WebAssembly.Function = function(type, func) {};
/**
* @param {Function} func
* @return {FunctionType}
*/
WebAssembly.Function.type = function(func) {};
/**
* @suppress {undefinedVars}
*/
var wakaUnknownAfter;
/**
* @suppress {undefinedVars}
*/
var wakaUnknownBefore;
// Module loaders externs, for AMD etc.
/**
* @param {Function} wrapper
*/
var define = function (wrapper) {};
/**
* @type {Worker}
*/
var worker;
/**
* @param {Object} message
*/
var onmessage = function(message) {};
var onmessageerror = function() {};
/**
* @param {string} type
* @param {!Function} listener
* @param {Object|boolean=} optionsOrUseCapture
*/
var addEventListener = function (type, listener, optionsOrUseCapture) {};
/**
* @param {string} type
* @param {!Function} listener
*/
var removeEventListener = function (type, listener) {};
/**
* @type {Function}
*/
var close;
// Closure run on asm.js uses a hack to execute only on shell code, declare externs needed for it.
/**
* @suppress {undefinedVars}
*/
var wakaGlobal;
/**
* @suppress {undefinedVars}
*/
var wakaEnv;
/**
* @suppress {undefinedVars}
*/
var wakaBuffer;
// Browser externs on global window object.
var pageXOffset;
var pageYOffset;
var innerWidth;
var innerHeight;
var outerWidth;
var outerHeight;
var event;
var devicePixelRatio;
/*
* Avoid closure minifying anything to "id". See #13965
*/
var id;
/**
* This was removed from upstream closure compiler in
* https://github.com/google/closure-compiler/commit/f83322c1b.
* Perhaps we should remove it too?
*
* @param {MediaStreamConstraints} constraints A MediaStreamConstraints object.
* @param {function(!MediaStream)} successCallback
* A NavigatorUserMediaSuccessCallback function.
* @param {function(!NavigatorUserMediaError)=} errorCallback A
* NavigatorUserMediaErrorCallback function.
* @see http://dev.w3.org/2011/webrtc/editor/getusermedia.html
* @see https://www.w3.org/TR/mediacapture-streams/
* @return {undefined}
*/
Navigator.prototype.webkitGetUserMedia = function(
constraints, successCallback, errorCallback) {};
// Common between node-externs and v8-externs
var os = {};
AudioWorkletProcessor.parameterDescriptors;
var scheduler = {};