-
Notifications
You must be signed in to change notification settings - Fork 3.2k
/
closure-externs.js
266 lines (238 loc) · 5.86 KB
/
closure-externs.js
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
/**
* 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.
*/
// Special placeholder for `import.meta` and `await import`.
var EMSCRIPTEN$IMPORT$META;
var EMSCRIPTEN$AWAIT$IMPORT;
// Don't minify createRequire
var createRequire;
// Don't minify startWorker which we use to start workers once the runtime is ready.
/**
* @param {Object} Module
*/
var startWorker = function(Module) {};
// Closure externs used by library_sockfs.js
/**
* Backported from latest closure...
* @see https://developer.mozilla.org/en-US/docs/Web/API/Document/currentScript
*/
Document.prototype.currentScript;
/**
* 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() {};
/**
* Atomics
*/
var Atomics = {};
Atomics.compareExchange = function() {};
Atomics.exchange = function() {};
Atomics.wait = function() {};
Atomics.notify = function() {};
Atomics.load = function() {};
Atomics.store = function() {};
/**
* @const
* @suppress {duplicate, checkTypes}
*/
var WebAssembly = {};
/**
* @constructor
* @param {Object} globalDescriptor
* @param {*=} value
*/
WebAssembly.Global = function(globalDescriptor, value) {};
/**
* @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>}
*/
/** @dict */
WebAssembly.Instance.prototype.exports;
/**
* @type {!ArrayBuffer}
*/
WebAssembly.Memory.prototype.buffer;
/**
* @type {number}
*/
WebAssembly.Table.prototype.length;
/**
* @record
*/
function FunctionType() {}
/**
* @type {Array<string>}
*/
FunctionType.prototype.parameters;
/**
* @type {Array<string>}
*/
FunctionType.prototype.results;
/**
* @record
*/
function FunctionUsage() {}
/**
* @type {string|undefined}
*/
FunctionUsage.prototype.promising;
/**
* @type {string|undefined}
*/
FunctionUsage.prototype.suspending;
/**
* @constructor
* @param {!FunctionType} type
* @param {!Function} func
* @param {FunctionUsage=} usage
*/
WebAssembly.Function = function(type, func, usage) {};
/**
* @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;
/*
* AudioWorkletGlobalScope globals
*/
var registerProcessor = function(name, obj) {};
var currentFrame;
var currentTime;
var sampleRate;
/*
* Avoid closure minifying anything to "id". See #13965
*/
var id;
/**
* Used in MODULARIZE mode as the name of the incoming module argument.
* This is generated outside of the code we pass to closure so from closure's
* POV this is "extern".
*/
var moduleArg;
/**
* Used in MODULARIZE mode.
* We need to access this after the code we pass to closure so from closure's
* POV this is "extern".
*/
var moduleRtn;
/**
* This was removed from upstream closure compiler in
* https://github.com/google/closure-compiler/commit/f83322c1b.
* Perhaps we should remove it do?
*
* @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) {};