Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/es6.js

Issue 1774503005: [DevTools] Roll closure compiler to ToT version (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/externs.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2014 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 //TODO(sergeyv): this file is forked from usual es6.js extern baked into closure compiler
18 //In original extern Iterator doesn't implement Iterable and as a result you can 't iterate over map.values()
19
20 /**
21 * @fileoverview Definitions for ECMAScript 6.
22 * @see http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts
23 * @see https://www.khronos.org/registry/typedarray/specs/latest/
24 * @externs
25 */
26
27 // TODO(johnlenz): symbol should be a primitive type.
28 /** @typedef {?} */
29 var symbol;
30
31 /**
32 * @param {string} description
33 * @return {symbol}
34 */
35 function Symbol(description) {}
36
37
38 /**
39 * @param {string} sym
40 * @return {symbol|undefined}
41 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/Symbol/for
42 */
43 Symbol.for;
44
45
46 /**
47 * @param {symbol} sym
48 * @return {string|undefined}
49 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/Symbol/keyFor
50 */
51 Symbol.keyFor;
52
53
54 // Well known symbols
55
56 /** @const {symbol} */
57 Symbol.iterator;
58
59 /** @const {symbol} */
60 Symbol.toStringTag;
61
62 /** @const {symbol} */
63 Symbol.unscopables;
64
65
66 /**
67 * @interface
68 * @template VALUE
69 */
70 function Iterable() {}
71
72 // TODO(johnlenz): remove this when the compiler understands "symbol" natively
73 /**
74 * @return {Iterator<VALUE>}
75 * @suppress {externsValidation}
76 */
77 Iterable.prototype[Symbol.iterator] = function() {};
78
79
80
81 // TODO(johnlenz): Iterator should be a templated record type.
82 /**
83 * @interface
84 * @extends {Iterable<VALUE>}
85 * @template VALUE
86 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/The_Iterat or_protocol
87 */
88 function Iterator() {}
89
90 /**
91 * @param {VALUE=} value
92 * @return {{value:VALUE, done:boolean}}
93 */
94 Iterator.prototype.next;
95
96
97 /**
98 * @constructor
99 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/Generator
100 * @implements {Iterator<VALUE>}
101 * @template VALUE
102 */
103 function Generator() {}
104
105 /**
106 * @param {?=} opt_value
107 * @return {{value:VALUE, done:boolean}}
108 * @override
109 */
110 Generator.prototype.next = function(opt_value) {};
111
112 /**
113 * @param {VALUE} value
114 * @return {{value:VALUE, done:boolean}}
115 */
116 Generator.prototype.return = function(value) {};
117
118 /**
119 * @param {?} exception
120 * @return {{value:VALUE, done:boolean}}
121 */
122 Generator.prototype.throw = function(exception) {};
123
124
125 // TODO(johnlenz): Array should be Iterable.
126
127
128
129 /**
130 * @param {number} value
131 * @return {number}
132 * @nosideeffects
133 */
134 Math.log10 = function(value) {};
135
136 /**
137 * @param {number} value
138 * @return {number}
139 * @nosideeffects
140 */
141 Math.log2 = function(value) {};
142
143 /**
144 * @param {number} value
145 * @return {number}
146 * @nosideeffects
147 */
148 Math.log1p = function(value) {};
149
150 /**
151 * @param {number} value
152 * @return {number}
153 * @nosideeffects
154 */
155 Math.expm1 = function(value) {};
156
157 /**
158 * @param {number} value
159 * @return {number}
160 * @nosideeffects
161 */
162 Math.cosh = function(value) {};
163
164 /**
165 * @param {number} value
166 * @return {number}
167 * @nosideeffects
168 */
169 Math.sinh = function(value) {};
170
171 /**
172 * @param {number} value
173 * @return {number}
174 * @nosideeffects
175 */
176 Math.tanh = function(value) {};
177
178 /**
179 * @param {number} value
180 * @return {number}
181 * @nosideeffects
182 */
183 Math.acosh = function(value) {};
184
185 /**
186 * @param {number} value
187 * @return {number}
188 * @nosideeffects
189 */
190 Math.asinh = function(value) {};
191
192 /**
193 * @param {number} value
194 * @return {number}
195 * @nosideeffects
196 */
197 Math.atanh = function(value) {};
198
199 /**
200 * @param {number} value
201 * @return {number}
202 * @nosideeffects
203 */
204 Math.trunc = function(value) {};
205
206 /**
207 * @param {number} value
208 * @return {number}
209 * @nosideeffects
210 */
211 Math.sign = function(value) {};
212
213 /**
214 * @param {number} value
215 * @return {number}
216 * @nosideeffects
217 */
218 Math.cbrt = function(value) {};
219
220 /**
221 * @param {number} value1
222 * @param {...number} var_args
223 * @return {number}
224 * @nosideeffects
225 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/Math/hypot
226 */
227 Math.hypot = function(value1, var_args) {};
228
229
230 /**
231 * @param {*} a
232 * @param {*} b
233 * @return {boolean}
234 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/Object/is
235 */
236 Object.is;
237
238
239 /**
240 * Returns a language-sensitive string representation of this number.
241 * @param {(string|!Array<string>)=} opt_locales
242 * @param {Object=} opt_options
243 * @return {string}
244 * @nosideeffects
245 * @see https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objec ts/Number/toLocaleString
246 * @see http://www.ecma-international.org/ecma-402/1.0/#sec-13.2.1
247 * @override
248 */
249 Number.prototype.toLocaleString = function(opt_locales, opt_options) {};
250
251
252 /**
253 * Repeats the string the given number of times.
254 *
255 * @param {number} count The number of times the string is repeated.
256 * @this {String|string}
257 * @return {string}
258 * @nosideeffects
259 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/String/repeat
260 */
261 String.prototype.repeat = function(count) {};
262
263 /**
264 * @param {string} template
265 * @param {...*} var_args
266 * @return {string}
267 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/String/raw
268 */
269 String.raw = function(template, var_args) {};
270
271
272 /**
273 * @param {number} codePoint
274 * @return {string}
275 */
276 String.fromCodePoint = function(codePoint) {};
277
278
279 /**
280 * @param {number} index
281 * @return {number}
282 * @nosideeffects
283 */
284 String.prototype.codePointAt = function(index) {};
285
286
287 /**
288 * @param {string=} opt_form
289 * @return {string}
290 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/String/normalize
291 */
292 String.prototype.normalize = function(opt_form) {};
293
294
295 /**
296 * @param {string} searchString
297 * @param {number=} opt_position
298 * @return {boolean}
299 * @nosideeffects
300 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/String/startsWith
301 */
302 String.prototype.startsWith = function(searchString, opt_position) {};
303
304 /**
305 * @param {string} searchString
306 * @param {number=} opt_position
307 * @return {boolean}
308 * @nosideeffects
309 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/String/endsWith
310 */
311 String.prototype.endsWith = function(searchString, opt_position) {};
312
313 /**
314 * @param {string} searchString
315 * @param {number=} opt_position
316 * @return {boolean}
317 * @nosideeffects
318 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/String/includes
319 */
320 String.prototype.includes = function(searchString, opt_position) {};
321
322
323 /**
324 * @see http://dev.w3.org/html5/postmsg/
325 * @interface
326 */
327 function Transferable() {}
328
329 /**
330 * @param {number} length The length in bytes
331 * @constructor
332 * @noalias
333 * @throws {Error}
334 * @nosideeffects
335 * @implements {Transferable}
336 */
337 function ArrayBuffer(length) {}
338
339 /** @type {number} */
340 ArrayBuffer.prototype.byteLength;
341
342 /**
343 * @param {number} begin
344 * @param {number=} opt_end
345 * @return {!ArrayBuffer}
346 * @nosideeffects
347 */
348 ArrayBuffer.prototype.slice = function(begin, opt_end) {};
349
350
351 /**
352 * @constructor
353 * @noalias
354 */
355 function ArrayBufferView() {}
356
357 /** @type {!ArrayBuffer} */
358 ArrayBufferView.prototype.buffer;
359
360 /** @type {number} */
361 ArrayBufferView.prototype.byteOffset;
362
363 /** @type {number} */
364 ArrayBufferView.prototype.byteLength;
365
366
367 /**
368 * @typedef {!ArrayBuffer|!ArrayBufferView}
369 */
370 var BufferSource;
371
372
373 /**
374 * @param {number|ArrayBufferView|Array<number>|ArrayBuffer} length or array
375 * or buffer
376 * @param {number=} opt_byteOffset
377 * @param {number=} opt_length
378 * @extends {ArrayBufferView}
379 * @constructor
380 * @noalias
381 * @throws {Error}
382 * @modifies {arguments} If the user passes a backing array, then indexed
383 * accesses will modify the backing array. JSCompiler does not model
384 * this well. In other words, if you have:
385 * <code>
386 * var x = new ArrayBuffer(1);
387 * var y = new Int8Array(x);
388 * y[0] = 2;
389 * </code>
390 * JSCompiler will not recognize that the last assignment modifies x.
391 * We workaround this by marking all these arrays as @modifies {arguments},
392 * to introduce the possibility that x aliases y.
393 */
394 function Int8Array(length, opt_byteOffset, opt_length) {}
395
396 /** @type {number} */
397 Int8Array.BYTES_PER_ELEMENT;
398
399 /** @type {number} */
400 Int8Array.prototype.BYTES_PER_ELEMENT;
401
402 /** @type {number} */
403 Int8Array.prototype.length;
404
405 /**
406 * @param {ArrayBufferView|Array<number>} array
407 * @param {number=} opt_offset
408 */
409 Int8Array.prototype.set = function(array, opt_offset) {};
410
411 /**
412 * @param {number} begin
413 * @param {number=} opt_end
414 * @return {!Int8Array}
415 * @nosideeffects
416 */
417 Int8Array.prototype.subarray = function(begin, opt_end) {};
418
419
420 /**
421 * @param {number|ArrayBufferView|Array<number>|ArrayBuffer} length or array
422 * or buffer
423 * @param {number=} opt_byteOffset
424 * @param {number=} opt_length
425 * @extends {ArrayBufferView}
426 * @constructor
427 * @noalias
428 * @throws {Error}
429 * @modifies {arguments}
430 */
431 function Uint8Array(length, opt_byteOffset, opt_length) {}
432
433 /** @type {number} */
434 Uint8Array.BYTES_PER_ELEMENT;
435
436 /** @type {number} */
437 Uint8Array.prototype.BYTES_PER_ELEMENT;
438
439 /** @type {number} */
440 Uint8Array.prototype.length;
441
442 /**
443 * @param {ArrayBufferView|Array<number>} array
444 * @param {number=} opt_offset
445 */
446 Uint8Array.prototype.set = function(array, opt_offset) {};
447
448 /**
449 * @param {number} begin
450 * @param {number=} opt_end
451 * @return {!Uint8Array}
452 * @nosideeffects
453 */
454 Uint8Array.prototype.subarray = function(begin, opt_end) {};
455
456
457 /**
458 * @param {number|ArrayBufferView|Array<number>|ArrayBuffer} length or array
459 * or buffer
460 * @param {number=} opt_byteOffset
461 * @param {number=} opt_length
462 * @extends {ArrayBufferView}
463 * @constructor
464 * @noalias
465 * @throws {Error}
466 * @modifies {arguments}
467 */
468 function Uint8ClampedArray(length, opt_byteOffset, opt_length) {}
469
470 /** @type {number} */
471 Uint8ClampedArray.BYTES_PER_ELEMENT;
472
473 /** @type {number} */
474 Uint8ClampedArray.prototype.BYTES_PER_ELEMENT;
475
476 /** @type {number} */
477 Uint8ClampedArray.prototype.length;
478
479 /**
480 * @param {ArrayBufferView|Array<number>} array
481 * @param {number=} opt_offset
482 */
483 Uint8ClampedArray.prototype.set = function(array, opt_offset) {};
484
485 /**
486 * @param {number} begin
487 * @param {number=} opt_end
488 * @return {!Uint8ClampedArray}
489 * @nosideeffects
490 */
491 Uint8ClampedArray.prototype.subarray = function(begin, opt_end) {};
492
493
494 /**
495 * @typedef {Uint8ClampedArray}
496 * @deprecated CanvasPixelArray has been replaced by Uint8ClampedArray
497 * in the latest spec.
498 * @see http://www.w3.org/TR/2dcontext/#imagedata
499 */
500 var CanvasPixelArray;
501
502
503 /**
504 * @param {number|ArrayBufferView|Array<number>|ArrayBuffer} length or array
505 * or buffer
506 * @param {number=} opt_byteOffset
507 * @param {number=} opt_length
508 * @extends {ArrayBufferView}
509 * @constructor
510 * @noalias
511 * @throws {Error}
512 * @modifies {arguments}
513 */
514 function Int16Array(length, opt_byteOffset, opt_length) {}
515
516 /** @type {number} */
517 Int16Array.BYTES_PER_ELEMENT;
518
519 /** @type {number} */
520 Int16Array.prototype.BYTES_PER_ELEMENT;
521
522 /** @type {number} */
523 Int16Array.prototype.length;
524
525 /**
526 * @param {ArrayBufferView|Array<number>} array
527 * @param {number=} opt_offset
528 */
529 Int16Array.prototype.set = function(array, opt_offset) {};
530
531 /**
532 * @param {number} begin
533 * @param {number=} opt_end
534 * @return {!Int16Array}
535 * @nosideeffects
536 */
537 Int16Array.prototype.subarray = function(begin, opt_end) {};
538
539
540 /**
541 * @param {number|ArrayBufferView|Array<number>|ArrayBuffer} length or array
542 * or buffer
543 * @param {number=} opt_byteOffset
544 * @param {number=} opt_length
545 * @extends {ArrayBufferView}
546 * @constructor
547 * @noalias
548 * @throws {Error}
549 * @modifies {arguments}
550 */
551 function Uint16Array(length, opt_byteOffset, opt_length) {}
552
553 /** @type {number} */
554 Uint16Array.BYTES_PER_ELEMENT;
555
556 /** @type {number} */
557 Uint16Array.prototype.BYTES_PER_ELEMENT;
558
559 /** @type {number} */
560 Uint16Array.prototype.length;
561
562 /**
563 * @param {ArrayBufferView|Array<number>} array
564 * @param {number=} opt_offset
565 */
566 Uint16Array.prototype.set = function(array, opt_offset) {};
567
568 /**
569 * @param {number} begin
570 * @param {number=} opt_end
571 * @return {!Uint16Array}
572 * @nosideeffects
573 */
574 Uint16Array.prototype.subarray = function(begin, opt_end) {};
575
576
577 /**
578 * @param {number|ArrayBufferView|Array<number>|ArrayBuffer} length or array
579 * or buffer
580 * @param {number=} opt_byteOffset
581 * @param {number=} opt_length
582 * @extends {ArrayBufferView}
583 * @constructor
584 * @noalias
585 * @throws {Error}
586 * @modifies {arguments}
587 */
588 function Int32Array(length, opt_byteOffset, opt_length) {}
589
590 /** @type {number} */
591 Int32Array.BYTES_PER_ELEMENT;
592
593 /** @type {number} */
594 Int32Array.prototype.BYTES_PER_ELEMENT;
595
596 /** @type {number} */
597 Int32Array.prototype.length;
598
599 /**
600 * @param {ArrayBufferView|Array<number>} array
601 * @param {number=} opt_offset
602 */
603 Int32Array.prototype.set = function(array, opt_offset) {};
604
605 /**
606 * @param {number} begin
607 * @param {number=} opt_end
608 * @return {!Int32Array}
609 * @nosideeffects
610 */
611 Int32Array.prototype.subarray = function(begin, opt_end) {};
612
613
614 /**
615 * @param {number|ArrayBufferView|Array<number>|ArrayBuffer} length or array
616 * or buffer
617 * @param {number=} opt_byteOffset
618 * @param {number=} opt_length
619 * @extends {ArrayBufferView}
620 * @constructor
621 * @noalias
622 * @throws {Error}
623 * @modifies {arguments}
624 */
625 function Uint32Array(length, opt_byteOffset, opt_length) {}
626
627 /** @type {number} */
628 Uint32Array.BYTES_PER_ELEMENT;
629
630 /** @type {number} */
631 Uint32Array.prototype.BYTES_PER_ELEMENT;
632
633 /** @type {number} */
634 Uint32Array.prototype.length;
635
636 /**
637 * @param {ArrayBufferView|Array<number>} array
638 * @param {number=} opt_offset
639 */
640 Uint32Array.prototype.set = function(array, opt_offset) {};
641
642 /**
643 * @param {number} begin
644 * @param {number=} opt_end
645 * @return {!Uint32Array}
646 * @nosideeffects
647 */
648 Uint32Array.prototype.subarray = function(begin, opt_end) {};
649
650
651 /**
652 * @param {number|ArrayBufferView|Array<number>|ArrayBuffer} length or array
653 * or buffer
654 * @param {number=} opt_byteOffset
655 * @param {number=} opt_length
656 * @extends {ArrayBufferView}
657 * @constructor
658 * @noalias
659 * @throws {Error}
660 * @modifies {arguments}
661 */
662 function Float32Array(length, opt_byteOffset, opt_length) {}
663
664 /** @type {number} */
665 Float32Array.BYTES_PER_ELEMENT;
666
667 /** @type {number} */
668 Float32Array.prototype.BYTES_PER_ELEMENT;
669
670 /** @type {number} */
671 Float32Array.prototype.length;
672
673 /**
674 * @param {ArrayBufferView|Array<number>} array
675 * @param {number=} opt_offset
676 */
677 Float32Array.prototype.set = function(array, opt_offset) {};
678
679 /**
680 * @param {number} begin
681 * @param {number=} opt_end
682 * @return {!Float32Array}
683 * @nosideeffects
684 */
685 Float32Array.prototype.subarray = function(begin, opt_end) {};
686
687
688 /**
689 * @param {number|ArrayBufferView|Array<number>|ArrayBuffer} length or array
690 * or buffer
691 * @param {number=} opt_byteOffset
692 * @param {number=} opt_length
693 * @extends {ArrayBufferView}
694 * @constructor
695 * @noalias
696 * @throws {Error}
697 * @modifies {arguments}
698 */
699 function Float64Array(length, opt_byteOffset, opt_length) {}
700
701 /** @type {number} */
702 Float64Array.BYTES_PER_ELEMENT;
703
704 /** @type {number} */
705 Float64Array.prototype.BYTES_PER_ELEMENT;
706
707 /** @type {number} */
708 Float64Array.prototype.length;
709
710 /**
711 * @param {ArrayBufferView|Array<number>} array
712 * @param {number=} opt_offset
713 */
714 Float64Array.prototype.set = function(array, opt_offset) {};
715
716 /**
717 * @param {number} begin
718 * @param {number=} opt_end
719 * @return {!Float64Array}
720 * @nosideeffects
721 */
722 Float64Array.prototype.subarray = function(begin, opt_end) {};
723
724
725 /**
726 * @param {ArrayBuffer} buffer
727 * @param {number=} opt_byteOffset
728 * @param {number=} opt_byteLength
729 * @extends {ArrayBufferView}
730 * @constructor
731 * @noalias
732 * @throws {Error}
733 * @nosideeffects
734 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays/Dat aView
735 */
736 function DataView(buffer, opt_byteOffset, opt_byteLength) {}
737
738 /**
739 * @param {number} byteOffset
740 * @return {number}
741 * @throws {Error}
742 * @nosideeffects
743 */
744 DataView.prototype.getInt8 = function(byteOffset) {};
745
746 /**
747 * @param {number} byteOffset
748 * @return {number}
749 * @throws {Error}
750 * @nosideeffects
751 */
752 DataView.prototype.getUint8 = function(byteOffset) {};
753
754 /**
755 * @param {number} byteOffset
756 * @param {boolean=} opt_littleEndian
757 * @return {number}
758 * @throws {Error}
759 * @nosideeffects
760 */
761 DataView.prototype.getInt16 = function(byteOffset, opt_littleEndian) {};
762
763 /**
764 * @param {number} byteOffset
765 * @param {boolean=} opt_littleEndian
766 * @return {number}
767 * @throws {Error}
768 * @nosideeffects
769 */
770 DataView.prototype.getUint16 = function(byteOffset, opt_littleEndian) {};
771
772 /**
773 * @param {number} byteOffset
774 * @param {boolean=} opt_littleEndian
775 * @return {number}
776 * @throws {Error}
777 * @nosideeffects
778 */
779 DataView.prototype.getInt32 = function(byteOffset, opt_littleEndian) {};
780
781 /**
782 * @param {number} byteOffset
783 * @param {boolean=} opt_littleEndian
784 * @return {number}
785 * @throws {Error}
786 * @nosideeffects
787 */
788 DataView.prototype.getUint32 = function(byteOffset, opt_littleEndian) {};
789
790 /**
791 * @param {number} byteOffset
792 * @param {boolean=} opt_littleEndian
793 * @return {number}
794 * @throws {Error}
795 * @nosideeffects
796 */
797 DataView.prototype.getFloat32 = function(byteOffset, opt_littleEndian) {};
798
799 /**
800 * @param {number} byteOffset
801 * @param {boolean=} opt_littleEndian
802 * @return {number}
803 * @throws {Error}
804 * @nosideeffects
805 */
806 DataView.prototype.getFloat64 = function(byteOffset, opt_littleEndian) {};
807
808 /**
809 * @param {number} byteOffset
810 * @param {number} value
811 * @throws {Error}
812 */
813 DataView.prototype.setInt8 = function(byteOffset, value) {};
814
815 /**
816 * @param {number} byteOffset
817 * @param {number} value
818 * @throws {Error}
819 */
820 DataView.prototype.setUint8 = function(byteOffset, value) {};
821
822 /**
823 * @param {number} byteOffset
824 * @param {number} value
825 * @param {boolean=} opt_littleEndian
826 * @throws {Error}
827 */
828 DataView.prototype.setInt16 = function(byteOffset, value, opt_littleEndian) {};
829
830 /**
831 * @param {number} byteOffset
832 * @param {number} value
833 * @param {boolean=} opt_littleEndian
834 * @throws {Error}
835 */
836 DataView.prototype.setUint16 = function(byteOffset, value, opt_littleEndian) {};
837
838 /**
839 * @param {number} byteOffset
840 * @param {number} value
841 * @param {boolean=} opt_littleEndian
842 * @throws {Error}
843 */
844 DataView.prototype.setInt32 = function(byteOffset, value, opt_littleEndian) {};
845
846 /**
847 * @param {number} byteOffset
848 * @param {number} value
849 * @param {boolean=} opt_littleEndian
850 * @throws {Error}
851 */
852 DataView.prototype.setUint32 = function(byteOffset, value, opt_littleEndian) {};
853
854 /**
855 * @param {number} byteOffset
856 * @param {number} value
857 * @param {boolean=} opt_littleEndian
858 * @throws {Error}
859 */
860 DataView.prototype.setFloat32 = function(
861 byteOffset, value, opt_littleEndian) {};
862
863 /**
864 * @param {number} byteOffset
865 * @param {number} value
866 * @param {boolean=} opt_littleEndian
867 * @throws {Error}
868 */
869 DataView.prototype.setFloat64 = function(
870 byteOffset, value, opt_littleEndian) {};
871
872
873 /**
874 * @see https://github.com/promises-aplus/promises-spec
875 * @typedef {{then: ?}}
876 */
877 var Thenable;
878
879
880 /**
881 * This is not an official DOM interface. It is used to add generic typing
882 * and respective type inference where available.
883 * {@see goog.Thenable} inherits from this making all promises
884 * interoperate.
885 * @interface
886 * @template TYPE
887 */
888 function IThenable() {}
889
890
891 /**
892 * @param {?(function(TYPE):VALUE)=} opt_onFulfilled
893 * @param {?(function(*): *)=} opt_onRejected
894 * @return {RESULT}
895 * @template VALUE
896 *
897 * When a Promise (or thenable) is returned from the fulfilled callback,
898 * the result is the payload of that promise, not the promise itself.
899 *
900 * @template RESULT := type('IThenable',
901 * cond(isUnknown(VALUE), unknown(),
902 * mapunion(VALUE, (V) =>
903 * cond(isTemplatized(V) && sub(rawTypeOf(V), 'IThenable'),
904 * templateTypeOf(V, 0),
905 * cond(sub(V, 'Thenable'),
906 * unknown(),
907 * V)))))
908 * =:
909 */
910 IThenable.prototype.then = function(opt_onFulfilled, opt_onRejected) {};
911
912
913 /**
914 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/Promise
915 * @param {function(
916 * function((TYPE|IThenable<TYPE>|Thenable|null)=),
917 * function(*=))} resolver
918 * @constructor
919 * @implements {IThenable<TYPE>}
920 * @template TYPE
921 */
922 function Promise(resolver) {}
923
924
925 /**
926 * @param {(TYPE|IThenable<TYPE>)=} opt_value
927 * @return {!Promise<TYPE>}
928 * @template TYPE
929 */
930 Promise.resolve = function(opt_value) {};
931
932
933 /**
934 * @param {*=} opt_error
935 * @return {!Promise<?>}
936 */
937 Promise.reject = function(opt_error) {};
938
939
940 /**
941 * @template T
942 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/Promise
943 * @param {!Array<T|!Promise<T>>} iterable
944 * @return {!Promise<!Array<T>>}
945 */
946 Promise.all = function(iterable) {};
947
948
949 /**
950 * @template T
951 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/Promise
952 * @param {!Array<T>} iterable
953 * @return {!Promise<T>}
954 */
955 Promise.race = function(iterable) {};
956
957
958 /**
959 * @param {?(function(TYPE):VALUE)=} opt_onFulfilled
960 * @param {?(function(*): *)=} opt_onRejected
961 * @return {RESULT}
962 * @template VALUE
963 *
964 * When a Promise (or thenable) is returned from the fulfilled callback,
965 * the result is the payload of that promise, not the promise itself.
966 *
967 * @template RESULT := type('Promise',
968 * cond(isUnknown(VALUE), unknown(),
969 * mapunion(VALUE, (V) =>
970 * cond(isTemplatized(V) && sub(rawTypeOf(V), 'IThenable'),
971 * templateTypeOf(V, 0),
972 * cond(sub(V, 'Thenable'),
973 * unknown(),
974 * V)))))
975 * =:
976 * @override
977 */
978 Promise.prototype.then = function(opt_onFulfilled, opt_onRejected) {};
979
980
981 /**
982 * @param {function(*): RESULT} onRejected
983 * @return {!Promise<RESULT>}
984 * @template RESULT
985 */
986 Promise.prototype.catch = function(onRejected) {};
987
988
989 /**
990 * @param {T} value
991 * @param {number=} start
992 * @param {number=} end
993 * @this {!Array<T>}
994 * @template T
995 */
996 Array.prototype.fill = function(value, start, end) {}
997
998
999 /**
1000 * @param {function(this:S,T,number,!Array<T>)} callback
1001 * @param {?S=} thisArg
1002 * @this {!Array<T>}
1003 * @template T,S
1004 */
1005 Array.prototype.find = function(callback, thisArg) {}
1006
1007
1008 /** @return {!Array<number>} */
1009 Array.prototype.keys;
1010
1011
1012 /**
1013 * @return {!Array<!Array>} An array of [key, value] pairs.
1014 */
1015 Array.prototype.entries;
1016
1017 /** @return {!Array<symbol>} */
1018 Object.getOwnPropertySymbols;
1019
1020
1021 /** @return {void} */
1022 Object.setPrototypeOf;
1023
1024
1025
1026 /**
1027 * @const {number}
1028 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/Number/EPSILON
1029 */
1030 Number.EPSILON;
1031
1032 /**
1033 * @const {number}
1034 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/Number/MIN_SAFE_INTEGER
1035 */
1036 Number.MIN_SAFE_INTEGER;
1037
1038 /**
1039 * @const {number}
1040 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/Number/MAX_SAFE_INTEGER
1041 */
1042 Number.MAX_SAFE_INTEGER;
1043
1044
1045
1046 /**
1047 * Parse an integer. Use of {@code parseInt} without {@code base} is strictly
1048 * banned in Google. If you really want to parse octal or hex based on the
1049 * leader, then pass {@code undefined} as the base.
1050 *
1051 * @param {string} string
1052 * @param {number|undefined} radix
1053 * @return {number}
1054 * @nosideeffects
1055 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/Number/parseInt
1056 */
1057 Number.parseInt = function(string, radix) {};
1058
1059 /**
1060 * @param {string} string
1061 * @return {number}
1062 * @nosideeffects
1063 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/Number/parseFloat
1064 */
1065 Number.parseFloat = function(string) {};
1066
1067 /**
1068 * @param {number} value
1069 * @return {boolean}
1070 * @nosideeffects
1071 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/Number/isNaN
1072 */
1073 Number.isNaN = function(value) {};
1074
1075 /**
1076 * @param {number} value
1077 * @return {boolean}
1078 * @nosideeffects
1079 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/Number/isFinite
1080 */
1081 Number.isFinite = function(value) {};
1082
1083 /**
1084 * @param {number} value
1085 * @return {boolean}
1086 * @nosideeffects
1087 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/Number/isInteger
1088 */
1089 Number.isInteger = function(value) {};
1090
1091 /**
1092 * @param {number} value
1093 * @return {boolean}
1094 * @nosideeffects
1095 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/Number/isSafeInteger
1096 */
1097 Number.isSafeInteger = function(value) {};
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/externs.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698