google-closure-compiler 20250412.0.0-nightly → 20250413.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/README.md +5 -30
  2. package/cli.js +3 -4
  3. package/externs/browser/decorators.js +276 -0
  4. package/externs/browser/deprecated.js +58 -0
  5. package/externs/browser/es6_proxy.js +143 -0
  6. package/externs/browser/fetchapi.js +449 -0
  7. package/externs/browser/fido.js +94 -0
  8. package/externs/browser/flash.js +226 -0
  9. package/externs/browser/gecko_css.js +126 -0
  10. package/externs/browser/gecko_dom.js +479 -0
  11. package/externs/browser/gecko_event.js +86 -0
  12. package/externs/browser/gecko_xml.js +73 -0
  13. package/externs/browser/google_legacy.js +31 -0
  14. package/externs/browser/html5.js +6647 -0
  15. package/externs/browser/ie_css.js +270 -0
  16. package/externs/browser/ie_dom.js +1232 -0
  17. package/externs/browser/ie_event.js +310 -0
  18. package/externs/browser/ie_vml.js +77 -0
  19. package/externs/browser/intersection_observer.js +178 -0
  20. package/externs/browser/intl.js +602 -0
  21. package/externs/browser/iphone.js +204 -0
  22. package/externs/browser/mediakeys.js +305 -0
  23. package/externs/browser/mediasource.js +155 -0
  24. package/externs/browser/nonstandard_anim_timing.js +97 -0
  25. package/externs/browser/nonstandard_audio.js +82 -0
  26. package/externs/browser/nonstandard_console.js +75 -0
  27. package/externs/browser/nonstandard_fileapi.js +1066 -0
  28. package/externs/browser/nonstandard_indexeddb.js +78 -0
  29. package/externs/browser/nonstandard_navigation_timing.js +38 -0
  30. package/externs/browser/nonstandard_selection.js +80 -0
  31. package/externs/browser/page_visibility.js +28 -0
  32. package/externs/browser/streamsapi.js +593 -0
  33. package/externs/browser/svg.js +10016 -0
  34. package/externs/browser/url.js +202 -0
  35. package/externs/browser/v8.js +134 -0
  36. package/externs/browser/w3c_abort.js +89 -0
  37. package/externs/browser/w3c_anim_timing.js +49 -0
  38. package/externs/browser/w3c_aria_mixin.js +286 -0
  39. package/externs/browser/w3c_audio.js +1660 -0
  40. package/externs/browser/w3c_batterystatus.js +85 -0
  41. package/externs/browser/w3c_clipboard.js +74 -0
  42. package/externs/browser/w3c_clipboardevent.js +47 -0
  43. package/externs/browser/w3c_composition_event.js +93 -0
  44. package/externs/browser/w3c_css.js +3790 -0
  45. package/externs/browser/w3c_css3d.js +199 -0
  46. package/externs/browser/w3c_device_sensor_event.js +122 -0
  47. package/externs/browser/w3c_dom1.js +1160 -0
  48. package/externs/browser/w3c_dom2.js +3151 -0
  49. package/externs/browser/w3c_dom3.js +555 -0
  50. package/externs/browser/w3c_dom4.js +289 -0
  51. package/externs/browser/w3c_elementtraversal.js +116 -0
  52. package/externs/browser/w3c_event.js +607 -0
  53. package/externs/browser/w3c_event3.js +77 -0
  54. package/externs/browser/w3c_eventsource.js +110 -0
  55. package/externs/browser/w3c_fileapi.js +302 -0
  56. package/externs/browser/w3c_gamepad.js +113 -0
  57. package/externs/browser/w3c_geolocation.js +130 -0
  58. package/externs/browser/w3c_geometry1.js +899 -0
  59. package/externs/browser/w3c_indexeddb.js +771 -0
  60. package/externs/browser/w3c_keyboardlock.js +47 -0
  61. package/externs/browser/w3c_mediacapabilities.js +206 -0
  62. package/externs/browser/w3c_midi.js +301 -0
  63. package/externs/browser/w3c_navigation.js +72 -0
  64. package/externs/browser/w3c_navigation_timing.js +437 -0
  65. package/externs/browser/w3c_netinfo.js +85 -0
  66. package/externs/browser/w3c_payment_request.js +401 -0
  67. package/externs/browser/w3c_permissions.js +112 -0
  68. package/externs/browser/w3c_permissions_policy.js +78 -0
  69. package/externs/browser/w3c_pointer_events.js +163 -0
  70. package/externs/browser/w3c_pointerlock.js +63 -0
  71. package/externs/browser/w3c_range.js +284 -0
  72. package/externs/browser/w3c_referrer_policy.js +36 -0
  73. package/externs/browser/w3c_requestidlecallback.js +76 -0
  74. package/externs/browser/w3c_rtc.js +3882 -0
  75. package/externs/browser/w3c_screen_orientation.js +53 -0
  76. package/externs/browser/w3c_screen_wake_lock.js +58 -0
  77. package/externs/browser/w3c_selection.js +209 -0
  78. package/externs/browser/w3c_selectors.js +113 -0
  79. package/externs/browser/w3c_serviceworker.js +739 -0
  80. package/externs/browser/w3c_speech.js +426 -0
  81. package/externs/browser/w3c_touch_event.js +296 -0
  82. package/externs/browser/w3c_trusted_types.js +142 -0
  83. package/externs/browser/w3c_vibration.js +38 -0
  84. package/externs/browser/w3c_webcodecs.js +1473 -0
  85. package/externs/browser/w3c_webcrypto.js +839 -0
  86. package/externs/browser/w3c_worklets.js +54 -0
  87. package/externs/browser/w3c_xml.js +533 -0
  88. package/externs/browser/web_animations.js +452 -0
  89. package/externs/browser/web_app_manifest.js +50 -0
  90. package/externs/browser/webassembly.js +223 -0
  91. package/externs/browser/webgl.js +3409 -0
  92. package/externs/browser/webgl2.js +2727 -0
  93. package/externs/browser/webgl2_compute.js +1609 -0
  94. package/externs/browser/webkit_css.js +456 -0
  95. package/externs/browser/webkit_dom.js +118 -0
  96. package/externs/browser/webkit_event.js +46 -0
  97. package/externs/browser/webkit_notifications.js +258 -0
  98. package/externs/browser/webkit_usercontent.js +55 -0
  99. package/externs/browser/weblocksapi.js +125 -0
  100. package/externs/browser/webstorage.js +171 -0
  101. package/externs/browser/whatwg_bitmap_context.js +37 -0
  102. package/externs/browser/whatwg_console.js +152 -0
  103. package/externs/browser/whatwg_encoding.js +99 -0
  104. package/externs/browser/whatwg_file_system.js +296 -0
  105. package/externs/browser/wicg_attribution_reporting.js +42 -0
  106. package/externs/browser/wicg_compression_stream.js +60 -0
  107. package/externs/browser/wicg_constructable_stylesheets.js +60 -0
  108. package/externs/browser/wicg_entries.js +169 -0
  109. package/externs/browser/wicg_file_handling.js +41 -0
  110. package/externs/browser/wicg_file_system_access.js +191 -0
  111. package/externs/browser/wicg_floc.js +41 -0
  112. package/externs/browser/wicg_ink.js +89 -0
  113. package/externs/browser/wicg_resizeobserver.js +100 -0
  114. package/externs/browser/wicg_scheduler.js +62 -0
  115. package/externs/browser/wicg_trust_token.js +89 -0
  116. package/externs/browser/wicg_uach.js +100 -0
  117. package/externs/browser/window.js +190 -0
  118. package/externs/es3.js +2716 -0
  119. package/externs/es5.js +284 -0
  120. package/externs/es6.js +2554 -0
  121. package/externs/es6_collections.js +323 -0
  122. package/index.js +13 -16
  123. package/lib/grunt/index.js +71 -92
  124. package/lib/grunt/vinyl-stream.js +12 -18
  125. package/lib/gulp/concat-to-json.js +30 -18
  126. package/lib/gulp/index.js +174 -181
  127. package/lib/gulp/json-to-vinyl.js +8 -8
  128. package/lib/node/{closure-compiler.js → index.js} +27 -51
  129. package/lib/utils.js +16 -14
  130. package/package.json +19 -16
  131. package/lib/logger.js +0 -89
@@ -0,0 +1,452 @@
1
+ /*
2
+ * Copyright 2016 The Closure Compiler authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+
18
+ /**
19
+ * @fileoverview Basic externs for the Web Animations API. This is not
20
+ * nessecarily exhaustive. For more information, see the spec-
21
+ * https://w3c.github.io/web-animations
22
+ * @externs
23
+ */
24
+
25
+
26
+ /**
27
+ * @param {!Object} frames
28
+ * @param {(number|KeyframeAnimationOptions)=} options
29
+ * @return {!Animation}
30
+ * @see https://www.w3.org/TR/web-animations/#the-animatable-interface-mixin
31
+ */
32
+ Element.prototype.animate = function(frames, options) {};
33
+
34
+ /**
35
+ * @param {GetAnimationsOptions=} options
36
+ * @return {!Array<!Animation>}
37
+ * @see https://www.w3.org/TR/web-animations/#dom-animatable-getanimations
38
+ */
39
+ Element.prototype.getAnimations = function(options) {};
40
+
41
+ /**
42
+ * @return {!Array<!Animation>}
43
+ * @see https://www.w3.org/TR/web-animations/#dom-documentorshadowroot-getanimations
44
+ */
45
+ Document.prototype.getAnimations = function() {};
46
+
47
+ /**
48
+ * @return {!Array<!Animation>}
49
+ * @see https://www.w3.org/TR/web-animations/#dom-documentorshadowroot-getanimations
50
+ */
51
+ ShadowRoot.prototype.getAnimations = function() {};
52
+
53
+ /**
54
+ * @constructor
55
+ * @param {?AnimationEffect=} effect
56
+ * @param {AnimationTimeline=} timeline
57
+ * @implements {EventTarget}
58
+ */
59
+ var Animation = function(effect, timeline) {};
60
+
61
+ /** @override */
62
+ Animation.prototype.addEventListener = function(type, listener, options) {};
63
+
64
+ /** @override */
65
+ Animation.prototype.removeEventListener = function(type, listener, options) {};
66
+
67
+ /** @override */
68
+ Animation.prototype.dispatchEvent = function(evt) {};
69
+
70
+ /**
71
+ * @return {undefined}
72
+ */
73
+ Animation.prototype.cancel = function() {};
74
+
75
+ /**
76
+ * @return {undefined}
77
+ */
78
+ Animation.prototype.commitStyles = function() {};
79
+
80
+ /**
81
+ * @return {undefined}
82
+ */
83
+ Animation.prototype.finish = function() {};
84
+
85
+ /**
86
+ * @return {undefined}
87
+ */
88
+ Animation.prototype.pause = function() {};
89
+
90
+ /**
91
+ * @return {undefined}
92
+ */
93
+ Animation.prototype.play = function() {};
94
+
95
+ /**
96
+ * @return {undefined}
97
+ */
98
+ Animation.prototype.reverse = function() {};
99
+
100
+ /** @type {number} */
101
+ Animation.prototype.currentTime;
102
+
103
+ /** @type {?AnimationEffect} */
104
+ Animation.prototype.effect;
105
+
106
+ /** @type {!Promise<void>} */
107
+ Animation.prototype.finished;
108
+
109
+ /** @type {string} */
110
+ Animation.prototype.id;
111
+
112
+ /** @type {?function(!Event)} */
113
+ Animation.prototype.oncancel;
114
+
115
+ /** @type {?function(!Event)} */
116
+ Animation.prototype.onfinish;
117
+
118
+ /** @type {number} */
119
+ Animation.prototype.playbackRate;
120
+
121
+ /** @type {string} */
122
+ Animation.prototype.playState;
123
+
124
+ /** @type {!Promise<void>} */
125
+ Animation.prototype.ready;
126
+
127
+ /** @type {number} */
128
+ Animation.prototype.startTime;
129
+
130
+ /** @type {!AnimationTimeline} */
131
+ Animation.prototype.timeline;
132
+
133
+
134
+ /**
135
+ * @interface
136
+ */
137
+ var AnimationEffect = function() {};
138
+
139
+ /**
140
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEffect/getTiming)
141
+ * @return {!AnimationEffectTimingProperties}
142
+ */
143
+ AnimationEffect.prototype.getTiming = function() {};
144
+
145
+ /**
146
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEffect/getComputedTiming)
147
+ * @return {!ComputedTimingProperties}
148
+ */
149
+ AnimationEffect.prototype.getComputedTiming = function() {};
150
+
151
+ /**
152
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEffect/updateTiming)
153
+ * @param {AnimationEffectTimingProperties=} timing
154
+ */
155
+ AnimationEffect.prototype.updateTiming = function(timing) {};
156
+
157
+ /** @type {!AnimationEffectTiming} */
158
+ AnimationEffect.prototype.timing;
159
+
160
+ /**
161
+ * @constructor
162
+ * @param {Element} target
163
+ * @param {(!Array<!Object<string, *>>|!Object<string, !Array<*>>)} frames
164
+ * @param {(number|AnimationEffectTimingProperties)=} options
165
+ * @implements {AnimationEffect}
166
+ */
167
+ var KeyframeEffectReadOnly = function(target, frames, options) {};
168
+
169
+ /** @override */
170
+ KeyframeEffectReadOnly.prototype.getComputedTiming = function() {};
171
+
172
+ /** @override */
173
+ KeyframeEffectReadOnly.prototype.timing;
174
+
175
+
176
+ /**
177
+ * @constructor
178
+ * @param {Element} target
179
+ * @param {(!Array<!Object<string, *>>|!Object<string, !Array<*>>)} frames
180
+ * @param {(number|AnimationEffectTimingProperties)=} options
181
+ * @extends {KeyframeEffectReadOnly}
182
+ */
183
+ var KeyframeEffect = function(target, frames, options) {};
184
+
185
+ /**
186
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/KeyframeEffect/getKeyframes)
187
+ * @public
188
+ * @return {!Array<!ComputedKeyframe>}
189
+ */
190
+ KeyframeEffect.prototype.getKeyframes = function() {};
191
+
192
+ /**
193
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/KeyframeEffect/setKeyframes)
194
+ * @public
195
+ * @param {(null|!PropertyIndexedKeyframes|!Array<!Keyframe>)} keyframes
196
+ * @return {void}
197
+ */
198
+ KeyframeEffect.prototype.setKeyframes = function(keyframes) {};
199
+
200
+ /**
201
+ * @record
202
+ */
203
+ var ComputedKeyframe = function() {};
204
+
205
+ /** @type {string} */
206
+ ComputedKeyframe.prototype.composite;
207
+ /** @type {number} */
208
+ ComputedKeyframe.prototype.computedOffset;
209
+ /** @type {string} */
210
+ ComputedKeyframe.prototype.easing;
211
+ /** @type {(null|number)} */
212
+ ComputedKeyframe.prototype.offset;
213
+
214
+ /**
215
+ * @record
216
+ */
217
+ var PropertyIndexedKeyframes = function() {};
218
+
219
+ /** @type {(undefined|string|!Array<string>)} */
220
+ PropertyIndexedKeyframes.prototype.composite;
221
+ /** @type {(undefined|string|!Array<string>)} */
222
+ PropertyIndexedKeyframes.prototype.easing;
223
+ /** @type {(undefined|number|!Array<(null|number)>)} */
224
+ PropertyIndexedKeyframes.prototype.offset;
225
+
226
+ /**
227
+ * @record
228
+ */
229
+ var Keyframe = function() {};
230
+
231
+ /** @type {(undefined|string)} */
232
+ Keyframe.prototype.composite;
233
+ /** @type {(undefined|string)} */
234
+ Keyframe.prototype.easing;
235
+ /** @type {(undefined|null|number)} */
236
+ Keyframe.prototype.offset;
237
+
238
+ /**
239
+ * @record
240
+ */
241
+ var AnimationEffectTimingProperties = function() {};
242
+
243
+ /** @type {number|undefined} */
244
+ AnimationEffectTimingProperties.prototype.delay;
245
+
246
+ /** @type {number|undefined} */
247
+ AnimationEffectTimingProperties.prototype.endDelay;
248
+
249
+ /** @type {string|undefined} */
250
+ AnimationEffectTimingProperties.prototype.fill;
251
+
252
+ /** @type {number|undefined} */
253
+ AnimationEffectTimingProperties.prototype.iterationStart;
254
+
255
+ /** @type {number|undefined} */
256
+ AnimationEffectTimingProperties.prototype.iterations;
257
+
258
+ /** @type {number|string|undefined} */
259
+ AnimationEffectTimingProperties.prototype.duration;
260
+
261
+ /** @type {string|undefined} */
262
+ AnimationEffectTimingProperties.prototype.direction;
263
+
264
+ /** @type {string|undefined} */
265
+ AnimationEffectTimingProperties.prototype.easing;
266
+
267
+ /**
268
+ * @record
269
+ * @extends {AnimationEffectTimingProperties}
270
+ */
271
+ var KeyframeEffectOptions = function() {};
272
+
273
+ /**
274
+ * Possible values: 'replace', 'accumulate'
275
+ * @type {string|undefined}
276
+ */
277
+ KeyframeEffectOptions.prototype.iterationComposite;
278
+
279
+ /**
280
+ * Possible values: 'replace', 'add', 'accumulate'
281
+ * @type {string|undefined}
282
+ */
283
+ KeyframeEffectOptions.prototype.composite;
284
+
285
+ /**
286
+ * @record
287
+ * @extends {KeyframeEffectOptions}
288
+ */
289
+ var KeyframeAnimationOptions = function() {};
290
+
291
+ /** @type {string|undefined} */
292
+ KeyframeAnimationOptions.prototype.id;
293
+
294
+
295
+ /**
296
+ * @record
297
+ * @extends {AnimationEffectTimingProperties}
298
+ */
299
+ var ComputedTimingProperties = function() {};
300
+
301
+ /** @type {number} */
302
+ ComputedTimingProperties.prototype.endTime;
303
+
304
+ /** @type {number} */
305
+ ComputedTimingProperties.prototype.activeDuration;
306
+
307
+ /** @type {?number} */
308
+ ComputedTimingProperties.prototype.localTime;
309
+
310
+ /** @type {?number} */
311
+ ComputedTimingProperties.prototype.progress;
312
+
313
+ /** @type {?number} */
314
+ ComputedTimingProperties.prototype.currentIteration;
315
+
316
+
317
+ /**
318
+ * @interface
319
+ */
320
+ var AnimationEffectTimingReadOnly = function() {};
321
+
322
+ /** @type {number} */
323
+ AnimationEffectTimingReadOnly.prototype.delay;
324
+
325
+ /** @type {number} */
326
+ AnimationEffectTimingReadOnly.prototype.endDelay;
327
+
328
+ /** @type {string} */
329
+ AnimationEffectTimingReadOnly.prototype.fill;
330
+
331
+ /** @type {number} */
332
+ AnimationEffectTimingReadOnly.prototype.iterationStart;
333
+
334
+ /** @type {number} */
335
+ AnimationEffectTimingReadOnly.prototype.iterations;
336
+
337
+ /** @type {number|string} */
338
+ AnimationEffectTimingReadOnly.prototype.duration;
339
+
340
+ /** @type {string} */
341
+ AnimationEffectTimingReadOnly.prototype.direction;
342
+
343
+ /** @type {string} */
344
+ AnimationEffectTimingReadOnly.prototype.easing;
345
+
346
+
347
+ /**
348
+ * @interface
349
+ * @extends {AnimationEffectTimingReadOnly}
350
+ */
351
+ var AnimationEffectTiming = function() {};
352
+
353
+
354
+ /**
355
+ * @interface
356
+ */
357
+ var AnimationTimeline = function() {};
358
+
359
+ /** @type {?number} */
360
+ AnimationTimeline.prototype.currentTime;
361
+
362
+
363
+ /**
364
+ * @constructor
365
+ * @implements {AnimationTimeline}
366
+ */
367
+ var DocumentTimeline = function() {};
368
+
369
+ /** @override */
370
+ DocumentTimeline.prototype.currentTime;
371
+
372
+
373
+ /** @type {!DocumentTimeline} */
374
+ Document.prototype.timeline;
375
+
376
+ /**
377
+ * Externs for the Web Animations API (Level 2 / Groups).
378
+ *
379
+ * This defines externs for the "-next" version of the Web Animations API
380
+ * polyfill found online at:
381
+ * https://github.com/web-animations/web-animations.js
382
+ *
383
+ * These features are NOT natively implemented in browsers and are not clearly
384
+ * part of the official spec. This is NOT intended to be exhaustive, and
385
+ * requires the base externs from web-animations.js.
386
+ *
387
+ */
388
+
389
+
390
+ /** @type {Element} */
391
+ KeyframeEffectReadOnly.prototype.target;
392
+
393
+ /** @type {?function(number, !KeyframeEffect, !Animation)|undefined} */
394
+ KeyframeEffectReadOnly.prototype.onsample;
395
+
396
+
397
+ /**
398
+ * @param {!AnimationEffect} effect
399
+ * @return {!Animation}
400
+ */
401
+ DocumentTimeline.prototype.play = function(effect) {};
402
+
403
+ /**
404
+ * @return {!Array<!Animation>}
405
+ */
406
+ DocumentTimeline.prototype.getAnimations = function() {};
407
+
408
+
409
+ /**
410
+ * @param {!Array<!AnimationEffect>} children
411
+ * @param {AnimationEffectTimingProperties=} timing
412
+ * @constructor
413
+ * @implements {AnimationEffect}
414
+ */
415
+ var SequenceEffect = function(children, timing) {};
416
+
417
+ /** @override */
418
+ SequenceEffect.prototype.getComputedTiming = function() {};
419
+
420
+ /** @override */
421
+ SequenceEffect.prototype.timing;
422
+
423
+ /** @type {!Array<!AnimationEffect>} */
424
+ SequenceEffect.prototype.children;
425
+
426
+
427
+ /**
428
+ * @param {!Array<!AnimationEffect>} children
429
+ * @param {AnimationEffectTimingProperties=} timing
430
+ * @constructor
431
+ * @implements {AnimationEffect}
432
+ */
433
+ var GroupEffect = function(children, timing) {};
434
+
435
+ /** @override */
436
+ GroupEffect.prototype.getComputedTiming = function() {};
437
+
438
+ /** @override */
439
+ GroupEffect.prototype.timing;
440
+
441
+ /** @type {!Array<!AnimationEffect>} */
442
+ GroupEffect.prototype.children;
443
+
444
+
445
+ /**
446
+ * @record
447
+ * @see https://www.w3.org/TR/web-animations/#dom-animatable-getanimations
448
+ */
449
+ var GetAnimationsOptions = function() {};
450
+
451
+ /** @type {(undefined|boolean)} */
452
+ GetAnimationsOptions.prototype.subtree;
@@ -0,0 +1,50 @@
1
+ /*
2
+ * Copyright 2017 The Closure Compiler Authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * @fileoverview Externs for web app manifest APIs.
18
+ *
19
+ * @see https://www.w3.org/TR/appmanifest/
20
+ * @externs
21
+ */
22
+
23
+ /**
24
+ * @see https://www.w3.org/TR/appmanifest/#beforeinstallpromptevent-interface
25
+ * @constructor
26
+ * @extends {Event}
27
+ */
28
+ function BeforeInstallPromptEvent() {}
29
+
30
+ /** @type {!Promise<{outcome: !AppBannerPromptOutcome}>} */
31
+ BeforeInstallPromptEvent.prototype.userChoice;
32
+
33
+ /** @return {!Promise<!PromptResponseObject>} */
34
+ BeforeInstallPromptEvent.prototype.prompt = function() {};
35
+
36
+ /**
37
+ * @typedef {string}
38
+ * @see https://www.w3.org/TR/appmanifest/#appbannerpromptoutcome-enum
39
+ * Possible values: 'accepted', 'dismissed'
40
+ */
41
+ var AppBannerPromptOutcome;
42
+
43
+ /** @typedef {{userChoice: !AppBannerPromptOutcome}} */
44
+ var PromptResponseObject;
45
+
46
+ /** @type {?function(!BeforeInstallPromptEvent)} */
47
+ Window.prototype.onbeforeinstallprompt;
48
+
49
+ /** @type {?function(!Event)} */
50
+ Window.prototype.onappinstalled;
@@ -0,0 +1,223 @@
1
+ /*
2
+ * Copyright 2017 The Closure Compiler Authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ /**
18
+ * @fileoverview Definitions for WebAssembly JS API
19
+ *
20
+ * @see http://webassembly.org/docs/js/
21
+ *
22
+ * @externs
23
+ * @author loorongjie@gmail.com (Loo Rong Jie)
24
+ */
25
+
26
+ /**
27
+ * @const
28
+ */
29
+ var WebAssembly = {};
30
+
31
+ /**
32
+ * @constructor
33
+ * @param {!BufferSource} bytes
34
+ */
35
+ WebAssembly.Module = function(bytes) {};
36
+
37
+ /**
38
+ * @constructor
39
+ * @param {!WebAssembly.Module} moduleObject
40
+ * @param {Object=} importObject
41
+ */
42
+ WebAssembly.Instance = function(moduleObject, importObject) {};
43
+
44
+ /**
45
+ * @typedef {{initial:number, maximum:(number|undefined), shared:(boolean|undefined)}}
46
+ */
47
+ var MemoryDescriptor;
48
+
49
+ /**
50
+ * @constructor
51
+ * @param {MemoryDescriptor} memoryDescriptor
52
+ */
53
+ WebAssembly.Memory = function(memoryDescriptor) {};
54
+
55
+ /**
56
+ * @typedef {{element:string, initial:number, maximum:(number|undefined)}}
57
+ */
58
+ var TableDescriptor;
59
+
60
+ /**
61
+ * @constructor
62
+ * @param {TableDescriptor} tableDescriptor
63
+ */
64
+ WebAssembly.Table = function(tableDescriptor) {};
65
+
66
+ /**
67
+ * @constructor
68
+ * @extends {Error}
69
+ */
70
+ WebAssembly.CompileError = function() {};
71
+
72
+ /**
73
+ * @constructor
74
+ * @extends {Error}
75
+ */
76
+ WebAssembly.LinkError = function() {};
77
+
78
+ /**
79
+ * @constructor
80
+ * @param {string=} message
81
+ * @param {string=} fileName
82
+ * @param {number=} lineNumber
83
+ * @extends {Error}
84
+ */
85
+ WebAssembly.RuntimeError = function(message, fileName, lineNumber) {};
86
+
87
+ /**
88
+ * @record
89
+ */
90
+ function WebAssemblyTagOptions() {};
91
+
92
+ /**
93
+ * @type {Array<string>}
94
+ */
95
+ WebAssemblyTagOptions.prototype.parameters;
96
+
97
+ /**
98
+ * @constructor
99
+ * @param {!WebAssemblyTagOptions} type
100
+ */
101
+ WebAssembly.Tag = function(type) {};
102
+
103
+ /**
104
+ * @type {!WebAssembly.Tag}
105
+ */
106
+ WebAssembly.JSTag;
107
+
108
+ /**
109
+ * @record
110
+ */
111
+ function WebAssemblyExceptionOptions() {};
112
+
113
+ /**
114
+ * @type {undefined|boolean}
115
+ */
116
+ WebAssemblyExceptionOptions.prototype.traceStack;
117
+
118
+ /**
119
+ * @constructor
120
+ * @param {!WebAssembly.Tag} tag
121
+ * @param {!Array} payload
122
+ * @param {WebAssemblyExceptionOptions=} options
123
+ */
124
+ WebAssembly.Exception = function(tag, payload, options) {};
125
+
126
+ /**
127
+ * @type {undefined|string}
128
+ */
129
+ WebAssembly.Exception.prototype.stack;
130
+
131
+ // Note: Closure compiler does not support function overloading, omit this overload for now.
132
+ // {function(!WebAssembly.Module, Object=):!Promise<!WebAssembly.Instance>}
133
+ /**
134
+ * @param {!BufferSource} moduleObject
135
+ * @param {Object=} importObject
136
+ * @return {!Promise<{module:!WebAssembly.Module, instance:!WebAssembly.Instance}>}
137
+ */
138
+ WebAssembly.instantiate = function(moduleObject, importObject) {};
139
+
140
+ /**
141
+ * @param {!Promise<!Response>|!Response} source
142
+ * @param {Object=} importObject
143
+ * @return {!Promise<{module:!WebAssembly.Module, instance:!WebAssembly.Instance}>}
144
+ */
145
+ WebAssembly.instantiateStreaming = function(source, importObject) {};
146
+
147
+ /**
148
+ * @param {!BufferSource} bytes
149
+ * @return {!Promise<!WebAssembly.Module>}
150
+ */
151
+ WebAssembly.compile = function(bytes) {};
152
+
153
+ /**
154
+ * @param {!Promise<!Response>} moduleStream
155
+ * @return {!Promise<!WebAssembly.Module>}
156
+ */
157
+ WebAssembly.compileStreaming = function(moduleStream) {};
158
+
159
+ /**
160
+ * @param {!BufferSource} bytes
161
+ * @return {boolean}
162
+ * @nosideeffects
163
+ */
164
+ WebAssembly.validate = function(bytes) {};
165
+
166
+ /**
167
+ * @param {!WebAssembly.Module} moduleObject
168
+ * @return {!Array<{name:string, kind:string}>}
169
+ */
170
+ WebAssembly.Module.exports = function(moduleObject) {};
171
+
172
+ /**
173
+ * @param {!WebAssembly.Module} moduleObject
174
+ * @return {!Array<{module:string, name:string, kind:string}>}
175
+ */
176
+ WebAssembly.Module.imports = function(moduleObject) {};
177
+
178
+ /**
179
+ * @param {!WebAssembly.Module} moduleObject
180
+ * @param {string} sectionName
181
+ * @return {!Array<!ArrayBuffer>}
182
+ */
183
+ WebAssembly.Module.customSections = function(moduleObject, sectionName) {};
184
+
185
+ WebAssembly.Instance.prototype.exports;
186
+
187
+ /**
188
+ * @param {number} delta
189
+ * @return {number}
190
+ */
191
+ WebAssembly.Memory.prototype.grow = function(delta) {};
192
+
193
+ /**
194
+ * @type {!ArrayBuffer}
195
+ */
196
+ WebAssembly.Memory.prototype.buffer;
197
+
198
+ /**
199
+ * @param {number} delta
200
+ * @return {number}
201
+ */
202
+ WebAssembly.Table.prototype.grow = function(delta) {};
203
+
204
+ /**
205
+ * @type {number}
206
+ */
207
+ WebAssembly.Table.prototype.length;
208
+
209
+ /** @typedef {function(...)} */
210
+ var TableFunction;
211
+
212
+ /**
213
+ * @param {number} index
214
+ * @return {TableFunction}
215
+ */
216
+ WebAssembly.Table.prototype.get = function(index) {};
217
+
218
+ /**
219
+ * @param {number} index
220
+ * @param {?TableFunction} value
221
+ * @return {undefined}
222
+ */
223
+ WebAssembly.Table.prototype.set = function(index, value) {};