massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-tsserver / node_modules / typescript / lib / lib.es5.d.ts
1 /*! *****************************************************************************
2 Copyright (c) Microsoft Corporation. All rights reserved.
3 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 this file except in compliance with the License. You may obtain a copy of the
5 License at http://www.apache.org/licenses/LICENSE-2.0
6
7 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8 KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9 WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10 MERCHANTABLITY OR NON-INFRINGEMENT.
11
12 See the Apache Version 2.0 License for specific language governing permissions
13 and limitations under the License.
14 ***************************************************************************** */
15
16
17
18 /// <reference no-default-lib="true"/>\r
19
20
21 /////////////////////////////\r
22 /// ECMAScript APIs\r
23 /////////////////////////////\r
24 \r
25 declare var NaN: number;\r
26 declare var Infinity: number;\r
27 \r
28 /**\r
29  * Evaluates JavaScript code and executes it.\r
30  * @param x A String value that contains valid JavaScript code.\r
31  */\r
32 declare function eval(x: string): any;\r
33 \r
34 /**\r
35  * Converts a string to an integer.\r
36  * @param string A string to convert into a number.\r
37  * @param radix A value between 2 and 36 that specifies the base of the number in `string`.\r
38  * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\r
39  * All other strings are considered decimal.\r
40  */\r
41 declare function parseInt(string: string, radix?: number): number;\r
42 \r
43 /**\r
44  * Converts a string to a floating-point number.\r
45  * @param string A string that contains a floating-point number.\r
46  */\r
47 declare function parseFloat(string: string): number;\r
48 \r
49 /**\r
50  * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).\r
51  * @param number A numeric value.\r
52  */\r
53 declare function isNaN(number: number): boolean;\r
54 \r
55 /**\r
56  * Determines whether a supplied number is finite.\r
57  * @param number Any numeric value.\r
58  */\r
59 declare function isFinite(number: number): boolean;\r
60 \r
61 /**\r
62  * Gets the unencoded version of an encoded Uniform Resource Identifier (URI).\r
63  * @param encodedURI A value representing an encoded URI.\r
64  */\r
65 declare function decodeURI(encodedURI: string): string;\r
66 \r
67 /**\r
68  * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).\r
69  * @param encodedURIComponent A value representing an encoded URI component.\r
70  */\r
71 declare function decodeURIComponent(encodedURIComponent: string): string;\r
72 \r
73 /**\r
74  * Encodes a text string as a valid Uniform Resource Identifier (URI)\r
75  * @param uri A value representing an encoded URI.\r
76  */\r
77 declare function encodeURI(uri: string): string;\r
78 \r
79 /**\r
80  * Encodes a text string as a valid component of a Uniform Resource Identifier (URI).\r
81  * @param uriComponent A value representing an encoded URI component.\r
82  */\r
83 declare function encodeURIComponent(uriComponent: string | number | boolean): string;\r
84 \r
85 /**\r
86  * Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.\r
87  * @deprecated A legacy feature for browser compatibility\r
88  * @param string A string value\r
89  */\r
90 declare function escape(string: string): string;\r
91 \r
92 /**\r
93  * Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents.\r
94  * @deprecated A legacy feature for browser compatibility\r
95  * @param string A string value\r
96  */\r
97 declare function unescape(string: string): string;\r
98 \r
99 interface Symbol {\r
100     /** Returns a string representation of an object. */\r
101     toString(): string;\r
102 \r
103     /** Returns the primitive value of the specified object. */\r
104     valueOf(): symbol;\r
105 }\r
106 \r
107 declare type PropertyKey = string | number | symbol;\r
108 \r
109 interface PropertyDescriptor {\r
110     configurable?: boolean;\r
111     enumerable?: boolean;\r
112     value?: any;\r
113     writable?: boolean;\r
114     get?(): any;\r
115     set?(v: any): void;\r
116 }\r
117 \r
118 interface PropertyDescriptorMap {\r
119     [s: string]: PropertyDescriptor;\r
120 }\r
121 \r
122 interface Object {\r
123     /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */\r
124     constructor: Function;\r
125 \r
126     /** Returns a string representation of an object. */\r
127     toString(): string;\r
128 \r
129     /** Returns a date converted to a string using the current locale. */\r
130     toLocaleString(): string;\r
131 \r
132     /** Returns the primitive value of the specified object. */\r
133     valueOf(): Object;\r
134 \r
135     /**\r
136      * Determines whether an object has a property with the specified name.\r
137      * @param v A property name.\r
138      */\r
139     hasOwnProperty(v: PropertyKey): boolean;\r
140 \r
141     /**\r
142      * Determines whether an object exists in another object's prototype chain.\r
143      * @param v Another object whose prototype chain is to be checked.\r
144      */\r
145     isPrototypeOf(v: Object): boolean;\r
146 \r
147     /**\r
148      * Determines whether a specified property is enumerable.\r
149      * @param v A property name.\r
150      */\r
151     propertyIsEnumerable(v: PropertyKey): boolean;\r
152 }\r
153 \r
154 interface ObjectConstructor {\r
155     new(value?: any): Object;\r
156     (): any;\r
157     (value: any): any;\r
158 \r
159     /** A reference to the prototype for a class of objects. */\r
160     readonly prototype: Object;\r
161 \r
162     /**\r
163      * Returns the prototype of an object.\r
164      * @param o The object that references the prototype.\r
165      */\r
166     getPrototypeOf(o: any): any;\r
167 \r
168     /**\r
169      * Gets the own property descriptor of the specified object.\r
170      * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.\r
171      * @param o Object that contains the property.\r
172      * @param p Name of the property.\r
173      */\r
174     getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;\r
175 \r
176     /**\r
177      * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly\r
178      * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions.\r
179      * @param o Object that contains the own properties.\r
180      */\r
181     getOwnPropertyNames(o: any): string[];\r
182 \r
183     /**\r
184      * Creates an object that has the specified prototype or that has null prototype.\r
185      * @param o Object to use as a prototype. May be null.\r
186      */\r
187     create(o: object | null): any;\r
188 \r
189     /**\r
190      * Creates an object that has the specified prototype, and that optionally contains specified properties.\r
191      * @param o Object to use as a prototype. May be null\r
192      * @param properties JavaScript object that contains one or more property descriptors.\r
193      */\r
194     create(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;\r
195 \r
196     /**\r
197      * Adds a property to an object, or modifies attributes of an existing property.\r
198      * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object.\r
199      * @param p The property name.\r
200      * @param attributes Descriptor for the property. It can be for a data property or an accessor property.\r
201      */\r
202     defineProperty<T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): T;\r
203 \r
204     /**\r
205      * Adds one or more properties to an object, and/or modifies attributes of existing properties.\r
206      * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.\r
207      * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.\r
208      */\r
209     defineProperties<T>(o: T, properties: PropertyDescriptorMap & ThisType<any>): T;\r
210 \r
211     /**\r
212      * Prevents the modification of attributes of existing properties, and prevents the addition of new properties.\r
213      * @param o Object on which to lock the attributes.\r
214      */\r
215     seal<T>(o: T): T;\r
216 \r
217     /**\r
218      * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\r
219      * @param a Object on which to lock the attributes.\r
220      */\r
221     freeze<T>(a: T[]): readonly T[];\r
222 \r
223     /**\r
224      * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\r
225      * @param f Object on which to lock the attributes.\r
226      */\r
227     freeze<T extends Function>(f: T): T;\r
228 \r
229     /**\r
230      * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\r
231      * @param o Object on which to lock the attributes.\r
232      */\r
233     freeze<T>(o: T): Readonly<T>;\r
234 \r
235     /**\r
236      * Prevents the addition of new properties to an object.\r
237      * @param o Object to make non-extensible.\r
238      */\r
239     preventExtensions<T>(o: T): T;\r
240 \r
241     /**\r
242      * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object.\r
243      * @param o Object to test.\r
244      */\r
245     isSealed(o: any): boolean;\r
246 \r
247     /**\r
248      * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object.\r
249      * @param o Object to test.\r
250      */\r
251     isFrozen(o: any): boolean;\r
252 \r
253     /**\r
254      * Returns a value that indicates whether new properties can be added to an object.\r
255      * @param o Object to test.\r
256      */\r
257     isExtensible(o: any): boolean;\r
258 \r
259     /**\r
260      * Returns the names of the enumerable string properties and methods of an object.\r
261      * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\r
262      */\r
263     keys(o: object): string[];\r
264 }\r
265 \r
266 /**\r
267  * Provides functionality common to all JavaScript objects.\r
268  */\r
269 declare var Object: ObjectConstructor;\r
270 \r
271 /**\r
272  * Creates a new function.\r
273  */\r
274 interface Function {\r
275     /**\r
276      * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.\r
277      * @param thisArg The object to be used as the this object.\r
278      * @param argArray A set of arguments to be passed to the function.\r
279      */\r
280     apply(this: Function, thisArg: any, argArray?: any): any;\r
281 \r
282     /**\r
283      * Calls a method of an object, substituting another object for the current object.\r
284      * @param thisArg The object to be used as the current object.\r
285      * @param argArray A list of arguments to be passed to the method.\r
286      */\r
287     call(this: Function, thisArg: any, ...argArray: any[]): any;\r
288 \r
289     /**\r
290      * For a given function, creates a bound function that has the same body as the original function.\r
291      * The this object of the bound function is associated with the specified object, and has the specified initial parameters.\r
292      * @param thisArg An object to which the this keyword can refer inside the new function.\r
293      * @param argArray A list of arguments to be passed to the new function.\r
294      */\r
295     bind(this: Function, thisArg: any, ...argArray: any[]): any;\r
296 \r
297     /** Returns a string representation of a function. */\r
298     toString(): string;\r
299 \r
300     prototype: any;\r
301     readonly length: number;\r
302 \r
303     // Non-standard extensions\r
304     arguments: any;\r
305     caller: Function;\r
306 }\r
307 \r
308 interface FunctionConstructor {\r
309     /**\r
310      * Creates a new function.\r
311      * @param args A list of arguments the function accepts.\r
312      */\r
313     new(...args: string[]): Function;\r
314     (...args: string[]): Function;\r
315     readonly prototype: Function;\r
316 }\r
317 \r
318 declare var Function: FunctionConstructor;\r
319 \r
320 /**\r
321  * Extracts the type of the 'this' parameter of a function type, or 'unknown' if the function type has no 'this' parameter.\r
322  */\r
323 type ThisParameterType<T> = T extends (this: infer U, ...args: any[]) => any ? U : unknown;\r
324 \r
325 /**\r
326  * Removes the 'this' parameter from a function type.\r
327  */\r
328 type OmitThisParameter<T> = unknown extends ThisParameterType<T> ? T : T extends (...args: infer A) => infer R ? (...args: A) => R : T;\r
329 \r
330 interface CallableFunction extends Function {\r
331     /**\r
332      * Calls the function with the specified object as the this value and the elements of specified array as the arguments.\r
333      * @param thisArg The object to be used as the this object.\r
334      * @param args An array of argument values to be passed to the function.\r
335      */\r
336     apply<T, R>(this: (this: T) => R, thisArg: T): R;\r
337     apply<T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T, args: A): R;\r
338 \r
339     /**\r
340      * Calls the function with the specified object as the this value and the specified rest arguments as the arguments.\r
341      * @param thisArg The object to be used as the this object.\r
342      * @param args Argument values to be passed to the function.\r
343      */\r
344     call<T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T, ...args: A): R;\r
345 \r
346     /**\r
347      * For a given function, creates a bound function that has the same body as the original function.\r
348      * The this object of the bound function is associated with the specified object, and has the specified initial parameters.\r
349      * @param thisArg The object to be used as the this object.\r
350      * @param args Arguments to bind to the parameters of the function.\r
351      */\r
352     bind<T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>;\r
353     bind<T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R;\r
354     bind<T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R;\r
355     bind<T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R;\r
356     bind<T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R;\r
357     bind<T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R;\r
358 }\r
359 \r
360 interface NewableFunction extends Function {\r
361     /**\r
362      * Calls the function with the specified object as the this value and the elements of specified array as the arguments.\r
363      * @param thisArg The object to be used as the this object.\r
364      * @param args An array of argument values to be passed to the function.\r
365      */\r
366     apply<T>(this: new () => T, thisArg: T): void;\r
367     apply<T, A extends any[]>(this: new (...args: A) => T, thisArg: T, args: A): void;\r
368 \r
369     /**\r
370      * Calls the function with the specified object as the this value and the specified rest arguments as the arguments.\r
371      * @param thisArg The object to be used as the this object.\r
372      * @param args Argument values to be passed to the function.\r
373      */\r
374     call<T, A extends any[]>(this: new (...args: A) => T, thisArg: T, ...args: A): void;\r
375 \r
376     /**\r
377      * For a given function, creates a bound function that has the same body as the original function.\r
378      * The this object of the bound function is associated with the specified object, and has the specified initial parameters.\r
379      * @param thisArg The object to be used as the this object.\r
380      * @param args Arguments to bind to the parameters of the function.\r
381      */\r
382     bind<T>(this: T, thisArg: any): T;\r
383     bind<A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R;\r
384     bind<A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R;\r
385     bind<A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R;\r
386     bind<A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R;\r
387     bind<AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R;\r
388 }\r
389 \r
390 interface IArguments {\r
391     [index: number]: any;\r
392     length: number;\r
393     callee: Function;\r
394 }\r
395 \r
396 interface String {\r
397     /** Returns a string representation of a string. */\r
398     toString(): string;\r
399 \r
400     /**\r
401      * Returns the character at the specified index.\r
402      * @param pos The zero-based index of the desired character.\r
403      */\r
404     charAt(pos: number): string;\r
405 \r
406     /**\r
407      * Returns the Unicode value of the character at the specified location.\r
408      * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.\r
409      */\r
410     charCodeAt(index: number): number;\r
411 \r
412     /**\r
413      * Returns a string that contains the concatenation of two or more strings.\r
414      * @param strings The strings to append to the end of the string.\r
415      */\r
416     concat(...strings: string[]): string;\r
417 \r
418     /**\r
419      * Returns the position of the first occurrence of a substring.\r
420      * @param searchString The substring to search for in the string\r
421      * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.\r
422      */\r
423     indexOf(searchString: string, position?: number): number;\r
424 \r
425     /**\r
426      * Returns the last occurrence of a substring in the string.\r
427      * @param searchString The substring to search for.\r
428      * @param position The index at which to begin searching. If omitted, the search begins at the end of the string.\r
429      */\r
430     lastIndexOf(searchString: string, position?: number): number;\r
431 \r
432     /**\r
433      * Determines whether two strings are equivalent in the current locale.\r
434      * @param that String to compare to target string\r
435      */\r
436     localeCompare(that: string): number;\r
437 \r
438     /**\r
439      * Matches a string with a regular expression, and returns an array containing the results of that search.\r
440      * @param regexp A variable name or string literal containing the regular expression pattern and flags.\r
441      */\r
442     match(regexp: string | RegExp): RegExpMatchArray | null;\r
443 \r
444     /**\r
445      * Replaces text in a string, using a regular expression or search string.\r
446      * @param searchValue A string to search for.\r
447      * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.\r
448      */\r
449     replace(searchValue: string | RegExp, replaceValue: string): string;\r
450 \r
451     /**\r
452      * Replaces text in a string, using a regular expression or search string.\r
453      * @param searchValue A string to search for.\r
454      * @param replacer A function that returns the replacement text.\r
455      */\r
456     replace(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;\r
457 \r
458     /**\r
459      * Finds the first substring match in a regular expression search.\r
460      * @param regexp The regular expression pattern and applicable flags.\r
461      */\r
462     search(regexp: string | RegExp): number;\r
463 \r
464     /**\r
465      * Returns a section of a string.\r
466      * @param start The index to the beginning of the specified portion of stringObj.\r
467      * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end.\r
468      * If this value is not specified, the substring continues to the end of stringObj.\r
469      */\r
470     slice(start?: number, end?: number): string;\r
471 \r
472     /**\r
473      * Split a string into substrings using the specified separator and return them as an array.\r
474      * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.\r
475      * @param limit A value used to limit the number of elements returned in the array.\r
476      */\r
477     split(separator: string | RegExp, limit?: number): string[];\r
478 \r
479     /**\r
480      * Returns the substring at the specified location within a String object.\r
481      * @param start The zero-based index number indicating the beginning of the substring.\r
482      * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\r
483      * If end is omitted, the characters from start through the end of the original string are returned.\r
484      */\r
485     substring(start: number, end?: number): string;\r
486 \r
487     /** Converts all the alphabetic characters in a string to lowercase. */\r
488     toLowerCase(): string;\r
489 \r
490     /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */\r
491     toLocaleLowerCase(locales?: string | string[]): string;\r
492 \r
493     /** Converts all the alphabetic characters in a string to uppercase. */\r
494     toUpperCase(): string;\r
495 \r
496     /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */\r
497     toLocaleUpperCase(locales?: string | string[]): string;\r
498 \r
499     /** Removes the leading and trailing white space and line terminator characters from a string. */\r
500     trim(): string;\r
501 \r
502     /** Returns the length of a String object. */\r
503     readonly length: number;\r
504 \r
505     // IE extensions\r
506     /**\r
507      * Gets a substring beginning at the specified location and having the specified length.\r
508      * @deprecated A legacy feature for browser compatibility\r
509      * @param from The starting position of the desired substring. The index of the first character in the string is zero.\r
510      * @param length The number of characters to include in the returned substring.\r
511      */\r
512     substr(from: number, length?: number): string;\r
513 \r
514     /** Returns the primitive value of the specified object. */\r
515     valueOf(): string;\r
516 \r
517     readonly [index: number]: string;\r
518 }\r
519 \r
520 interface StringConstructor {\r
521     new(value?: any): String;\r
522     (value?: any): string;\r
523     readonly prototype: String;\r
524     fromCharCode(...codes: number[]): string;\r
525 }\r
526 \r
527 /**\r
528  * Allows manipulation and formatting of text strings and determination and location of substrings within strings.\r
529  */\r
530 declare var String: StringConstructor;\r
531 \r
532 interface Boolean {\r
533     /** Returns the primitive value of the specified object. */\r
534     valueOf(): boolean;\r
535 }\r
536 \r
537 interface BooleanConstructor {\r
538     new(value?: any): Boolean;\r
539     <T>(value?: T): boolean;\r
540     readonly prototype: Boolean;\r
541 }\r
542 \r
543 declare var Boolean: BooleanConstructor;\r
544 \r
545 interface Number {\r
546     /**\r
547      * Returns a string representation of an object.\r
548      * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.\r
549      */\r
550     toString(radix?: number): string;\r
551 \r
552     /**\r
553      * Returns a string representing a number in fixed-point notation.\r
554      * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.\r
555      */\r
556     toFixed(fractionDigits?: number): string;\r
557 \r
558     /**\r
559      * Returns a string containing a number represented in exponential notation.\r
560      * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.\r
561      */\r
562     toExponential(fractionDigits?: number): string;\r
563 \r
564     /**\r
565      * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.\r
566      * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive.\r
567      */\r
568     toPrecision(precision?: number): string;\r
569 \r
570     /** Returns the primitive value of the specified object. */\r
571     valueOf(): number;\r
572 }\r
573 \r
574 interface NumberConstructor {\r
575     new(value?: any): Number;\r
576     (value?: any): number;\r
577     readonly prototype: Number;\r
578 \r
579     /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */\r
580     readonly MAX_VALUE: number;\r
581 \r
582     /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */\r
583     readonly MIN_VALUE: number;\r
584 \r
585     /**\r
586      * A value that is not a number.\r
587      * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function.\r
588      */\r
589     readonly NaN: number;\r
590 \r
591     /**\r
592      * A value that is less than the largest negative number that can be represented in JavaScript.\r
593      * JavaScript displays NEGATIVE_INFINITY values as -infinity.\r
594      */\r
595     readonly NEGATIVE_INFINITY: number;\r
596 \r
597     /**\r
598      * A value greater than the largest number that can be represented in JavaScript.\r
599      * JavaScript displays POSITIVE_INFINITY values as infinity.\r
600      */\r
601     readonly POSITIVE_INFINITY: number;\r
602 }\r
603 \r
604 /** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */\r
605 declare var Number: NumberConstructor;\r
606 \r
607 interface TemplateStringsArray extends ReadonlyArray<string> {\r
608     readonly raw: readonly string[];\r
609 }\r
610 \r
611 /**\r
612  * The type of `import.meta`.\r
613  *\r
614  * If you need to declare that a given property exists on `import.meta`,\r
615  * this type may be augmented via interface merging.\r
616  */\r
617 interface ImportMeta {\r
618 }\r
619 \r
620 /**\r
621  * The type for the optional second argument to `import()`.\r
622  *\r
623  * If your host environment supports additional options, this type may be\r
624  * augmented via interface merging.\r
625  */\r
626 interface ImportCallOptions {\r
627     assert?: ImportAssertions;\r
628 }\r
629 \r
630 /**\r
631  * The type for the `assert` property of the optional second argument to `import()`.\r
632  */\r
633 interface ImportAssertions {\r
634     [key: string]: string;\r
635 }\r
636 \r
637 interface Math {\r
638     /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */\r
639     readonly E: number;\r
640     /** The natural logarithm of 10. */\r
641     readonly LN10: number;\r
642     /** The natural logarithm of 2. */\r
643     readonly LN2: number;\r
644     /** The base-2 logarithm of e. */\r
645     readonly LOG2E: number;\r
646     /** The base-10 logarithm of e. */\r
647     readonly LOG10E: number;\r
648     /** Pi. This is the ratio of the circumference of a circle to its diameter. */\r
649     readonly PI: number;\r
650     /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */\r
651     readonly SQRT1_2: number;\r
652     /** The square root of 2. */\r
653     readonly SQRT2: number;\r
654     /**\r
655      * Returns the absolute value of a number (the value without regard to whether it is positive or negative).\r
656      * For example, the absolute value of -5 is the same as the absolute value of 5.\r
657      * @param x A numeric expression for which the absolute value is needed.\r
658      */\r
659     abs(x: number): number;\r
660     /**\r
661      * Returns the arc cosine (or inverse cosine) of a number.\r
662      * @param x A numeric expression.\r
663      */\r
664     acos(x: number): number;\r
665     /**\r
666      * Returns the arcsine of a number.\r
667      * @param x A numeric expression.\r
668      */\r
669     asin(x: number): number;\r
670     /**\r
671      * Returns the arctangent of a number.\r
672      * @param x A numeric expression for which the arctangent is needed.\r
673      */\r
674     atan(x: number): number;\r
675     /**\r
676      * Returns the angle (in radians) from the X axis to a point.\r
677      * @param y A numeric expression representing the cartesian y-coordinate.\r
678      * @param x A numeric expression representing the cartesian x-coordinate.\r
679      */\r
680     atan2(y: number, x: number): number;\r
681     /**\r
682      * Returns the smallest integer greater than or equal to its numeric argument.\r
683      * @param x A numeric expression.\r
684      */\r
685     ceil(x: number): number;\r
686     /**\r
687      * Returns the cosine of a number.\r
688      * @param x A numeric expression that contains an angle measured in radians.\r
689      */\r
690     cos(x: number): number;\r
691     /**\r
692      * Returns e (the base of natural logarithms) raised to a power.\r
693      * @param x A numeric expression representing the power of e.\r
694      */\r
695     exp(x: number): number;\r
696     /**\r
697      * Returns the greatest integer less than or equal to its numeric argument.\r
698      * @param x A numeric expression.\r
699      */\r
700     floor(x: number): number;\r
701     /**\r
702      * Returns the natural logarithm (base e) of a number.\r
703      * @param x A numeric expression.\r
704      */\r
705     log(x: number): number;\r
706     /**\r
707      * Returns the larger of a set of supplied numeric expressions.\r
708      * @param values Numeric expressions to be evaluated.\r
709      */\r
710     max(...values: number[]): number;\r
711     /**\r
712      * Returns the smaller of a set of supplied numeric expressions.\r
713      * @param values Numeric expressions to be evaluated.\r
714      */\r
715     min(...values: number[]): number;\r
716     /**\r
717      * Returns the value of a base expression taken to a specified power.\r
718      * @param x The base value of the expression.\r
719      * @param y The exponent value of the expression.\r
720      */\r
721     pow(x: number, y: number): number;\r
722     /** Returns a pseudorandom number between 0 and 1. */\r
723     random(): number;\r
724     /**\r
725      * Returns a supplied numeric expression rounded to the nearest integer.\r
726      * @param x The value to be rounded to the nearest integer.\r
727      */\r
728     round(x: number): number;\r
729     /**\r
730      * Returns the sine of a number.\r
731      * @param x A numeric expression that contains an angle measured in radians.\r
732      */\r
733     sin(x: number): number;\r
734     /**\r
735      * Returns the square root of a number.\r
736      * @param x A numeric expression.\r
737      */\r
738     sqrt(x: number): number;\r
739     /**\r
740      * Returns the tangent of a number.\r
741      * @param x A numeric expression that contains an angle measured in radians.\r
742      */\r
743     tan(x: number): number;\r
744 }\r
745 /** An intrinsic object that provides basic mathematics functionality and constants. */\r
746 declare var Math: Math;\r
747 \r
748 /** Enables basic storage and retrieval of dates and times. */\r
749 interface Date {\r
750     /** Returns a string representation of a date. The format of the string depends on the locale. */\r
751     toString(): string;\r
752     /** Returns a date as a string value. */\r
753     toDateString(): string;\r
754     /** Returns a time as a string value. */\r
755     toTimeString(): string;\r
756     /** Returns a value as a string value appropriate to the host environment's current locale. */\r
757     toLocaleString(): string;\r
758     /** Returns a date as a string value appropriate to the host environment's current locale. */\r
759     toLocaleDateString(): string;\r
760     /** Returns a time as a string value appropriate to the host environment's current locale. */\r
761     toLocaleTimeString(): string;\r
762     /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */\r
763     valueOf(): number;\r
764     /** Gets the time value in milliseconds. */\r
765     getTime(): number;\r
766     /** Gets the year, using local time. */\r
767     getFullYear(): number;\r
768     /** Gets the year using Universal Coordinated Time (UTC). */\r
769     getUTCFullYear(): number;\r
770     /** Gets the month, using local time. */\r
771     getMonth(): number;\r
772     /** Gets the month of a Date object using Universal Coordinated Time (UTC). */\r
773     getUTCMonth(): number;\r
774     /** Gets the day-of-the-month, using local time. */\r
775     getDate(): number;\r
776     /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */\r
777     getUTCDate(): number;\r
778     /** Gets the day of the week, using local time. */\r
779     getDay(): number;\r
780     /** Gets the day of the week using Universal Coordinated Time (UTC). */\r
781     getUTCDay(): number;\r
782     /** Gets the hours in a date, using local time. */\r
783     getHours(): number;\r
784     /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */\r
785     getUTCHours(): number;\r
786     /** Gets the minutes of a Date object, using local time. */\r
787     getMinutes(): number;\r
788     /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */\r
789     getUTCMinutes(): number;\r
790     /** Gets the seconds of a Date object, using local time. */\r
791     getSeconds(): number;\r
792     /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */\r
793     getUTCSeconds(): number;\r
794     /** Gets the milliseconds of a Date, using local time. */\r
795     getMilliseconds(): number;\r
796     /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */\r
797     getUTCMilliseconds(): number;\r
798     /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */\r
799     getTimezoneOffset(): number;\r
800     /**\r
801      * Sets the date and time value in the Date object.\r
802      * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.\r
803      */\r
804     setTime(time: number): number;\r
805     /**\r
806      * Sets the milliseconds value in the Date object using local time.\r
807      * @param ms A numeric value equal to the millisecond value.\r
808      */\r
809     setMilliseconds(ms: number): number;\r
810     /**\r
811      * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).\r
812      * @param ms A numeric value equal to the millisecond value.\r
813      */\r
814     setUTCMilliseconds(ms: number): number;\r
815 \r
816     /**\r
817      * Sets the seconds value in the Date object using local time.\r
818      * @param sec A numeric value equal to the seconds value.\r
819      * @param ms A numeric value equal to the milliseconds value.\r
820      */\r
821     setSeconds(sec: number, ms?: number): number;\r
822     /**\r
823      * Sets the seconds value in the Date object using Universal Coordinated Time (UTC).\r
824      * @param sec A numeric value equal to the seconds value.\r
825      * @param ms A numeric value equal to the milliseconds value.\r
826      */\r
827     setUTCSeconds(sec: number, ms?: number): number;\r
828     /**\r
829      * Sets the minutes value in the Date object using local time.\r
830      * @param min A numeric value equal to the minutes value.\r
831      * @param sec A numeric value equal to the seconds value.\r
832      * @param ms A numeric value equal to the milliseconds value.\r
833      */\r
834     setMinutes(min: number, sec?: number, ms?: number): number;\r
835     /**\r
836      * Sets the minutes value in the Date object using Universal Coordinated Time (UTC).\r
837      * @param min A numeric value equal to the minutes value.\r
838      * @param sec A numeric value equal to the seconds value.\r
839      * @param ms A numeric value equal to the milliseconds value.\r
840      */\r
841     setUTCMinutes(min: number, sec?: number, ms?: number): number;\r
842     /**\r
843      * Sets the hour value in the Date object using local time.\r
844      * @param hours A numeric value equal to the hours value.\r
845      * @param min A numeric value equal to the minutes value.\r
846      * @param sec A numeric value equal to the seconds value.\r
847      * @param ms A numeric value equal to the milliseconds value.\r
848      */\r
849     setHours(hours: number, min?: number, sec?: number, ms?: number): number;\r
850     /**\r
851      * Sets the hours value in the Date object using Universal Coordinated Time (UTC).\r
852      * @param hours A numeric value equal to the hours value.\r
853      * @param min A numeric value equal to the minutes value.\r
854      * @param sec A numeric value equal to the seconds value.\r
855      * @param ms A numeric value equal to the milliseconds value.\r
856      */\r
857     setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number;\r
858     /**\r
859      * Sets the numeric day-of-the-month value of the Date object using local time.\r
860      * @param date A numeric value equal to the day of the month.\r
861      */\r
862     setDate(date: number): number;\r
863     /**\r
864      * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).\r
865      * @param date A numeric value equal to the day of the month.\r
866      */\r
867     setUTCDate(date: number): number;\r
868     /**\r
869      * Sets the month value in the Date object using local time.\r
870      * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.\r
871      * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.\r
872      */\r
873     setMonth(month: number, date?: number): number;\r
874     /**\r
875      * Sets the month value in the Date object using Universal Coordinated Time (UTC).\r
876      * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.\r
877      * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.\r
878      */\r
879     setUTCMonth(month: number, date?: number): number;\r
880     /**\r
881      * Sets the year of the Date object using local time.\r
882      * @param year A numeric value for the year.\r
883      * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.\r
884      * @param date A numeric value equal for the day of the month.\r
885      */\r
886     setFullYear(year: number, month?: number, date?: number): number;\r
887     /**\r
888      * Sets the year value in the Date object using Universal Coordinated Time (UTC).\r
889      * @param year A numeric value equal to the year.\r
890      * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.\r
891      * @param date A numeric value equal to the day of the month.\r
892      */\r
893     setUTCFullYear(year: number, month?: number, date?: number): number;\r
894     /** Returns a date converted to a string using Universal Coordinated Time (UTC). */\r
895     toUTCString(): string;\r
896     /** Returns a date as a string value in ISO format. */\r
897     toISOString(): string;\r
898     /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */\r
899     toJSON(key?: any): string;\r
900 }\r
901 \r
902 interface DateConstructor {\r
903     new(): Date;\r
904     new(value: number | string): Date;\r
905     new(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;\r
906     (): string;\r
907     readonly prototype: Date;\r
908     /**\r
909      * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.\r
910      * @param s A date string\r
911      */\r
912     parse(s: string): number;\r
913     /**\r
914      * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.\r
915      * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.\r
916      * @param month The month as a number between 0 and 11 (January to December).\r
917      * @param date The date as a number between 1 and 31.\r
918      * @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.\r
919      * @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.\r
920      * @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.\r
921      * @param ms A number from 0 to 999 that specifies the milliseconds.\r
922      */\r
923     UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;\r
924     now(): number;\r
925 }\r
926 \r
927 declare var Date: DateConstructor;\r
928 \r
929 interface RegExpMatchArray extends Array<string> {\r
930     index?: number;\r
931     input?: string;\r
932 }\r
933 \r
934 interface RegExpExecArray extends Array<string> {\r
935     index: number;\r
936     input: string;\r
937 }\r
938 \r
939 interface RegExp {\r
940     /**\r
941      * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search.\r
942      * @param string The String object or string literal on which to perform the search.\r
943      */\r
944     exec(string: string): RegExpExecArray | null;\r
945 \r
946     /**\r
947      * Returns a Boolean value that indicates whether or not a pattern exists in a searched string.\r
948      * @param string String on which to perform the search.\r
949      */\r
950     test(string: string): boolean;\r
951 \r
952     /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */\r
953     readonly source: string;\r
954 \r
955     /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */\r
956     readonly global: boolean;\r
957 \r
958     /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */\r
959     readonly ignoreCase: boolean;\r
960 \r
961     /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */\r
962     readonly multiline: boolean;\r
963 \r
964     lastIndex: number;\r
965 \r
966     // Non-standard extensions\r
967     /** @deprecated A legacy feature for browser compatibility */\r
968     compile(pattern: string, flags?: string): this;\r
969 }\r
970 \r
971 interface RegExpConstructor {\r
972     new(pattern: RegExp | string): RegExp;\r
973     new(pattern: string, flags?: string): RegExp;\r
974     (pattern: RegExp | string): RegExp;\r
975     (pattern: string, flags?: string): RegExp;\r
976     readonly prototype: RegExp;\r
977 \r
978     // Non-standard extensions\r
979     /** @deprecated A legacy feature for browser compatibility */\r
980     $1: string;\r
981     /** @deprecated A legacy feature for browser compatibility */\r
982     $2: string;\r
983     /** @deprecated A legacy feature for browser compatibility */\r
984     $3: string;\r
985     /** @deprecated A legacy feature for browser compatibility */\r
986     $4: string;\r
987     /** @deprecated A legacy feature for browser compatibility */\r
988     $5: string;\r
989     /** @deprecated A legacy feature for browser compatibility */\r
990     $6: string;\r
991     /** @deprecated A legacy feature for browser compatibility */\r
992     $7: string;\r
993     /** @deprecated A legacy feature for browser compatibility */\r
994     $8: string;\r
995     /** @deprecated A legacy feature for browser compatibility */\r
996     $9: string;\r
997     /** @deprecated A legacy feature for browser compatibility */\r
998     input: string;\r
999     /** @deprecated A legacy feature for browser compatibility */\r
1000     $_: string;\r
1001     /** @deprecated A legacy feature for browser compatibility */\r
1002     lastMatch: string;\r
1003     /** @deprecated A legacy feature for browser compatibility */\r
1004     "$&": string;\r
1005     /** @deprecated A legacy feature for browser compatibility */\r
1006     lastParen: string;\r
1007     /** @deprecated A legacy feature for browser compatibility */\r
1008     "$+": string;\r
1009     /** @deprecated A legacy feature for browser compatibility */\r
1010     leftContext: string;\r
1011     /** @deprecated A legacy feature for browser compatibility */\r
1012     "$`": string;\r
1013     /** @deprecated A legacy feature for browser compatibility */\r
1014     rightContext: string;\r
1015     /** @deprecated A legacy feature for browser compatibility */\r
1016     "$'": string;\r
1017 }\r
1018 \r
1019 declare var RegExp: RegExpConstructor;\r
1020 \r
1021 interface Error {\r
1022     name: string;\r
1023     message: string;\r
1024     stack?: string;\r
1025 }\r
1026 \r
1027 interface ErrorConstructor {\r
1028     new(message?: string): Error;\r
1029     (message?: string): Error;\r
1030     readonly prototype: Error;\r
1031 }\r
1032 \r
1033 declare var Error: ErrorConstructor;\r
1034 \r
1035 interface EvalError extends Error {\r
1036 }\r
1037 \r
1038 interface EvalErrorConstructor extends ErrorConstructor {\r
1039     new(message?: string): EvalError;\r
1040     (message?: string): EvalError;\r
1041     readonly prototype: EvalError;\r
1042 }\r
1043 \r
1044 declare var EvalError: EvalErrorConstructor;\r
1045 \r
1046 interface RangeError extends Error {\r
1047 }\r
1048 \r
1049 interface RangeErrorConstructor extends ErrorConstructor {\r
1050     new(message?: string): RangeError;\r
1051     (message?: string): RangeError;\r
1052     readonly prototype: RangeError;\r
1053 }\r
1054 \r
1055 declare var RangeError: RangeErrorConstructor;\r
1056 \r
1057 interface ReferenceError extends Error {\r
1058 }\r
1059 \r
1060 interface ReferenceErrorConstructor extends ErrorConstructor {\r
1061     new(message?: string): ReferenceError;\r
1062     (message?: string): ReferenceError;\r
1063     readonly prototype: ReferenceError;\r
1064 }\r
1065 \r
1066 declare var ReferenceError: ReferenceErrorConstructor;\r
1067 \r
1068 interface SyntaxError extends Error {\r
1069 }\r
1070 \r
1071 interface SyntaxErrorConstructor extends ErrorConstructor {\r
1072     new(message?: string): SyntaxError;\r
1073     (message?: string): SyntaxError;\r
1074     readonly prototype: SyntaxError;\r
1075 }\r
1076 \r
1077 declare var SyntaxError: SyntaxErrorConstructor;\r
1078 \r
1079 interface TypeError extends Error {\r
1080 }\r
1081 \r
1082 interface TypeErrorConstructor extends ErrorConstructor {\r
1083     new(message?: string): TypeError;\r
1084     (message?: string): TypeError;\r
1085     readonly prototype: TypeError;\r
1086 }\r
1087 \r
1088 declare var TypeError: TypeErrorConstructor;\r
1089 \r
1090 interface URIError extends Error {\r
1091 }\r
1092 \r
1093 interface URIErrorConstructor extends ErrorConstructor {\r
1094     new(message?: string): URIError;\r
1095     (message?: string): URIError;\r
1096     readonly prototype: URIError;\r
1097 }\r
1098 \r
1099 declare var URIError: URIErrorConstructor;\r
1100 \r
1101 interface JSON {\r
1102     /**\r
1103      * Converts a JavaScript Object Notation (JSON) string into an object.\r
1104      * @param text A valid JSON string.\r
1105      * @param reviver A function that transforms the results. This function is called for each member of the object.\r
1106      * If a member contains nested objects, the nested objects are transformed before the parent object is.\r
1107      */\r
1108     parse(text: string, reviver?: (this: any, key: string, value: any) => any): any;\r
1109     /**\r
1110      * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.\r
1111      * @param value A JavaScript value, usually an object or array, to be converted.\r
1112      * @param replacer A function that transforms the results.\r
1113      * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.\r
1114      */\r
1115     stringify(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;\r
1116     /**\r
1117      * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.\r
1118      * @param value A JavaScript value, usually an object or array, to be converted.\r
1119      * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified.\r
1120      * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.\r
1121      */\r
1122     stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;\r
1123 }\r
1124 \r
1125 /**\r
1126  * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.\r
1127  */\r
1128 declare var JSON: JSON;\r
1129 \r
1130 \r
1131 /////////////////////////////\r
1132 /// ECMAScript Array API (specially handled by compiler)\r
1133 /////////////////////////////\r
1134 \r
1135 interface ReadonlyArray<T> {\r
1136     /**\r
1137      * Gets the length of the array. This is a number one higher than the highest element defined in an array.\r
1138      */\r
1139     readonly length: number;\r
1140     /**\r
1141      * Returns a string representation of an array.\r
1142      */\r
1143     toString(): string;\r
1144     /**\r
1145      * Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.\r
1146      */\r
1147     toLocaleString(): string;\r
1148     /**\r
1149      * Combines two or more arrays.\r
1150      * @param items Additional items to add to the end of array1.\r
1151      */\r
1152     concat(...items: ConcatArray<T>[]): T[];\r
1153     /**\r
1154      * Combines two or more arrays.\r
1155      * @param items Additional items to add to the end of array1.\r
1156      */\r
1157     concat(...items: (T | ConcatArray<T>)[]): T[];\r
1158     /**\r
1159      * Adds all the elements of an array separated by the specified separator string.\r
1160      * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.\r
1161      */\r
1162     join(separator?: string): string;\r
1163     /**\r
1164      * Returns a section of an array.\r
1165      * @param start The beginning of the specified portion of the array.\r
1166      * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.\r
1167      */\r
1168     slice(start?: number, end?: number): T[];\r
1169     /**\r
1170      * Returns the index of the first occurrence of a value in an array.\r
1171      * @param searchElement The value to locate in the array.\r
1172      * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\r
1173      */\r
1174     indexOf(searchElement: T, fromIndex?: number): number;\r
1175     /**\r
1176      * Returns the index of the last occurrence of a specified value in an array.\r
1177      * @param searchElement The value to locate in the array.\r
1178      * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.\r
1179      */\r
1180     lastIndexOf(searchElement: T, fromIndex?: number): number;\r
1181     /**\r
1182      * Determines whether all the members of an array satisfy the specified test.\r
1183      * @param predicate A function that accepts up to three arguments. The every method calls\r
1184      * the predicate function for each element in the array until the predicate returns a value\r
1185      * which is coercible to the Boolean value false, or until the end of the array.\r
1186      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
1187      * If thisArg is omitted, undefined is used as the this value.\r
1188      */\r
1189     every<S extends T>(predicate: (value: T, index: number, array: readonly T[]) => value is S, thisArg?: any): this is readonly S[];\r
1190     /**\r
1191      * Determines whether all the members of an array satisfy the specified test.\r
1192      * @param predicate A function that accepts up to three arguments. The every method calls\r
1193      * the predicate function for each element in the array until the predicate returns a value\r
1194      * which is coercible to the Boolean value false, or until the end of the array.\r
1195      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
1196      * If thisArg is omitted, undefined is used as the this value.\r
1197      */\r
1198     every(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): boolean;\r
1199     /**\r
1200      * Determines whether the specified callback function returns true for any element of an array.\r
1201      * @param predicate A function that accepts up to three arguments. The some method calls\r
1202      * the predicate function for each element in the array until the predicate returns a value\r
1203      * which is coercible to the Boolean value true, or until the end of the array.\r
1204      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
1205      * If thisArg is omitted, undefined is used as the this value.\r
1206      */\r
1207     some(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): boolean;\r
1208     /**\r
1209      * Performs the specified action for each element in an array.\r
1210      * @param callbackfn  A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.\r
1211      * @param thisArg  An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\r
1212      */\r
1213     forEach(callbackfn: (value: T, index: number, array: readonly T[]) => void, thisArg?: any): void;\r
1214     /**\r
1215      * Calls a defined callback function on each element of an array, and returns an array that contains the results.\r
1216      * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\r
1217      * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\r
1218      */\r
1219     map<U>(callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: any): U[];\r
1220     /**\r
1221      * Returns the elements of an array that meet the condition specified in a callback function.\r
1222      * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.\r
1223      * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.\r
1224      */\r
1225     filter<S extends T>(predicate: (value: T, index: number, array: readonly T[]) => value is S, thisArg?: any): S[];\r
1226     /**\r
1227      * Returns the elements of an array that meet the condition specified in a callback function.\r
1228      * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.\r
1229      * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.\r
1230      */\r
1231     filter(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): T[];\r
1232     /**\r
1233      * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\r
1234      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\r
1235      * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\r
1236      */\r
1237     reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T): T;\r
1238     reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T;\r
1239     /**\r
1240      * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\r
1241      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\r
1242      * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\r
1243      */\r
1244     reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U, initialValue: U): U;\r
1245     /**\r
1246      * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\r
1247      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\r
1248      * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\r
1249      */\r
1250     reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T): T;\r
1251     reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T;\r
1252     /**\r
1253      * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\r
1254      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\r
1255      * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\r
1256      */\r
1257     reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U, initialValue: U): U;\r
1258 \r
1259     readonly [n: number]: T;\r
1260 }\r
1261 \r
1262 interface ConcatArray<T> {\r
1263     readonly length: number;\r
1264     readonly [n: number]: T;\r
1265     join(separator?: string): string;\r
1266     slice(start?: number, end?: number): T[];\r
1267 }\r
1268 \r
1269 interface Array<T> {\r
1270     /**\r
1271      * Gets or sets the length of the array. This is a number one higher than the highest index in the array.\r
1272      */\r
1273     length: number;\r
1274     /**\r
1275      * Returns a string representation of an array.\r
1276      */\r
1277     toString(): string;\r
1278     /**\r
1279      * Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.\r
1280      */\r
1281     toLocaleString(): string;\r
1282     /**\r
1283      * Removes the last element from an array and returns it.\r
1284      * If the array is empty, undefined is returned and the array is not modified.\r
1285      */\r
1286     pop(): T | undefined;\r
1287     /**\r
1288      * Appends new elements to the end of an array, and returns the new length of the array.\r
1289      * @param items New elements to add to the array.\r
1290      */\r
1291     push(...items: T[]): number;\r
1292     /**\r
1293      * Combines two or more arrays.\r
1294      * This method returns a new array without modifying any existing arrays.\r
1295      * @param items Additional arrays and/or items to add to the end of the array.\r
1296      */\r
1297     concat(...items: ConcatArray<T>[]): T[];\r
1298     /**\r
1299      * Combines two or more arrays.\r
1300      * This method returns a new array without modifying any existing arrays.\r
1301      * @param items Additional arrays and/or items to add to the end of the array.\r
1302      */\r
1303     concat(...items: (T | ConcatArray<T>)[]): T[];\r
1304     /**\r
1305      * Adds all the elements of an array into a string, separated by the specified separator string.\r
1306      * @param separator A string used to separate one element of the array from the next in the resulting string. If omitted, the array elements are separated with a comma.\r
1307      */\r
1308     join(separator?: string): string;\r
1309     /**\r
1310      * Reverses the elements in an array in place.\r
1311      * This method mutates the array and returns a reference to the same array.\r
1312      */\r
1313     reverse(): T[];\r
1314     /**\r
1315      * Removes the first element from an array and returns it.\r
1316      * If the array is empty, undefined is returned and the array is not modified.\r
1317      */\r
1318     shift(): T | undefined;\r
1319     /**\r
1320      * Returns a copy of a section of an array.\r
1321      * For both start and end, a negative index can be used to indicate an offset from the end of the array.\r
1322      * For example, -2 refers to the second to last element of the array.\r
1323      * @param start The beginning index of the specified portion of the array.\r
1324      * If start is undefined, then the slice begins at index 0.\r
1325      * @param end The end index of the specified portion of the array. This is exclusive of the element at the index 'end'.\r
1326      * If end is undefined, then the slice extends to the end of the array.\r
1327      */\r
1328     slice(start?: number, end?: number): T[];\r
1329     /**\r
1330      * Sorts an array in place.\r
1331      * This method mutates the array and returns a reference to the same array.\r
1332      * @param compareFn Function used to determine the order of the elements. It is expected to return\r
1333      * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive\r
1334      * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\r
1335      * ```ts\r
1336      * [11,2,22,1].sort((a, b) => a - b)\r
1337      * ```\r
1338      */\r
1339     sort(compareFn?: (a: T, b: T) => number): this;\r
1340     /**\r
1341      * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.\r
1342      * @param start The zero-based location in the array from which to start removing elements.\r
1343      * @param deleteCount The number of elements to remove.\r
1344      * @returns An array containing the elements that were deleted.\r
1345      */\r
1346     splice(start: number, deleteCount?: number): T[];\r
1347     /**\r
1348      * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.\r
1349      * @param start The zero-based location in the array from which to start removing elements.\r
1350      * @param deleteCount The number of elements to remove.\r
1351      * @param items Elements to insert into the array in place of the deleted elements.\r
1352      * @returns An array containing the elements that were deleted.\r
1353      */\r
1354     splice(start: number, deleteCount: number, ...items: T[]): T[];\r
1355     /**\r
1356      * Inserts new elements at the start of an array, and returns the new length of the array.\r
1357      * @param items Elements to insert at the start of the array.\r
1358      */\r
1359     unshift(...items: T[]): number;\r
1360     /**\r
1361      * Returns the index of the first occurrence of a value in an array, or -1 if it is not present.\r
1362      * @param searchElement The value to locate in the array.\r
1363      * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\r
1364      */\r
1365     indexOf(searchElement: T, fromIndex?: number): number;\r
1366     /**\r
1367      * Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present.\r
1368      * @param searchElement The value to locate in the array.\r
1369      * @param fromIndex The array index at which to begin searching backward. If fromIndex is omitted, the search starts at the last index in the array.\r
1370      */\r
1371     lastIndexOf(searchElement: T, fromIndex?: number): number;\r
1372     /**\r
1373      * Determines whether all the members of an array satisfy the specified test.\r
1374      * @param predicate A function that accepts up to three arguments. The every method calls\r
1375      * the predicate function for each element in the array until the predicate returns a value\r
1376      * which is coercible to the Boolean value false, or until the end of the array.\r
1377      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
1378      * If thisArg is omitted, undefined is used as the this value.\r
1379      */\r
1380     every<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): this is S[];\r
1381     /**\r
1382      * Determines whether all the members of an array satisfy the specified test.\r
1383      * @param predicate A function that accepts up to three arguments. The every method calls\r
1384      * the predicate function for each element in the array until the predicate returns a value\r
1385      * which is coercible to the Boolean value false, or until the end of the array.\r
1386      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
1387      * If thisArg is omitted, undefined is used as the this value.\r
1388      */\r
1389     every(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;\r
1390     /**\r
1391      * Determines whether the specified callback function returns true for any element of an array.\r
1392      * @param predicate A function that accepts up to three arguments. The some method calls\r
1393      * the predicate function for each element in the array until the predicate returns a value\r
1394      * which is coercible to the Boolean value true, or until the end of the array.\r
1395      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
1396      * If thisArg is omitted, undefined is used as the this value.\r
1397      */\r
1398     some(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;\r
1399     /**\r
1400      * Performs the specified action for each element in an array.\r
1401      * @param callbackfn  A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.\r
1402      * @param thisArg  An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\r
1403      */\r
1404     forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;\r
1405     /**\r
1406      * Calls a defined callback function on each element of an array, and returns an array that contains the results.\r
1407      * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\r
1408      * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\r
1409      */\r
1410     map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];\r
1411     /**\r
1412      * Returns the elements of an array that meet the condition specified in a callback function.\r
1413      * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.\r
1414      * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.\r
1415      */\r
1416     filter<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[];\r
1417     /**\r
1418      * Returns the elements of an array that meet the condition specified in a callback function.\r
1419      * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.\r
1420      * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.\r
1421      */\r
1422     filter(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[];\r
1423     /**\r
1424      * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\r
1425      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\r
1426      * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\r
1427      */\r
1428     reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;\r
1429     reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;\r
1430     /**\r
1431      * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\r
1432      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\r
1433      * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\r
1434      */\r
1435     reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;\r
1436     /**\r
1437      * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\r
1438      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\r
1439      * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\r
1440      */\r
1441     reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;\r
1442     reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;\r
1443     /**\r
1444      * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\r
1445      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\r
1446      * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\r
1447      */\r
1448     reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;\r
1449 \r
1450     [n: number]: T;\r
1451 }\r
1452 \r
1453 interface ArrayConstructor {\r
1454     new(arrayLength?: number): any[];\r
1455     new <T>(arrayLength: number): T[];\r
1456     new <T>(...items: T[]): T[];\r
1457     (arrayLength?: number): any[];\r
1458     <T>(arrayLength: number): T[];\r
1459     <T>(...items: T[]): T[];\r
1460     isArray(arg: any): arg is any[];\r
1461     readonly prototype: any[];\r
1462 }\r
1463 \r
1464 declare var Array: ArrayConstructor;\r
1465 \r
1466 interface TypedPropertyDescriptor<T> {\r
1467     enumerable?: boolean;\r
1468     configurable?: boolean;\r
1469     writable?: boolean;\r
1470     value?: T;\r
1471     get?: () => T;\r
1472     set?: (value: T) => void;\r
1473 }\r
1474 \r
1475 declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;\r
1476 declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;\r
1477 declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;\r
1478 declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;\r
1479 \r
1480 declare type PromiseConstructorLike = new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void) => PromiseLike<T>;\r
1481 \r
1482 interface PromiseLike<T> {\r
1483     /**\r
1484      * Attaches callbacks for the resolution and/or rejection of the Promise.\r
1485      * @param onfulfilled The callback to execute when the Promise is resolved.\r
1486      * @param onrejected The callback to execute when the Promise is rejected.\r
1487      * @returns A Promise for the completion of which ever callback is executed.\r
1488      */\r
1489     then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): PromiseLike<TResult1 | TResult2>;\r
1490 }\r
1491 \r
1492 /**\r
1493  * Represents the completion of an asynchronous operation\r
1494  */\r
1495 interface Promise<T> {\r
1496     /**\r
1497      * Attaches callbacks for the resolution and/or rejection of the Promise.\r
1498      * @param onfulfilled The callback to execute when the Promise is resolved.\r
1499      * @param onrejected The callback to execute when the Promise is rejected.\r
1500      * @returns A Promise for the completion of which ever callback is executed.\r
1501      */\r
1502     then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;\r
1503 \r
1504     /**\r
1505      * Attaches a callback for only the rejection of the Promise.\r
1506      * @param onrejected The callback to execute when the Promise is rejected.\r
1507      * @returns A Promise for the completion of the callback.\r
1508      */\r
1509     catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;\r
1510 }\r
1511 \r
1512 /**\r
1513  * Recursively unwraps the "awaited type" of a type. Non-promise "thenables" should resolve to `never`. This emulates the behavior of `await`.\r
1514  */\r
1515 type Awaited<T> =\r
1516     T extends null | undefined ? T : // special case for `null | undefined` when not in `--strictNullChecks` mode\r
1517         T extends object & { then(onfulfilled: infer F): any } ? // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped\r
1518             F extends ((value: infer V) => any) ? // if the argument to `then` is callable, extracts the argument\r
1519                 Awaited<V> : // recursively unwrap the value\r
1520                 never : // the argument to `then` was not callable\r
1521         T; // non-object or non-thenable\r
1522 \r
1523 interface ArrayLike<T> {\r
1524     readonly length: number;\r
1525     readonly [n: number]: T;\r
1526 }\r
1527 \r
1528 /**\r
1529  * Make all properties in T optional\r
1530  */\r
1531 type Partial<T> = {\r
1532     [P in keyof T]?: T[P];\r
1533 };\r
1534 \r
1535 /**\r
1536  * Make all properties in T required\r
1537  */\r
1538 type Required<T> = {\r
1539     [P in keyof T]-?: T[P];\r
1540 };\r
1541 \r
1542 /**\r
1543  * Make all properties in T readonly\r
1544  */\r
1545 type Readonly<T> = {\r
1546     readonly [P in keyof T]: T[P];\r
1547 };\r
1548 \r
1549 /**\r
1550  * From T, pick a set of properties whose keys are in the union K\r
1551  */\r
1552 type Pick<T, K extends keyof T> = {\r
1553     [P in K]: T[P];\r
1554 };\r
1555 \r
1556 /**\r
1557  * Construct a type with a set of properties K of type T\r
1558  */\r
1559 type Record<K extends keyof any, T> = {\r
1560     [P in K]: T;\r
1561 };\r
1562 \r
1563 /**\r
1564  * Exclude from T those types that are assignable to U\r
1565  */\r
1566 type Exclude<T, U> = T extends U ? never : T;\r
1567 \r
1568 /**\r
1569  * Extract from T those types that are assignable to U\r
1570  */\r
1571 type Extract<T, U> = T extends U ? T : never;\r
1572 \r
1573 /**\r
1574  * Construct a type with the properties of T except for those in type K.\r
1575  */\r
1576 type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;\r
1577 \r
1578 /**\r
1579  * Exclude null and undefined from T\r
1580  */\r
1581 type NonNullable<T> = T extends null | undefined ? never : T;\r
1582 \r
1583 /**\r
1584  * Obtain the parameters of a function type in a tuple\r
1585  */\r
1586 type Parameters<T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never;\r
1587 \r
1588 /**\r
1589  * Obtain the parameters of a constructor function type in a tuple\r
1590  */\r
1591 type ConstructorParameters<T extends abstract new (...args: any) => any> = T extends abstract new (...args: infer P) => any ? P : never;\r
1592 \r
1593 /**\r
1594  * Obtain the return type of a function type\r
1595  */\r
1596 type ReturnType<T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any;\r
1597 \r
1598 /**\r
1599  * Obtain the return type of a constructor function type\r
1600  */\r
1601 type InstanceType<T extends abstract new (...args: any) => any> = T extends abstract new (...args: any) => infer R ? R : any;\r
1602 \r
1603 /**\r
1604  * Convert string literal type to uppercase\r
1605  */\r
1606 type Uppercase<S extends string> = intrinsic;\r
1607 \r
1608 /**\r
1609  * Convert string literal type to lowercase\r
1610  */\r
1611 type Lowercase<S extends string> = intrinsic;\r
1612 \r
1613 /**\r
1614  * Convert first character of string literal type to uppercase\r
1615  */\r
1616 type Capitalize<S extends string> = intrinsic;\r
1617 \r
1618 /**\r
1619  * Convert first character of string literal type to lowercase\r
1620  */\r
1621 type Uncapitalize<S extends string> = intrinsic;\r
1622 \r
1623 /**\r
1624  * Marker for contextual 'this' type\r
1625  */\r
1626 interface ThisType<T> { }\r
1627 \r
1628 /**\r
1629  * Represents a raw buffer of binary data, which is used to store data for the\r
1630  * different typed arrays. ArrayBuffers cannot be read from or written to directly,\r
1631  * but can be passed to a typed array or DataView Object to interpret the raw\r
1632  * buffer as needed.\r
1633  */\r
1634 interface ArrayBuffer {\r
1635     /**\r
1636      * Read-only. The length of the ArrayBuffer (in bytes).\r
1637      */\r
1638     readonly byteLength: number;\r
1639 \r
1640     /**\r
1641      * Returns a section of an ArrayBuffer.\r
1642      */\r
1643     slice(begin: number, end?: number): ArrayBuffer;\r
1644 }\r
1645 \r
1646 /**\r
1647  * Allowed ArrayBuffer types for the buffer of an ArrayBufferView and related Typed Arrays.\r
1648  */\r
1649 interface ArrayBufferTypes {\r
1650     ArrayBuffer: ArrayBuffer;\r
1651 }\r
1652 type ArrayBufferLike = ArrayBufferTypes[keyof ArrayBufferTypes];\r
1653 \r
1654 interface ArrayBufferConstructor {\r
1655     readonly prototype: ArrayBuffer;\r
1656     new(byteLength: number): ArrayBuffer;\r
1657     isView(arg: any): arg is ArrayBufferView;\r
1658 }\r
1659 declare var ArrayBuffer: ArrayBufferConstructor;\r
1660 \r
1661 interface ArrayBufferView {\r
1662     /**\r
1663      * The ArrayBuffer instance referenced by the array.\r
1664      */\r
1665     buffer: ArrayBufferLike;\r
1666 \r
1667     /**\r
1668      * The length in bytes of the array.\r
1669      */\r
1670     byteLength: number;\r
1671 \r
1672     /**\r
1673      * The offset in bytes of the array.\r
1674      */\r
1675     byteOffset: number;\r
1676 }\r
1677 \r
1678 interface DataView {\r
1679     readonly buffer: ArrayBuffer;\r
1680     readonly byteLength: number;\r
1681     readonly byteOffset: number;\r
1682     /**\r
1683      * Gets the Float32 value at the specified byte offset from the start of the view. There is\r
1684      * no alignment constraint; multi-byte values may be fetched from any offset.\r
1685      * @param byteOffset The place in the buffer at which the value should be retrieved.\r
1686      */\r
1687     getFloat32(byteOffset: number, littleEndian?: boolean): number;\r
1688 \r
1689     /**\r
1690      * Gets the Float64 value at the specified byte offset from the start of the view. There is\r
1691      * no alignment constraint; multi-byte values may be fetched from any offset.\r
1692      * @param byteOffset The place in the buffer at which the value should be retrieved.\r
1693      */\r
1694     getFloat64(byteOffset: number, littleEndian?: boolean): number;\r
1695 \r
1696     /**\r
1697      * Gets the Int8 value at the specified byte offset from the start of the view. There is\r
1698      * no alignment constraint; multi-byte values may be fetched from any offset.\r
1699      * @param byteOffset The place in the buffer at which the value should be retrieved.\r
1700      */\r
1701     getInt8(byteOffset: number): number;\r
1702 \r
1703     /**\r
1704      * Gets the Int16 value at the specified byte offset from the start of the view. There is\r
1705      * no alignment constraint; multi-byte values may be fetched from any offset.\r
1706      * @param byteOffset The place in the buffer at which the value should be retrieved.\r
1707      */\r
1708     getInt16(byteOffset: number, littleEndian?: boolean): number;\r
1709     /**\r
1710      * Gets the Int32 value at the specified byte offset from the start of the view. There is\r
1711      * no alignment constraint; multi-byte values may be fetched from any offset.\r
1712      * @param byteOffset The place in the buffer at which the value should be retrieved.\r
1713      */\r
1714     getInt32(byteOffset: number, littleEndian?: boolean): number;\r
1715 \r
1716     /**\r
1717      * Gets the Uint8 value at the specified byte offset from the start of the view. There is\r
1718      * no alignment constraint; multi-byte values may be fetched from any offset.\r
1719      * @param byteOffset The place in the buffer at which the value should be retrieved.\r
1720      */\r
1721     getUint8(byteOffset: number): number;\r
1722 \r
1723     /**\r
1724      * Gets the Uint16 value at the specified byte offset from the start of the view. There is\r
1725      * no alignment constraint; multi-byte values may be fetched from any offset.\r
1726      * @param byteOffset The place in the buffer at which the value should be retrieved.\r
1727      */\r
1728     getUint16(byteOffset: number, littleEndian?: boolean): number;\r
1729 \r
1730     /**\r
1731      * Gets the Uint32 value at the specified byte offset from the start of the view. There is\r
1732      * no alignment constraint; multi-byte values may be fetched from any offset.\r
1733      * @param byteOffset The place in the buffer at which the value should be retrieved.\r
1734      */\r
1735     getUint32(byteOffset: number, littleEndian?: boolean): number;\r
1736 \r
1737     /**\r
1738      * Stores an Float32 value at the specified byte offset from the start of the view.\r
1739      * @param byteOffset The place in the buffer at which the value should be set.\r
1740      * @param value The value to set.\r
1741      * @param littleEndian If false or undefined, a big-endian value should be written,\r
1742      * otherwise a little-endian value should be written.\r
1743      */\r
1744     setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;\r
1745 \r
1746     /**\r
1747      * Stores an Float64 value at the specified byte offset from the start of the view.\r
1748      * @param byteOffset The place in the buffer at which the value should be set.\r
1749      * @param value The value to set.\r
1750      * @param littleEndian If false or undefined, a big-endian value should be written,\r
1751      * otherwise a little-endian value should be written.\r
1752      */\r
1753     setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;\r
1754 \r
1755     /**\r
1756      * Stores an Int8 value at the specified byte offset from the start of the view.\r
1757      * @param byteOffset The place in the buffer at which the value should be set.\r
1758      * @param value The value to set.\r
1759      */\r
1760     setInt8(byteOffset: number, value: number): void;\r
1761 \r
1762     /**\r
1763      * Stores an Int16 value at the specified byte offset from the start of the view.\r
1764      * @param byteOffset The place in the buffer at which the value should be set.\r
1765      * @param value The value to set.\r
1766      * @param littleEndian If false or undefined, a big-endian value should be written,\r
1767      * otherwise a little-endian value should be written.\r
1768      */\r
1769     setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;\r
1770 \r
1771     /**\r
1772      * Stores an Int32 value at the specified byte offset from the start of the view.\r
1773      * @param byteOffset The place in the buffer at which the value should be set.\r
1774      * @param value The value to set.\r
1775      * @param littleEndian If false or undefined, a big-endian value should be written,\r
1776      * otherwise a little-endian value should be written.\r
1777      */\r
1778     setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;\r
1779 \r
1780     /**\r
1781      * Stores an Uint8 value at the specified byte offset from the start of the view.\r
1782      * @param byteOffset The place in the buffer at which the value should be set.\r
1783      * @param value The value to set.\r
1784      */\r
1785     setUint8(byteOffset: number, value: number): void;\r
1786 \r
1787     /**\r
1788      * Stores an Uint16 value at the specified byte offset from the start of the view.\r
1789      * @param byteOffset The place in the buffer at which the value should be set.\r
1790      * @param value The value to set.\r
1791      * @param littleEndian If false or undefined, a big-endian value should be written,\r
1792      * otherwise a little-endian value should be written.\r
1793      */\r
1794     setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;\r
1795 \r
1796     /**\r
1797      * Stores an Uint32 value at the specified byte offset from the start of the view.\r
1798      * @param byteOffset The place in the buffer at which the value should be set.\r
1799      * @param value The value to set.\r
1800      * @param littleEndian If false or undefined, a big-endian value should be written,\r
1801      * otherwise a little-endian value should be written.\r
1802      */\r
1803     setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;\r
1804 }\r
1805 \r
1806 interface DataViewConstructor {\r
1807     readonly prototype: DataView;\r
1808     new(buffer: ArrayBufferLike, byteOffset?: number, byteLength?: number): DataView;\r
1809 }\r
1810 declare var DataView: DataViewConstructor;\r
1811 \r
1812 /**\r
1813  * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested\r
1814  * number of bytes could not be allocated an exception is raised.\r
1815  */\r
1816 interface Int8Array {\r
1817     /**\r
1818      * The size in bytes of each element in the array.\r
1819      */\r
1820     readonly BYTES_PER_ELEMENT: number;\r
1821 \r
1822     /**\r
1823      * The ArrayBuffer instance referenced by the array.\r
1824      */\r
1825     readonly buffer: ArrayBufferLike;\r
1826 \r
1827     /**\r
1828      * The length in bytes of the array.\r
1829      */\r
1830     readonly byteLength: number;\r
1831 \r
1832     /**\r
1833      * The offset in bytes of the array.\r
1834      */\r
1835     readonly byteOffset: number;\r
1836 \r
1837     /**\r
1838      * Returns the this object after copying a section of the array identified by start and end\r
1839      * to the same array starting at position target\r
1840      * @param target If target is negative, it is treated as length+target where length is the\r
1841      * length of the array.\r
1842      * @param start If start is negative, it is treated as length+start. If end is negative, it\r
1843      * is treated as length+end.\r
1844      * @param end If not specified, length of the this object is used as its default value.\r
1845      */\r
1846     copyWithin(target: number, start: number, end?: number): this;\r
1847 \r
1848     /**\r
1849      * Determines whether all the members of an array satisfy the specified test.\r
1850      * @param predicate A function that accepts up to three arguments. The every method calls\r
1851      * the predicate function for each element in the array until the predicate returns a value\r
1852      * which is coercible to the Boolean value false, or until the end of the array.\r
1853      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
1854      * If thisArg is omitted, undefined is used as the this value.\r
1855      */\r
1856     every(predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): boolean;\r
1857 \r
1858     /**\r
1859      * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array\r
1860      * @param value value to fill array section with\r
1861      * @param start index to start filling the array at. If start is negative, it is treated as\r
1862      * length+start where length is the length of the array.\r
1863      * @param end index to stop filling the array at. If end is negative, it is treated as\r
1864      * length+end.\r
1865      */\r
1866     fill(value: number, start?: number, end?: number): this;\r
1867 \r
1868     /**\r
1869      * Returns the elements of an array that meet the condition specified in a callback function.\r
1870      * @param predicate A function that accepts up to three arguments. The filter method calls\r
1871      * the predicate function one time for each element in the array.\r
1872      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
1873      * If thisArg is omitted, undefined is used as the this value.\r
1874      */\r
1875     filter(predicate: (value: number, index: number, array: Int8Array) => any, thisArg?: any): Int8Array;\r
1876 \r
1877     /**\r
1878      * Returns the value of the first element in the array where predicate is true, and undefined\r
1879      * otherwise.\r
1880      * @param predicate find calls predicate once for each element of the array, in ascending\r
1881      * order, until it finds one where predicate returns true. If such an element is found, find\r
1882      * immediately returns that element value. Otherwise, find returns undefined.\r
1883      * @param thisArg If provided, it will be used as the this value for each invocation of\r
1884      * predicate. If it is not provided, undefined is used instead.\r
1885      */\r
1886     find(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number | undefined;\r
1887 \r
1888     /**\r
1889      * Returns the index of the first element in the array where predicate is true, and -1\r
1890      * otherwise.\r
1891      * @param predicate find calls predicate once for each element of the array, in ascending\r
1892      * order, until it finds one where predicate returns true. If such an element is found,\r
1893      * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\r
1894      * @param thisArg If provided, it will be used as the this value for each invocation of\r
1895      * predicate. If it is not provided, undefined is used instead.\r
1896      */\r
1897     findIndex(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number;\r
1898 \r
1899     /**\r
1900      * Performs the specified action for each element in an array.\r
1901      * @param callbackfn  A function that accepts up to three arguments. forEach calls the\r
1902      * callbackfn function one time for each element in the array.\r
1903      * @param thisArg  An object to which the this keyword can refer in the callbackfn function.\r
1904      * If thisArg is omitted, undefined is used as the this value.\r
1905      */\r
1906     forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void;\r
1907 \r
1908     /**\r
1909      * Returns the index of the first occurrence of a value in an array.\r
1910      * @param searchElement The value to locate in the array.\r
1911      * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\r
1912      *  search starts at index 0.\r
1913      */\r
1914     indexOf(searchElement: number, fromIndex?: number): number;\r
1915 \r
1916     /**\r
1917      * Adds all the elements of an array separated by the specified separator string.\r
1918      * @param separator A string used to separate one element of an array from the next in the\r
1919      * resulting String. If omitted, the array elements are separated with a comma.\r
1920      */\r
1921     join(separator?: string): string;\r
1922 \r
1923     /**\r
1924      * Returns the index of the last occurrence of a value in an array.\r
1925      * @param searchElement The value to locate in the array.\r
1926      * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\r
1927      * search starts at index 0.\r
1928      */\r
1929     lastIndexOf(searchElement: number, fromIndex?: number): number;\r
1930 \r
1931     /**\r
1932      * The length of the array.\r
1933      */\r
1934     readonly length: number;\r
1935 \r
1936     /**\r
1937      * Calls a defined callback function on each element of an array, and returns an array that\r
1938      * contains the results.\r
1939      * @param callbackfn A function that accepts up to three arguments. The map method calls the\r
1940      * callbackfn function one time for each element in the array.\r
1941      * @param thisArg An object to which the this keyword can refer in the callbackfn function.\r
1942      * If thisArg is omitted, undefined is used as the this value.\r
1943      */\r
1944     map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array;\r
1945 \r
1946     /**\r
1947      * Calls the specified callback function for all the elements in an array. The return value of\r
1948      * the callback function is the accumulated result, and is provided as an argument in the next\r
1949      * call to the callback function.\r
1950      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\r
1951      * callbackfn function one time for each element in the array.\r
1952      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
1953      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
1954      * instead of an array value.\r
1955      */\r
1956     reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;\r
1957     reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;\r
1958 \r
1959     /**\r
1960      * Calls the specified callback function for all the elements in an array. The return value of\r
1961      * the callback function is the accumulated result, and is provided as an argument in the next\r
1962      * call to the callback function.\r
1963      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\r
1964      * callbackfn function one time for each element in the array.\r
1965      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
1966      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
1967      * instead of an array value.\r
1968      */\r
1969     reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;\r
1970 \r
1971     /**\r
1972      * Calls the specified callback function for all the elements in an array, in descending order.\r
1973      * The return value of the callback function is the accumulated result, and is provided as an\r
1974      * argument in the next call to the callback function.\r
1975      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\r
1976      * the callbackfn function one time for each element in the array.\r
1977      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
1978      * the accumulation. The first call to the callbackfn function provides this value as an\r
1979      * argument instead of an array value.\r
1980      */\r
1981     reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;\r
1982     reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;\r
1983 \r
1984     /**\r
1985      * Calls the specified callback function for all the elements in an array, in descending order.\r
1986      * The return value of the callback function is the accumulated result, and is provided as an\r
1987      * argument in the next call to the callback function.\r
1988      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\r
1989      * the callbackfn function one time for each element in the array.\r
1990      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
1991      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
1992      * instead of an array value.\r
1993      */\r
1994     reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;\r
1995 \r
1996     /**\r
1997      * Reverses the elements in an Array.\r
1998      */\r
1999     reverse(): Int8Array;\r
2000 \r
2001     /**\r
2002      * Sets a value or an array of values.\r
2003      * @param array A typed or untyped array of values to set.\r
2004      * @param offset The index in the current array at which the values are to be written.\r
2005      */\r
2006     set(array: ArrayLike<number>, offset?: number): void;\r
2007 \r
2008     /**\r
2009      * Returns a section of an array.\r
2010      * @param start The beginning of the specified portion of the array.\r
2011      * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.\r
2012      */\r
2013     slice(start?: number, end?: number): Int8Array;\r
2014 \r
2015     /**\r
2016      * Determines whether the specified callback function returns true for any element of an array.\r
2017      * @param predicate A function that accepts up to three arguments. The some method calls\r
2018      * the predicate function for each element in the array until the predicate returns a value\r
2019      * which is coercible to the Boolean value true, or until the end of the array.\r
2020      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
2021      * If thisArg is omitted, undefined is used as the this value.\r
2022      */\r
2023     some(predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): boolean;\r
2024 \r
2025     /**\r
2026      * Sorts an array.\r
2027      * @param compareFn Function used to determine the order of the elements. It is expected to return\r
2028      * a negative value if first argument is less than second argument, zero if they're equal and a positive\r
2029      * value otherwise. If omitted, the elements are sorted in ascending order.\r
2030      * ```ts\r
2031      * [11,2,22,1].sort((a, b) => a - b)\r
2032      * ```\r
2033      */\r
2034     sort(compareFn?: (a: number, b: number) => number): this;\r
2035 \r
2036     /**\r
2037      * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements\r
2038      * at begin, inclusive, up to end, exclusive.\r
2039      * @param begin The index of the beginning of the array.\r
2040      * @param end The index of the end of the array.\r
2041      */\r
2042     subarray(begin?: number, end?: number): Int8Array;\r
2043 \r
2044     /**\r
2045      * Converts a number to a string by using the current locale.\r
2046      */\r
2047     toLocaleString(): string;\r
2048 \r
2049     /**\r
2050      * Returns a string representation of an array.\r
2051      */\r
2052     toString(): string;\r
2053 \r
2054     /** Returns the primitive value of the specified object. */\r
2055     valueOf(): Int8Array;\r
2056 \r
2057     [index: number]: number;\r
2058 }\r
2059 interface Int8ArrayConstructor {\r
2060     readonly prototype: Int8Array;\r
2061     new(length: number): Int8Array;\r
2062     new(array: ArrayLike<number> | ArrayBufferLike): Int8Array;\r
2063     new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int8Array;\r
2064 \r
2065     /**\r
2066      * The size in bytes of each element in the array.\r
2067      */\r
2068     readonly BYTES_PER_ELEMENT: number;\r
2069 \r
2070     /**\r
2071      * Returns a new array from a set of elements.\r
2072      * @param items A set of elements to include in the new array object.\r
2073      */\r
2074     of(...items: number[]): Int8Array;\r
2075 \r
2076     /**\r
2077      * Creates an array from an array-like or iterable object.\r
2078      * @param arrayLike An array-like or iterable object to convert to an array.\r
2079      */\r
2080     from(arrayLike: ArrayLike<number>): Int8Array;\r
2081 \r
2082     /**\r
2083      * Creates an array from an array-like or iterable object.\r
2084      * @param arrayLike An array-like or iterable object to convert to an array.\r
2085      * @param mapfn A mapping function to call on every element of the array.\r
2086      * @param thisArg Value of 'this' used to invoke the mapfn.\r
2087      */\r
2088     from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array;\r
2089 \r
2090 \r
2091 }\r
2092 declare var Int8Array: Int8ArrayConstructor;\r
2093 \r
2094 /**\r
2095  * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the\r
2096  * requested number of bytes could not be allocated an exception is raised.\r
2097  */\r
2098 interface Uint8Array {\r
2099     /**\r
2100      * The size in bytes of each element in the array.\r
2101      */\r
2102     readonly BYTES_PER_ELEMENT: number;\r
2103 \r
2104     /**\r
2105      * The ArrayBuffer instance referenced by the array.\r
2106      */\r
2107     readonly buffer: ArrayBufferLike;\r
2108 \r
2109     /**\r
2110      * The length in bytes of the array.\r
2111      */\r
2112     readonly byteLength: number;\r
2113 \r
2114     /**\r
2115      * The offset in bytes of the array.\r
2116      */\r
2117     readonly byteOffset: number;\r
2118 \r
2119     /**\r
2120      * Returns the this object after copying a section of the array identified by start and end\r
2121      * to the same array starting at position target\r
2122      * @param target If target is negative, it is treated as length+target where length is the\r
2123      * length of the array.\r
2124      * @param start If start is negative, it is treated as length+start. If end is negative, it\r
2125      * is treated as length+end.\r
2126      * @param end If not specified, length of the this object is used as its default value.\r
2127      */\r
2128     copyWithin(target: number, start: number, end?: number): this;\r
2129 \r
2130     /**\r
2131      * Determines whether all the members of an array satisfy the specified test.\r
2132      * @param predicate A function that accepts up to three arguments. The every method calls\r
2133      * the predicate function for each element in the array until the predicate returns a value\r
2134      * which is coercible to the Boolean value false, or until the end of the array.\r
2135      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
2136      * If thisArg is omitted, undefined is used as the this value.\r
2137      */\r
2138     every(predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): boolean;\r
2139 \r
2140     /**\r
2141      * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array\r
2142      * @param value value to fill array section with\r
2143      * @param start index to start filling the array at. If start is negative, it is treated as\r
2144      * length+start where length is the length of the array.\r
2145      * @param end index to stop filling the array at. If end is negative, it is treated as\r
2146      * length+end.\r
2147      */\r
2148     fill(value: number, start?: number, end?: number): this;\r
2149 \r
2150     /**\r
2151      * Returns the elements of an array that meet the condition specified in a callback function.\r
2152      * @param predicate A function that accepts up to three arguments. The filter method calls\r
2153      * the predicate function one time for each element in the array.\r
2154      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
2155      * If thisArg is omitted, undefined is used as the this value.\r
2156      */\r
2157     filter(predicate: (value: number, index: number, array: Uint8Array) => any, thisArg?: any): Uint8Array;\r
2158 \r
2159     /**\r
2160      * Returns the value of the first element in the array where predicate is true, and undefined\r
2161      * otherwise.\r
2162      * @param predicate find calls predicate once for each element of the array, in ascending\r
2163      * order, until it finds one where predicate returns true. If such an element is found, find\r
2164      * immediately returns that element value. Otherwise, find returns undefined.\r
2165      * @param thisArg If provided, it will be used as the this value for each invocation of\r
2166      * predicate. If it is not provided, undefined is used instead.\r
2167      */\r
2168     find(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number | undefined;\r
2169 \r
2170     /**\r
2171      * Returns the index of the first element in the array where predicate is true, and -1\r
2172      * otherwise.\r
2173      * @param predicate find calls predicate once for each element of the array, in ascending\r
2174      * order, until it finds one where predicate returns true. If such an element is found,\r
2175      * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\r
2176      * @param thisArg If provided, it will be used as the this value for each invocation of\r
2177      * predicate. If it is not provided, undefined is used instead.\r
2178      */\r
2179     findIndex(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number;\r
2180 \r
2181     /**\r
2182      * Performs the specified action for each element in an array.\r
2183      * @param callbackfn  A function that accepts up to three arguments. forEach calls the\r
2184      * callbackfn function one time for each element in the array.\r
2185      * @param thisArg  An object to which the this keyword can refer in the callbackfn function.\r
2186      * If thisArg is omitted, undefined is used as the this value.\r
2187      */\r
2188     forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void;\r
2189 \r
2190     /**\r
2191      * Returns the index of the first occurrence of a value in an array.\r
2192      * @param searchElement The value to locate in the array.\r
2193      * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\r
2194      *  search starts at index 0.\r
2195      */\r
2196     indexOf(searchElement: number, fromIndex?: number): number;\r
2197 \r
2198     /**\r
2199      * Adds all the elements of an array separated by the specified separator string.\r
2200      * @param separator A string used to separate one element of an array from the next in the\r
2201      * resulting String. If omitted, the array elements are separated with a comma.\r
2202      */\r
2203     join(separator?: string): string;\r
2204 \r
2205     /**\r
2206      * Returns the index of the last occurrence of a value in an array.\r
2207      * @param searchElement The value to locate in the array.\r
2208      * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\r
2209      * search starts at index 0.\r
2210      */\r
2211     lastIndexOf(searchElement: number, fromIndex?: number): number;\r
2212 \r
2213     /**\r
2214      * The length of the array.\r
2215      */\r
2216     readonly length: number;\r
2217 \r
2218     /**\r
2219      * Calls a defined callback function on each element of an array, and returns an array that\r
2220      * contains the results.\r
2221      * @param callbackfn A function that accepts up to three arguments. The map method calls the\r
2222      * callbackfn function one time for each element in the array.\r
2223      * @param thisArg An object to which the this keyword can refer in the callbackfn function.\r
2224      * If thisArg is omitted, undefined is used as the this value.\r
2225      */\r
2226     map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array;\r
2227 \r
2228     /**\r
2229      * Calls the specified callback function for all the elements in an array. The return value of\r
2230      * the callback function is the accumulated result, and is provided as an argument in the next\r
2231      * call to the callback function.\r
2232      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\r
2233      * callbackfn function one time for each element in the array.\r
2234      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
2235      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
2236      * instead of an array value.\r
2237      */\r
2238     reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;\r
2239     reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;\r
2240 \r
2241     /**\r
2242      * Calls the specified callback function for all the elements in an array. The return value of\r
2243      * the callback function is the accumulated result, and is provided as an argument in the next\r
2244      * call to the callback function.\r
2245      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\r
2246      * callbackfn function one time for each element in the array.\r
2247      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
2248      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
2249      * instead of an array value.\r
2250      */\r
2251     reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;\r
2252 \r
2253     /**\r
2254      * Calls the specified callback function for all the elements in an array, in descending order.\r
2255      * The return value of the callback function is the accumulated result, and is provided as an\r
2256      * argument in the next call to the callback function.\r
2257      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\r
2258      * the callbackfn function one time for each element in the array.\r
2259      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
2260      * the accumulation. The first call to the callbackfn function provides this value as an\r
2261      * argument instead of an array value.\r
2262      */\r
2263     reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;\r
2264     reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;\r
2265 \r
2266     /**\r
2267      * Calls the specified callback function for all the elements in an array, in descending order.\r
2268      * The return value of the callback function is the accumulated result, and is provided as an\r
2269      * argument in the next call to the callback function.\r
2270      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\r
2271      * the callbackfn function one time for each element in the array.\r
2272      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
2273      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
2274      * instead of an array value.\r
2275      */\r
2276     reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;\r
2277 \r
2278     /**\r
2279      * Reverses the elements in an Array.\r
2280      */\r
2281     reverse(): Uint8Array;\r
2282 \r
2283     /**\r
2284      * Sets a value or an array of values.\r
2285      * @param array A typed or untyped array of values to set.\r
2286      * @param offset The index in the current array at which the values are to be written.\r
2287      */\r
2288     set(array: ArrayLike<number>, offset?: number): void;\r
2289 \r
2290     /**\r
2291      * Returns a section of an array.\r
2292      * @param start The beginning of the specified portion of the array.\r
2293      * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.\r
2294      */\r
2295     slice(start?: number, end?: number): Uint8Array;\r
2296 \r
2297     /**\r
2298      * Determines whether the specified callback function returns true for any element of an array.\r
2299      * @param predicate A function that accepts up to three arguments. The some method calls\r
2300      * the predicate function for each element in the array until the predicate returns a value\r
2301      * which is coercible to the Boolean value true, or until the end of the array.\r
2302      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
2303      * If thisArg is omitted, undefined is used as the this value.\r
2304      */\r
2305     some(predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): boolean;\r
2306 \r
2307     /**\r
2308      * Sorts an array.\r
2309      * @param compareFn Function used to determine the order of the elements. It is expected to return\r
2310      * a negative value if first argument is less than second argument, zero if they're equal and a positive\r
2311      * value otherwise. If omitted, the elements are sorted in ascending order.\r
2312      * ```ts\r
2313      * [11,2,22,1].sort((a, b) => a - b)\r
2314      * ```\r
2315      */\r
2316     sort(compareFn?: (a: number, b: number) => number): this;\r
2317 \r
2318     /**\r
2319      * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements\r
2320      * at begin, inclusive, up to end, exclusive.\r
2321      * @param begin The index of the beginning of the array.\r
2322      * @param end The index of the end of the array.\r
2323      */\r
2324     subarray(begin?: number, end?: number): Uint8Array;\r
2325 \r
2326     /**\r
2327      * Converts a number to a string by using the current locale.\r
2328      */\r
2329     toLocaleString(): string;\r
2330 \r
2331     /**\r
2332      * Returns a string representation of an array.\r
2333      */\r
2334     toString(): string;\r
2335 \r
2336     /** Returns the primitive value of the specified object. */\r
2337     valueOf(): Uint8Array;\r
2338 \r
2339     [index: number]: number;\r
2340 }\r
2341 \r
2342 interface Uint8ArrayConstructor {\r
2343     readonly prototype: Uint8Array;\r
2344     new(length: number): Uint8Array;\r
2345     new(array: ArrayLike<number> | ArrayBufferLike): Uint8Array;\r
2346     new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8Array;\r
2347 \r
2348     /**\r
2349      * The size in bytes of each element in the array.\r
2350      */\r
2351     readonly BYTES_PER_ELEMENT: number;\r
2352 \r
2353     /**\r
2354      * Returns a new array from a set of elements.\r
2355      * @param items A set of elements to include in the new array object.\r
2356      */\r
2357     of(...items: number[]): Uint8Array;\r
2358 \r
2359     /**\r
2360      * Creates an array from an array-like or iterable object.\r
2361      * @param arrayLike An array-like or iterable object to convert to an array.\r
2362      */\r
2363     from(arrayLike: ArrayLike<number>): Uint8Array;\r
2364 \r
2365     /**\r
2366      * Creates an array from an array-like or iterable object.\r
2367      * @param arrayLike An array-like or iterable object to convert to an array.\r
2368      * @param mapfn A mapping function to call on every element of the array.\r
2369      * @param thisArg Value of 'this' used to invoke the mapfn.\r
2370      */\r
2371     from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array;\r
2372 \r
2373 }\r
2374 declare var Uint8Array: Uint8ArrayConstructor;\r
2375 \r
2376 /**\r
2377  * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.\r
2378  * If the requested number of bytes could not be allocated an exception is raised.\r
2379  */\r
2380 interface Uint8ClampedArray {\r
2381     /**\r
2382      * The size in bytes of each element in the array.\r
2383      */\r
2384     readonly BYTES_PER_ELEMENT: number;\r
2385 \r
2386     /**\r
2387      * The ArrayBuffer instance referenced by the array.\r
2388      */\r
2389     readonly buffer: ArrayBufferLike;\r
2390 \r
2391     /**\r
2392      * The length in bytes of the array.\r
2393      */\r
2394     readonly byteLength: number;\r
2395 \r
2396     /**\r
2397      * The offset in bytes of the array.\r
2398      */\r
2399     readonly byteOffset: number;\r
2400 \r
2401     /**\r
2402      * Returns the this object after copying a section of the array identified by start and end\r
2403      * to the same array starting at position target\r
2404      * @param target If target is negative, it is treated as length+target where length is the\r
2405      * length of the array.\r
2406      * @param start If start is negative, it is treated as length+start. If end is negative, it\r
2407      * is treated as length+end.\r
2408      * @param end If not specified, length of the this object is used as its default value.\r
2409      */\r
2410     copyWithin(target: number, start: number, end?: number): this;\r
2411 \r
2412     /**\r
2413      * Determines whether all the members of an array satisfy the specified test.\r
2414      * @param predicate A function that accepts up to three arguments. The every method calls\r
2415      * the predicate function for each element in the array until the predicate returns a value\r
2416      * which is coercible to the Boolean value false, or until the end of the array.\r
2417      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
2418      * If thisArg is omitted, undefined is used as the this value.\r
2419      */\r
2420     every(predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): boolean;\r
2421 \r
2422     /**\r
2423      * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array\r
2424      * @param value value to fill array section with\r
2425      * @param start index to start filling the array at. If start is negative, it is treated as\r
2426      * length+start where length is the length of the array.\r
2427      * @param end index to stop filling the array at. If end is negative, it is treated as\r
2428      * length+end.\r
2429      */\r
2430     fill(value: number, start?: number, end?: number): this;\r
2431 \r
2432     /**\r
2433      * Returns the elements of an array that meet the condition specified in a callback function.\r
2434      * @param predicate A function that accepts up to three arguments. The filter method calls\r
2435      * the predicate function one time for each element in the array.\r
2436      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
2437      * If thisArg is omitted, undefined is used as the this value.\r
2438      */\r
2439     filter(predicate: (value: number, index: number, array: Uint8ClampedArray) => any, thisArg?: any): Uint8ClampedArray;\r
2440 \r
2441     /**\r
2442      * Returns the value of the first element in the array where predicate is true, and undefined\r
2443      * otherwise.\r
2444      * @param predicate find calls predicate once for each element of the array, in ascending\r
2445      * order, until it finds one where predicate returns true. If such an element is found, find\r
2446      * immediately returns that element value. Otherwise, find returns undefined.\r
2447      * @param thisArg If provided, it will be used as the this value for each invocation of\r
2448      * predicate. If it is not provided, undefined is used instead.\r
2449      */\r
2450     find(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number | undefined;\r
2451 \r
2452     /**\r
2453      * Returns the index of the first element in the array where predicate is true, and -1\r
2454      * otherwise.\r
2455      * @param predicate find calls predicate once for each element of the array, in ascending\r
2456      * order, until it finds one where predicate returns true. If such an element is found,\r
2457      * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\r
2458      * @param thisArg If provided, it will be used as the this value for each invocation of\r
2459      * predicate. If it is not provided, undefined is used instead.\r
2460      */\r
2461     findIndex(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number;\r
2462 \r
2463     /**\r
2464      * Performs the specified action for each element in an array.\r
2465      * @param callbackfn  A function that accepts up to three arguments. forEach calls the\r
2466      * callbackfn function one time for each element in the array.\r
2467      * @param thisArg  An object to which the this keyword can refer in the callbackfn function.\r
2468      * If thisArg is omitted, undefined is used as the this value.\r
2469      */\r
2470     forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void;\r
2471 \r
2472     /**\r
2473      * Returns the index of the first occurrence of a value in an array.\r
2474      * @param searchElement The value to locate in the array.\r
2475      * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\r
2476      *  search starts at index 0.\r
2477      */\r
2478     indexOf(searchElement: number, fromIndex?: number): number;\r
2479 \r
2480     /**\r
2481      * Adds all the elements of an array separated by the specified separator string.\r
2482      * @param separator A string used to separate one element of an array from the next in the\r
2483      * resulting String. If omitted, the array elements are separated with a comma.\r
2484      */\r
2485     join(separator?: string): string;\r
2486 \r
2487     /**\r
2488      * Returns the index of the last occurrence of a value in an array.\r
2489      * @param searchElement The value to locate in the array.\r
2490      * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\r
2491      * search starts at index 0.\r
2492      */\r
2493     lastIndexOf(searchElement: number, fromIndex?: number): number;\r
2494 \r
2495     /**\r
2496      * The length of the array.\r
2497      */\r
2498     readonly length: number;\r
2499 \r
2500     /**\r
2501      * Calls a defined callback function on each element of an array, and returns an array that\r
2502      * contains the results.\r
2503      * @param callbackfn A function that accepts up to three arguments. The map method calls the\r
2504      * callbackfn function one time for each element in the array.\r
2505      * @param thisArg An object to which the this keyword can refer in the callbackfn function.\r
2506      * If thisArg is omitted, undefined is used as the this value.\r
2507      */\r
2508     map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray;\r
2509 \r
2510     /**\r
2511      * Calls the specified callback function for all the elements in an array. The return value of\r
2512      * the callback function is the accumulated result, and is provided as an argument in the next\r
2513      * call to the callback function.\r
2514      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\r
2515      * callbackfn function one time for each element in the array.\r
2516      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
2517      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
2518      * instead of an array value.\r
2519      */\r
2520     reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;\r
2521     reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;\r
2522 \r
2523     /**\r
2524      * Calls the specified callback function for all the elements in an array. The return value of\r
2525      * the callback function is the accumulated result, and is provided as an argument in the next\r
2526      * call to the callback function.\r
2527      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\r
2528      * callbackfn function one time for each element in the array.\r
2529      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
2530      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
2531      * instead of an array value.\r
2532      */\r
2533     reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;\r
2534 \r
2535     /**\r
2536      * Calls the specified callback function for all the elements in an array, in descending order.\r
2537      * The return value of the callback function is the accumulated result, and is provided as an\r
2538      * argument in the next call to the callback function.\r
2539      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\r
2540      * the callbackfn function one time for each element in the array.\r
2541      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
2542      * the accumulation. The first call to the callbackfn function provides this value as an\r
2543      * argument instead of an array value.\r
2544      */\r
2545     reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;\r
2546     reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;\r
2547 \r
2548     /**\r
2549      * Calls the specified callback function for all the elements in an array, in descending order.\r
2550      * The return value of the callback function is the accumulated result, and is provided as an\r
2551      * argument in the next call to the callback function.\r
2552      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\r
2553      * the callbackfn function one time for each element in the array.\r
2554      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
2555      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
2556      * instead of an array value.\r
2557      */\r
2558     reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;\r
2559 \r
2560     /**\r
2561      * Reverses the elements in an Array.\r
2562      */\r
2563     reverse(): Uint8ClampedArray;\r
2564 \r
2565     /**\r
2566      * Sets a value or an array of values.\r
2567      * @param array A typed or untyped array of values to set.\r
2568      * @param offset The index in the current array at which the values are to be written.\r
2569      */\r
2570     set(array: ArrayLike<number>, offset?: number): void;\r
2571 \r
2572     /**\r
2573      * Returns a section of an array.\r
2574      * @param start The beginning of the specified portion of the array.\r
2575      * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.\r
2576      */\r
2577     slice(start?: number, end?: number): Uint8ClampedArray;\r
2578 \r
2579     /**\r
2580      * Determines whether the specified callback function returns true for any element of an array.\r
2581      * @param predicate A function that accepts up to three arguments. The some method calls\r
2582      * the predicate function for each element in the array until the predicate returns a value\r
2583      * which is coercible to the Boolean value true, or until the end of the array.\r
2584      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
2585      * If thisArg is omitted, undefined is used as the this value.\r
2586      */\r
2587     some(predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): boolean;\r
2588 \r
2589     /**\r
2590      * Sorts an array.\r
2591      * @param compareFn Function used to determine the order of the elements. It is expected to return\r
2592      * a negative value if first argument is less than second argument, zero if they're equal and a positive\r
2593      * value otherwise. If omitted, the elements are sorted in ascending order.\r
2594      * ```ts\r
2595      * [11,2,22,1].sort((a, b) => a - b)\r
2596      * ```\r
2597      */\r
2598     sort(compareFn?: (a: number, b: number) => number): this;\r
2599 \r
2600     /**\r
2601      * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements\r
2602      * at begin, inclusive, up to end, exclusive.\r
2603      * @param begin The index of the beginning of the array.\r
2604      * @param end The index of the end of the array.\r
2605      */\r
2606     subarray(begin?: number, end?: number): Uint8ClampedArray;\r
2607 \r
2608     /**\r
2609      * Converts a number to a string by using the current locale.\r
2610      */\r
2611     toLocaleString(): string;\r
2612 \r
2613     /**\r
2614      * Returns a string representation of an array.\r
2615      */\r
2616     toString(): string;\r
2617 \r
2618     /** Returns the primitive value of the specified object. */\r
2619     valueOf(): Uint8ClampedArray;\r
2620 \r
2621     [index: number]: number;\r
2622 }\r
2623 \r
2624 interface Uint8ClampedArrayConstructor {\r
2625     readonly prototype: Uint8ClampedArray;\r
2626     new(length: number): Uint8ClampedArray;\r
2627     new(array: ArrayLike<number> | ArrayBufferLike): Uint8ClampedArray;\r
2628     new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8ClampedArray;\r
2629 \r
2630     /**\r
2631      * The size in bytes of each element in the array.\r
2632      */\r
2633     readonly BYTES_PER_ELEMENT: number;\r
2634 \r
2635     /**\r
2636      * Returns a new array from a set of elements.\r
2637      * @param items A set of elements to include in the new array object.\r
2638      */\r
2639     of(...items: number[]): Uint8ClampedArray;\r
2640 \r
2641     /**\r
2642      * Creates an array from an array-like or iterable object.\r
2643      * @param arrayLike An array-like or iterable object to convert to an array.\r
2644      */\r
2645     from(arrayLike: ArrayLike<number>): Uint8ClampedArray;\r
2646 \r
2647     /**\r
2648      * Creates an array from an array-like or iterable object.\r
2649      * @param arrayLike An array-like or iterable object to convert to an array.\r
2650      * @param mapfn A mapping function to call on every element of the array.\r
2651      * @param thisArg Value of 'this' used to invoke the mapfn.\r
2652      */\r
2653     from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray;\r
2654 }\r
2655 declare var Uint8ClampedArray: Uint8ClampedArrayConstructor;\r
2656 \r
2657 /**\r
2658  * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the\r
2659  * requested number of bytes could not be allocated an exception is raised.\r
2660  */\r
2661 interface Int16Array {\r
2662     /**\r
2663      * The size in bytes of each element in the array.\r
2664      */\r
2665     readonly BYTES_PER_ELEMENT: number;\r
2666 \r
2667     /**\r
2668      * The ArrayBuffer instance referenced by the array.\r
2669      */\r
2670     readonly buffer: ArrayBufferLike;\r
2671 \r
2672     /**\r
2673      * The length in bytes of the array.\r
2674      */\r
2675     readonly byteLength: number;\r
2676 \r
2677     /**\r
2678      * The offset in bytes of the array.\r
2679      */\r
2680     readonly byteOffset: number;\r
2681 \r
2682     /**\r
2683      * Returns the this object after copying a section of the array identified by start and end\r
2684      * to the same array starting at position target\r
2685      * @param target If target is negative, it is treated as length+target where length is the\r
2686      * length of the array.\r
2687      * @param start If start is negative, it is treated as length+start. If end is negative, it\r
2688      * is treated as length+end.\r
2689      * @param end If not specified, length of the this object is used as its default value.\r
2690      */\r
2691     copyWithin(target: number, start: number, end?: number): this;\r
2692 \r
2693     /**\r
2694      * Determines whether all the members of an array satisfy the specified test.\r
2695      * @param predicate A function that accepts up to three arguments. The every method calls\r
2696      * the predicate function for each element in the array until the predicate returns a value\r
2697      * which is coercible to the Boolean value false, or until the end of the array.\r
2698      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
2699      * If thisArg is omitted, undefined is used as the this value.\r
2700      */\r
2701     every(predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): boolean;\r
2702 \r
2703     /**\r
2704      * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array\r
2705      * @param value value to fill array section with\r
2706      * @param start index to start filling the array at. If start is negative, it is treated as\r
2707      * length+start where length is the length of the array.\r
2708      * @param end index to stop filling the array at. If end is negative, it is treated as\r
2709      * length+end.\r
2710      */\r
2711     fill(value: number, start?: number, end?: number): this;\r
2712 \r
2713     /**\r
2714      * Returns the elements of an array that meet the condition specified in a callback function.\r
2715      * @param predicate A function that accepts up to three arguments. The filter method calls\r
2716      * the predicate function one time for each element in the array.\r
2717      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
2718      * If thisArg is omitted, undefined is used as the this value.\r
2719      */\r
2720     filter(predicate: (value: number, index: number, array: Int16Array) => any, thisArg?: any): Int16Array;\r
2721 \r
2722     /**\r
2723      * Returns the value of the first element in the array where predicate is true, and undefined\r
2724      * otherwise.\r
2725      * @param predicate find calls predicate once for each element of the array, in ascending\r
2726      * order, until it finds one where predicate returns true. If such an element is found, find\r
2727      * immediately returns that element value. Otherwise, find returns undefined.\r
2728      * @param thisArg If provided, it will be used as the this value for each invocation of\r
2729      * predicate. If it is not provided, undefined is used instead.\r
2730      */\r
2731     find(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number | undefined;\r
2732 \r
2733     /**\r
2734      * Returns the index of the first element in the array where predicate is true, and -1\r
2735      * otherwise.\r
2736      * @param predicate find calls predicate once for each element of the array, in ascending\r
2737      * order, until it finds one where predicate returns true. If such an element is found,\r
2738      * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\r
2739      * @param thisArg If provided, it will be used as the this value for each invocation of\r
2740      * predicate. If it is not provided, undefined is used instead.\r
2741      */\r
2742     findIndex(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number;\r
2743 \r
2744     /**\r
2745      * Performs the specified action for each element in an array.\r
2746      * @param callbackfn  A function that accepts up to three arguments. forEach calls the\r
2747      * callbackfn function one time for each element in the array.\r
2748      * @param thisArg  An object to which the this keyword can refer in the callbackfn function.\r
2749      * If thisArg is omitted, undefined is used as the this value.\r
2750      */\r
2751     forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void;\r
2752     /**\r
2753      * Returns the index of the first occurrence of a value in an array.\r
2754      * @param searchElement The value to locate in the array.\r
2755      * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\r
2756      *  search starts at index 0.\r
2757      */\r
2758     indexOf(searchElement: number, fromIndex?: number): number;\r
2759 \r
2760     /**\r
2761      * Adds all the elements of an array separated by the specified separator string.\r
2762      * @param separator A string used to separate one element of an array from the next in the\r
2763      * resulting String. If omitted, the array elements are separated with a comma.\r
2764      */\r
2765     join(separator?: string): string;\r
2766 \r
2767     /**\r
2768      * Returns the index of the last occurrence of a value in an array.\r
2769      * @param searchElement The value to locate in the array.\r
2770      * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\r
2771      * search starts at index 0.\r
2772      */\r
2773     lastIndexOf(searchElement: number, fromIndex?: number): number;\r
2774 \r
2775     /**\r
2776      * The length of the array.\r
2777      */\r
2778     readonly length: number;\r
2779 \r
2780     /**\r
2781      * Calls a defined callback function on each element of an array, and returns an array that\r
2782      * contains the results.\r
2783      * @param callbackfn A function that accepts up to three arguments. The map method calls the\r
2784      * callbackfn function one time for each element in the array.\r
2785      * @param thisArg An object to which the this keyword can refer in the callbackfn function.\r
2786      * If thisArg is omitted, undefined is used as the this value.\r
2787      */\r
2788     map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array;\r
2789 \r
2790     /**\r
2791      * Calls the specified callback function for all the elements in an array. The return value of\r
2792      * the callback function is the accumulated result, and is provided as an argument in the next\r
2793      * call to the callback function.\r
2794      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\r
2795      * callbackfn function one time for each element in the array.\r
2796      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
2797      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
2798      * instead of an array value.\r
2799      */\r
2800     reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;\r
2801     reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;\r
2802 \r
2803     /**\r
2804      * Calls the specified callback function for all the elements in an array. The return value of\r
2805      * the callback function is the accumulated result, and is provided as an argument in the next\r
2806      * call to the callback function.\r
2807      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\r
2808      * callbackfn function one time for each element in the array.\r
2809      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
2810      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
2811      * instead of an array value.\r
2812      */\r
2813     reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;\r
2814 \r
2815     /**\r
2816      * Calls the specified callback function for all the elements in an array, in descending order.\r
2817      * The return value of the callback function is the accumulated result, and is provided as an\r
2818      * argument in the next call to the callback function.\r
2819      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\r
2820      * the callbackfn function one time for each element in the array.\r
2821      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
2822      * the accumulation. The first call to the callbackfn function provides this value as an\r
2823      * argument instead of an array value.\r
2824      */\r
2825     reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;\r
2826     reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;\r
2827 \r
2828     /**\r
2829      * Calls the specified callback function for all the elements in an array, in descending order.\r
2830      * The return value of the callback function is the accumulated result, and is provided as an\r
2831      * argument in the next call to the callback function.\r
2832      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\r
2833      * the callbackfn function one time for each element in the array.\r
2834      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
2835      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
2836      * instead of an array value.\r
2837      */\r
2838     reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;\r
2839 \r
2840     /**\r
2841      * Reverses the elements in an Array.\r
2842      */\r
2843     reverse(): Int16Array;\r
2844 \r
2845     /**\r
2846      * Sets a value or an array of values.\r
2847      * @param array A typed or untyped array of values to set.\r
2848      * @param offset The index in the current array at which the values are to be written.\r
2849      */\r
2850     set(array: ArrayLike<number>, offset?: number): void;\r
2851 \r
2852     /**\r
2853      * Returns a section of an array.\r
2854      * @param start The beginning of the specified portion of the array.\r
2855      * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.\r
2856      */\r
2857     slice(start?: number, end?: number): Int16Array;\r
2858 \r
2859     /**\r
2860      * Determines whether the specified callback function returns true for any element of an array.\r
2861      * @param predicate A function that accepts up to three arguments. The some method calls\r
2862      * the predicate function for each element in the array until the predicate returns a value\r
2863      * which is coercible to the Boolean value true, or until the end of the array.\r
2864      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
2865      * If thisArg is omitted, undefined is used as the this value.\r
2866      */\r
2867     some(predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): boolean;\r
2868 \r
2869     /**\r
2870      * Sorts an array.\r
2871      * @param compareFn Function used to determine the order of the elements. It is expected to return\r
2872      * a negative value if first argument is less than second argument, zero if they're equal and a positive\r
2873      * value otherwise. If omitted, the elements are sorted in ascending order.\r
2874      * ```ts\r
2875      * [11,2,22,1].sort((a, b) => a - b)\r
2876      * ```\r
2877      */\r
2878     sort(compareFn?: (a: number, b: number) => number): this;\r
2879 \r
2880     /**\r
2881      * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements\r
2882      * at begin, inclusive, up to end, exclusive.\r
2883      * @param begin The index of the beginning of the array.\r
2884      * @param end The index of the end of the array.\r
2885      */\r
2886     subarray(begin?: number, end?: number): Int16Array;\r
2887 \r
2888     /**\r
2889      * Converts a number to a string by using the current locale.\r
2890      */\r
2891     toLocaleString(): string;\r
2892 \r
2893     /**\r
2894      * Returns a string representation of an array.\r
2895      */\r
2896     toString(): string;\r
2897 \r
2898     /** Returns the primitive value of the specified object. */\r
2899     valueOf(): Int16Array;\r
2900 \r
2901     [index: number]: number;\r
2902 }\r
2903 \r
2904 interface Int16ArrayConstructor {\r
2905     readonly prototype: Int16Array;\r
2906     new(length: number): Int16Array;\r
2907     new(array: ArrayLike<number> | ArrayBufferLike): Int16Array;\r
2908     new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int16Array;\r
2909 \r
2910     /**\r
2911      * The size in bytes of each element in the array.\r
2912      */\r
2913     readonly BYTES_PER_ELEMENT: number;\r
2914 \r
2915     /**\r
2916      * Returns a new array from a set of elements.\r
2917      * @param items A set of elements to include in the new array object.\r
2918      */\r
2919     of(...items: number[]): Int16Array;\r
2920 \r
2921     /**\r
2922      * Creates an array from an array-like or iterable object.\r
2923      * @param arrayLike An array-like or iterable object to convert to an array.\r
2924      */\r
2925     from(arrayLike: ArrayLike<number>): Int16Array;\r
2926 \r
2927     /**\r
2928      * Creates an array from an array-like or iterable object.\r
2929      * @param arrayLike An array-like or iterable object to convert to an array.\r
2930      * @param mapfn A mapping function to call on every element of the array.\r
2931      * @param thisArg Value of 'this' used to invoke the mapfn.\r
2932      */\r
2933     from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array;\r
2934 \r
2935 \r
2936 }\r
2937 declare var Int16Array: Int16ArrayConstructor;\r
2938 \r
2939 /**\r
2940  * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the\r
2941  * requested number of bytes could not be allocated an exception is raised.\r
2942  */\r
2943 interface Uint16Array {\r
2944     /**\r
2945      * The size in bytes of each element in the array.\r
2946      */\r
2947     readonly BYTES_PER_ELEMENT: number;\r
2948 \r
2949     /**\r
2950      * The ArrayBuffer instance referenced by the array.\r
2951      */\r
2952     readonly buffer: ArrayBufferLike;\r
2953 \r
2954     /**\r
2955      * The length in bytes of the array.\r
2956      */\r
2957     readonly byteLength: number;\r
2958 \r
2959     /**\r
2960      * The offset in bytes of the array.\r
2961      */\r
2962     readonly byteOffset: number;\r
2963 \r
2964     /**\r
2965      * Returns the this object after copying a section of the array identified by start and end\r
2966      * to the same array starting at position target\r
2967      * @param target If target is negative, it is treated as length+target where length is the\r
2968      * length of the array.\r
2969      * @param start If start is negative, it is treated as length+start. If end is negative, it\r
2970      * is treated as length+end.\r
2971      * @param end If not specified, length of the this object is used as its default value.\r
2972      */\r
2973     copyWithin(target: number, start: number, end?: number): this;\r
2974 \r
2975     /**\r
2976      * Determines whether all the members of an array satisfy the specified test.\r
2977      * @param predicate A function that accepts up to three arguments. The every method calls\r
2978      * the predicate function for each element in the array until the predicate returns a value\r
2979      * which is coercible to the Boolean value false, or until the end of the array.\r
2980      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
2981      * If thisArg is omitted, undefined is used as the this value.\r
2982      */\r
2983     every(predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): boolean;\r
2984 \r
2985     /**\r
2986      * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array\r
2987      * @param value value to fill array section with\r
2988      * @param start index to start filling the array at. If start is negative, it is treated as\r
2989      * length+start where length is the length of the array.\r
2990      * @param end index to stop filling the array at. If end is negative, it is treated as\r
2991      * length+end.\r
2992      */\r
2993     fill(value: number, start?: number, end?: number): this;\r
2994 \r
2995     /**\r
2996      * Returns the elements of an array that meet the condition specified in a callback function.\r
2997      * @param predicate A function that accepts up to three arguments. The filter method calls\r
2998      * the predicate function one time for each element in the array.\r
2999      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
3000      * If thisArg is omitted, undefined is used as the this value.\r
3001      */\r
3002     filter(predicate: (value: number, index: number, array: Uint16Array) => any, thisArg?: any): Uint16Array;\r
3003 \r
3004     /**\r
3005      * Returns the value of the first element in the array where predicate is true, and undefined\r
3006      * otherwise.\r
3007      * @param predicate find calls predicate once for each element of the array, in ascending\r
3008      * order, until it finds one where predicate returns true. If such an element is found, find\r
3009      * immediately returns that element value. Otherwise, find returns undefined.\r
3010      * @param thisArg If provided, it will be used as the this value for each invocation of\r
3011      * predicate. If it is not provided, undefined is used instead.\r
3012      */\r
3013     find(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number | undefined;\r
3014 \r
3015     /**\r
3016      * Returns the index of the first element in the array where predicate is true, and -1\r
3017      * otherwise.\r
3018      * @param predicate find calls predicate once for each element of the array, in ascending\r
3019      * order, until it finds one where predicate returns true. If such an element is found,\r
3020      * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\r
3021      * @param thisArg If provided, it will be used as the this value for each invocation of\r
3022      * predicate. If it is not provided, undefined is used instead.\r
3023      */\r
3024     findIndex(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number;\r
3025 \r
3026     /**\r
3027      * Performs the specified action for each element in an array.\r
3028      * @param callbackfn  A function that accepts up to three arguments. forEach calls the\r
3029      * callbackfn function one time for each element in the array.\r
3030      * @param thisArg  An object to which the this keyword can refer in the callbackfn function.\r
3031      * If thisArg is omitted, undefined is used as the this value.\r
3032      */\r
3033     forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void;\r
3034 \r
3035     /**\r
3036      * Returns the index of the first occurrence of a value in an array.\r
3037      * @param searchElement The value to locate in the array.\r
3038      * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\r
3039      *  search starts at index 0.\r
3040      */\r
3041     indexOf(searchElement: number, fromIndex?: number): number;\r
3042 \r
3043     /**\r
3044      * Adds all the elements of an array separated by the specified separator string.\r
3045      * @param separator A string used to separate one element of an array from the next in the\r
3046      * resulting String. If omitted, the array elements are separated with a comma.\r
3047      */\r
3048     join(separator?: string): string;\r
3049 \r
3050     /**\r
3051      * Returns the index of the last occurrence of a value in an array.\r
3052      * @param searchElement The value to locate in the array.\r
3053      * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\r
3054      * search starts at index 0.\r
3055      */\r
3056     lastIndexOf(searchElement: number, fromIndex?: number): number;\r
3057 \r
3058     /**\r
3059      * The length of the array.\r
3060      */\r
3061     readonly length: number;\r
3062 \r
3063     /**\r
3064      * Calls a defined callback function on each element of an array, and returns an array that\r
3065      * contains the results.\r
3066      * @param callbackfn A function that accepts up to three arguments. The map method calls the\r
3067      * callbackfn function one time for each element in the array.\r
3068      * @param thisArg An object to which the this keyword can refer in the callbackfn function.\r
3069      * If thisArg is omitted, undefined is used as the this value.\r
3070      */\r
3071     map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array;\r
3072 \r
3073     /**\r
3074      * Calls the specified callback function for all the elements in an array. The return value of\r
3075      * the callback function is the accumulated result, and is provided as an argument in the next\r
3076      * call to the callback function.\r
3077      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\r
3078      * callbackfn function one time for each element in the array.\r
3079      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
3080      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
3081      * instead of an array value.\r
3082      */\r
3083     reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;\r
3084     reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;\r
3085 \r
3086     /**\r
3087      * Calls the specified callback function for all the elements in an array. The return value of\r
3088      * the callback function is the accumulated result, and is provided as an argument in the next\r
3089      * call to the callback function.\r
3090      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\r
3091      * callbackfn function one time for each element in the array.\r
3092      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
3093      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
3094      * instead of an array value.\r
3095      */\r
3096     reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;\r
3097 \r
3098     /**\r
3099      * Calls the specified callback function for all the elements in an array, in descending order.\r
3100      * The return value of the callback function is the accumulated result, and is provided as an\r
3101      * argument in the next call to the callback function.\r
3102      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\r
3103      * the callbackfn function one time for each element in the array.\r
3104      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
3105      * the accumulation. The first call to the callbackfn function provides this value as an\r
3106      * argument instead of an array value.\r
3107      */\r
3108     reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;\r
3109     reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;\r
3110 \r
3111     /**\r
3112      * Calls the specified callback function for all the elements in an array, in descending order.\r
3113      * The return value of the callback function is the accumulated result, and is provided as an\r
3114      * argument in the next call to the callback function.\r
3115      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\r
3116      * the callbackfn function one time for each element in the array.\r
3117      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
3118      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
3119      * instead of an array value.\r
3120      */\r
3121     reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;\r
3122 \r
3123     /**\r
3124      * Reverses the elements in an Array.\r
3125      */\r
3126     reverse(): Uint16Array;\r
3127 \r
3128     /**\r
3129      * Sets a value or an array of values.\r
3130      * @param array A typed or untyped array of values to set.\r
3131      * @param offset The index in the current array at which the values are to be written.\r
3132      */\r
3133     set(array: ArrayLike<number>, offset?: number): void;\r
3134 \r
3135     /**\r
3136      * Returns a section of an array.\r
3137      * @param start The beginning of the specified portion of the array.\r
3138      * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.\r
3139      */\r
3140     slice(start?: number, end?: number): Uint16Array;\r
3141 \r
3142     /**\r
3143      * Determines whether the specified callback function returns true for any element of an array.\r
3144      * @param predicate A function that accepts up to three arguments. The some method calls\r
3145      * the predicate function for each element in the array until the predicate returns a value\r
3146      * which is coercible to the Boolean value true, or until the end of the array.\r
3147      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
3148      * If thisArg is omitted, undefined is used as the this value.\r
3149      */\r
3150     some(predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): boolean;\r
3151 \r
3152     /**\r
3153      * Sorts an array.\r
3154      * @param compareFn Function used to determine the order of the elements. It is expected to return\r
3155      * a negative value if first argument is less than second argument, zero if they're equal and a positive\r
3156      * value otherwise. If omitted, the elements are sorted in ascending order.\r
3157      * ```ts\r
3158      * [11,2,22,1].sort((a, b) => a - b)\r
3159      * ```\r
3160      */\r
3161     sort(compareFn?: (a: number, b: number) => number): this;\r
3162 \r
3163     /**\r
3164      * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements\r
3165      * at begin, inclusive, up to end, exclusive.\r
3166      * @param begin The index of the beginning of the array.\r
3167      * @param end The index of the end of the array.\r
3168      */\r
3169     subarray(begin?: number, end?: number): Uint16Array;\r
3170 \r
3171     /**\r
3172      * Converts a number to a string by using the current locale.\r
3173      */\r
3174     toLocaleString(): string;\r
3175 \r
3176     /**\r
3177      * Returns a string representation of an array.\r
3178      */\r
3179     toString(): string;\r
3180 \r
3181     /** Returns the primitive value of the specified object. */\r
3182     valueOf(): Uint16Array;\r
3183 \r
3184     [index: number]: number;\r
3185 }\r
3186 \r
3187 interface Uint16ArrayConstructor {\r
3188     readonly prototype: Uint16Array;\r
3189     new(length: number): Uint16Array;\r
3190     new(array: ArrayLike<number> | ArrayBufferLike): Uint16Array;\r
3191     new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint16Array;\r
3192 \r
3193     /**\r
3194      * The size in bytes of each element in the array.\r
3195      */\r
3196     readonly BYTES_PER_ELEMENT: number;\r
3197 \r
3198     /**\r
3199      * Returns a new array from a set of elements.\r
3200      * @param items A set of elements to include in the new array object.\r
3201      */\r
3202     of(...items: number[]): Uint16Array;\r
3203 \r
3204     /**\r
3205      * Creates an array from an array-like or iterable object.\r
3206      * @param arrayLike An array-like or iterable object to convert to an array.\r
3207      */\r
3208     from(arrayLike: ArrayLike<number>): Uint16Array;\r
3209 \r
3210     /**\r
3211      * Creates an array from an array-like or iterable object.\r
3212      * @param arrayLike An array-like or iterable object to convert to an array.\r
3213      * @param mapfn A mapping function to call on every element of the array.\r
3214      * @param thisArg Value of 'this' used to invoke the mapfn.\r
3215      */\r
3216     from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array;\r
3217 \r
3218 \r
3219 }\r
3220 declare var Uint16Array: Uint16ArrayConstructor;\r
3221 /**\r
3222  * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the\r
3223  * requested number of bytes could not be allocated an exception is raised.\r
3224  */\r
3225 interface Int32Array {\r
3226     /**\r
3227      * The size in bytes of each element in the array.\r
3228      */\r
3229     readonly BYTES_PER_ELEMENT: number;\r
3230 \r
3231     /**\r
3232      * The ArrayBuffer instance referenced by the array.\r
3233      */\r
3234     readonly buffer: ArrayBufferLike;\r
3235 \r
3236     /**\r
3237      * The length in bytes of the array.\r
3238      */\r
3239     readonly byteLength: number;\r
3240 \r
3241     /**\r
3242      * The offset in bytes of the array.\r
3243      */\r
3244     readonly byteOffset: number;\r
3245 \r
3246     /**\r
3247      * Returns the this object after copying a section of the array identified by start and end\r
3248      * to the same array starting at position target\r
3249      * @param target If target is negative, it is treated as length+target where length is the\r
3250      * length of the array.\r
3251      * @param start If start is negative, it is treated as length+start. If end is negative, it\r
3252      * is treated as length+end.\r
3253      * @param end If not specified, length of the this object is used as its default value.\r
3254      */\r
3255     copyWithin(target: number, start: number, end?: number): this;\r
3256 \r
3257     /**\r
3258      * Determines whether all the members of an array satisfy the specified test.\r
3259      * @param predicate A function that accepts up to three arguments. The every method calls\r
3260      * the predicate function for each element in the array until the predicate returns a value\r
3261      * which is coercible to the Boolean value false, or until the end of the array.\r
3262      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
3263      * If thisArg is omitted, undefined is used as the this value.\r
3264      */\r
3265     every(predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): boolean;\r
3266 \r
3267     /**\r
3268      * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array\r
3269      * @param value value to fill array section with\r
3270      * @param start index to start filling the array at. If start is negative, it is treated as\r
3271      * length+start where length is the length of the array.\r
3272      * @param end index to stop filling the array at. If end is negative, it is treated as\r
3273      * length+end.\r
3274      */\r
3275     fill(value: number, start?: number, end?: number): this;\r
3276 \r
3277     /**\r
3278      * Returns the elements of an array that meet the condition specified in a callback function.\r
3279      * @param predicate A function that accepts up to three arguments. The filter method calls\r
3280      * the predicate function one time for each element in the array.\r
3281      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
3282      * If thisArg is omitted, undefined is used as the this value.\r
3283      */\r
3284     filter(predicate: (value: number, index: number, array: Int32Array) => any, thisArg?: any): Int32Array;\r
3285 \r
3286     /**\r
3287      * Returns the value of the first element in the array where predicate is true, and undefined\r
3288      * otherwise.\r
3289      * @param predicate find calls predicate once for each element of the array, in ascending\r
3290      * order, until it finds one where predicate returns true. If such an element is found, find\r
3291      * immediately returns that element value. Otherwise, find returns undefined.\r
3292      * @param thisArg If provided, it will be used as the this value for each invocation of\r
3293      * predicate. If it is not provided, undefined is used instead.\r
3294      */\r
3295     find(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number | undefined;\r
3296 \r
3297     /**\r
3298      * Returns the index of the first element in the array where predicate is true, and -1\r
3299      * otherwise.\r
3300      * @param predicate find calls predicate once for each element of the array, in ascending\r
3301      * order, until it finds one where predicate returns true. If such an element is found,\r
3302      * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\r
3303      * @param thisArg If provided, it will be used as the this value for each invocation of\r
3304      * predicate. If it is not provided, undefined is used instead.\r
3305      */\r
3306     findIndex(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number;\r
3307 \r
3308     /**\r
3309      * Performs the specified action for each element in an array.\r
3310      * @param callbackfn  A function that accepts up to three arguments. forEach calls the\r
3311      * callbackfn function one time for each element in the array.\r
3312      * @param thisArg  An object to which the this keyword can refer in the callbackfn function.\r
3313      * If thisArg is omitted, undefined is used as the this value.\r
3314      */\r
3315     forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void;\r
3316 \r
3317     /**\r
3318      * Returns the index of the first occurrence of a value in an array.\r
3319      * @param searchElement The value to locate in the array.\r
3320      * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\r
3321      *  search starts at index 0.\r
3322      */\r
3323     indexOf(searchElement: number, fromIndex?: number): number;\r
3324 \r
3325     /**\r
3326      * Adds all the elements of an array separated by the specified separator string.\r
3327      * @param separator A string used to separate one element of an array from the next in the\r
3328      * resulting String. If omitted, the array elements are separated with a comma.\r
3329      */\r
3330     join(separator?: string): string;\r
3331 \r
3332     /**\r
3333      * Returns the index of the last occurrence of a value in an array.\r
3334      * @param searchElement The value to locate in the array.\r
3335      * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\r
3336      * search starts at index 0.\r
3337      */\r
3338     lastIndexOf(searchElement: number, fromIndex?: number): number;\r
3339 \r
3340     /**\r
3341      * The length of the array.\r
3342      */\r
3343     readonly length: number;\r
3344 \r
3345     /**\r
3346      * Calls a defined callback function on each element of an array, and returns an array that\r
3347      * contains the results.\r
3348      * @param callbackfn A function that accepts up to three arguments. The map method calls the\r
3349      * callbackfn function one time for each element in the array.\r
3350      * @param thisArg An object to which the this keyword can refer in the callbackfn function.\r
3351      * If thisArg is omitted, undefined is used as the this value.\r
3352      */\r
3353     map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array;\r
3354 \r
3355     /**\r
3356      * Calls the specified callback function for all the elements in an array. The return value of\r
3357      * the callback function is the accumulated result, and is provided as an argument in the next\r
3358      * call to the callback function.\r
3359      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\r
3360      * callbackfn function one time for each element in the array.\r
3361      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
3362      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
3363      * instead of an array value.\r
3364      */\r
3365     reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;\r
3366     reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;\r
3367 \r
3368     /**\r
3369      * Calls the specified callback function for all the elements in an array. The return value of\r
3370      * the callback function is the accumulated result, and is provided as an argument in the next\r
3371      * call to the callback function.\r
3372      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\r
3373      * callbackfn function one time for each element in the array.\r
3374      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
3375      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
3376      * instead of an array value.\r
3377      */\r
3378     reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;\r
3379 \r
3380     /**\r
3381      * Calls the specified callback function for all the elements in an array, in descending order.\r
3382      * The return value of the callback function is the accumulated result, and is provided as an\r
3383      * argument in the next call to the callback function.\r
3384      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\r
3385      * the callbackfn function one time for each element in the array.\r
3386      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
3387      * the accumulation. The first call to the callbackfn function provides this value as an\r
3388      * argument instead of an array value.\r
3389      */\r
3390     reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;\r
3391     reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;\r
3392 \r
3393     /**\r
3394      * Calls the specified callback function for all the elements in an array, in descending order.\r
3395      * The return value of the callback function is the accumulated result, and is provided as an\r
3396      * argument in the next call to the callback function.\r
3397      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\r
3398      * the callbackfn function one time for each element in the array.\r
3399      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
3400      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
3401      * instead of an array value.\r
3402      */\r
3403     reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;\r
3404 \r
3405     /**\r
3406      * Reverses the elements in an Array.\r
3407      */\r
3408     reverse(): Int32Array;\r
3409 \r
3410     /**\r
3411      * Sets a value or an array of values.\r
3412      * @param array A typed or untyped array of values to set.\r
3413      * @param offset The index in the current array at which the values are to be written.\r
3414      */\r
3415     set(array: ArrayLike<number>, offset?: number): void;\r
3416 \r
3417     /**\r
3418      * Returns a section of an array.\r
3419      * @param start The beginning of the specified portion of the array.\r
3420      * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.\r
3421      */\r
3422     slice(start?: number, end?: number): Int32Array;\r
3423 \r
3424     /**\r
3425      * Determines whether the specified callback function returns true for any element of an array.\r
3426      * @param predicate A function that accepts up to three arguments. The some method calls\r
3427      * the predicate function for each element in the array until the predicate returns a value\r
3428      * which is coercible to the Boolean value true, or until the end of the array.\r
3429      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
3430      * If thisArg is omitted, undefined is used as the this value.\r
3431      */\r
3432     some(predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): boolean;\r
3433 \r
3434     /**\r
3435      * Sorts an array.\r
3436      * @param compareFn Function used to determine the order of the elements. It is expected to return\r
3437      * a negative value if first argument is less than second argument, zero if they're equal and a positive\r
3438      * value otherwise. If omitted, the elements are sorted in ascending order.\r
3439      * ```ts\r
3440      * [11,2,22,1].sort((a, b) => a - b)\r
3441      * ```\r
3442      */\r
3443     sort(compareFn?: (a: number, b: number) => number): this;\r
3444 \r
3445     /**\r
3446      * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements\r
3447      * at begin, inclusive, up to end, exclusive.\r
3448      * @param begin The index of the beginning of the array.\r
3449      * @param end The index of the end of the array.\r
3450      */\r
3451     subarray(begin?: number, end?: number): Int32Array;\r
3452 \r
3453     /**\r
3454      * Converts a number to a string by using the current locale.\r
3455      */\r
3456     toLocaleString(): string;\r
3457 \r
3458     /**\r
3459      * Returns a string representation of an array.\r
3460      */\r
3461     toString(): string;\r
3462 \r
3463     /** Returns the primitive value of the specified object. */\r
3464     valueOf(): Int32Array;\r
3465 \r
3466     [index: number]: number;\r
3467 }\r
3468 \r
3469 interface Int32ArrayConstructor {\r
3470     readonly prototype: Int32Array;\r
3471     new(length: number): Int32Array;\r
3472     new(array: ArrayLike<number> | ArrayBufferLike): Int32Array;\r
3473     new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int32Array;\r
3474 \r
3475     /**\r
3476      * The size in bytes of each element in the array.\r
3477      */\r
3478     readonly BYTES_PER_ELEMENT: number;\r
3479 \r
3480     /**\r
3481      * Returns a new array from a set of elements.\r
3482      * @param items A set of elements to include in the new array object.\r
3483      */\r
3484     of(...items: number[]): Int32Array;\r
3485 \r
3486     /**\r
3487      * Creates an array from an array-like or iterable object.\r
3488      * @param arrayLike An array-like or iterable object to convert to an array.\r
3489      */\r
3490     from(arrayLike: ArrayLike<number>): Int32Array;\r
3491 \r
3492     /**\r
3493      * Creates an array from an array-like or iterable object.\r
3494      * @param arrayLike An array-like or iterable object to convert to an array.\r
3495      * @param mapfn A mapping function to call on every element of the array.\r
3496      * @param thisArg Value of 'this' used to invoke the mapfn.\r
3497      */\r
3498     from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array;\r
3499 \r
3500 }\r
3501 declare var Int32Array: Int32ArrayConstructor;\r
3502 \r
3503 /**\r
3504  * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the\r
3505  * requested number of bytes could not be allocated an exception is raised.\r
3506  */\r
3507 interface Uint32Array {\r
3508     /**\r
3509      * The size in bytes of each element in the array.\r
3510      */\r
3511     readonly BYTES_PER_ELEMENT: number;\r
3512 \r
3513     /**\r
3514      * The ArrayBuffer instance referenced by the array.\r
3515      */\r
3516     readonly buffer: ArrayBufferLike;\r
3517 \r
3518     /**\r
3519      * The length in bytes of the array.\r
3520      */\r
3521     readonly byteLength: number;\r
3522 \r
3523     /**\r
3524      * The offset in bytes of the array.\r
3525      */\r
3526     readonly byteOffset: number;\r
3527 \r
3528     /**\r
3529      * Returns the this object after copying a section of the array identified by start and end\r
3530      * to the same array starting at position target\r
3531      * @param target If target is negative, it is treated as length+target where length is the\r
3532      * length of the array.\r
3533      * @param start If start is negative, it is treated as length+start. If end is negative, it\r
3534      * is treated as length+end.\r
3535      * @param end If not specified, length of the this object is used as its default value.\r
3536      */\r
3537     copyWithin(target: number, start: number, end?: number): this;\r
3538 \r
3539     /**\r
3540      * Determines whether all the members of an array satisfy the specified test.\r
3541      * @param predicate A function that accepts up to three arguments. The every method calls\r
3542      * the predicate function for each element in the array until the predicate returns a value\r
3543      * which is coercible to the Boolean value false, or until the end of the array.\r
3544      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
3545      * If thisArg is omitted, undefined is used as the this value.\r
3546      */\r
3547     every(predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): boolean;\r
3548 \r
3549     /**\r
3550      * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array\r
3551      * @param value value to fill array section with\r
3552      * @param start index to start filling the array at. If start is negative, it is treated as\r
3553      * length+start where length is the length of the array.\r
3554      * @param end index to stop filling the array at. If end is negative, it is treated as\r
3555      * length+end.\r
3556      */\r
3557     fill(value: number, start?: number, end?: number): this;\r
3558 \r
3559     /**\r
3560      * Returns the elements of an array that meet the condition specified in a callback function.\r
3561      * @param predicate A function that accepts up to three arguments. The filter method calls\r
3562      * the predicate function one time for each element in the array.\r
3563      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
3564      * If thisArg is omitted, undefined is used as the this value.\r
3565      */\r
3566     filter(predicate: (value: number, index: number, array: Uint32Array) => any, thisArg?: any): Uint32Array;\r
3567 \r
3568     /**\r
3569      * Returns the value of the first element in the array where predicate is true, and undefined\r
3570      * otherwise.\r
3571      * @param predicate find calls predicate once for each element of the array, in ascending\r
3572      * order, until it finds one where predicate returns true. If such an element is found, find\r
3573      * immediately returns that element value. Otherwise, find returns undefined.\r
3574      * @param thisArg If provided, it will be used as the this value for each invocation of\r
3575      * predicate. If it is not provided, undefined is used instead.\r
3576      */\r
3577     find(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number | undefined;\r
3578 \r
3579     /**\r
3580      * Returns the index of the first element in the array where predicate is true, and -1\r
3581      * otherwise.\r
3582      * @param predicate find calls predicate once for each element of the array, in ascending\r
3583      * order, until it finds one where predicate returns true. If such an element is found,\r
3584      * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\r
3585      * @param thisArg If provided, it will be used as the this value for each invocation of\r
3586      * predicate. If it is not provided, undefined is used instead.\r
3587      */\r
3588     findIndex(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number;\r
3589 \r
3590     /**\r
3591      * Performs the specified action for each element in an array.\r
3592      * @param callbackfn  A function that accepts up to three arguments. forEach calls the\r
3593      * callbackfn function one time for each element in the array.\r
3594      * @param thisArg  An object to which the this keyword can refer in the callbackfn function.\r
3595      * If thisArg is omitted, undefined is used as the this value.\r
3596      */\r
3597     forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void;\r
3598     /**\r
3599      * Returns the index of the first occurrence of a value in an array.\r
3600      * @param searchElement The value to locate in the array.\r
3601      * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\r
3602      *  search starts at index 0.\r
3603      */\r
3604     indexOf(searchElement: number, fromIndex?: number): number;\r
3605 \r
3606     /**\r
3607      * Adds all the elements of an array separated by the specified separator string.\r
3608      * @param separator A string used to separate one element of an array from the next in the\r
3609      * resulting String. If omitted, the array elements are separated with a comma.\r
3610      */\r
3611     join(separator?: string): string;\r
3612 \r
3613     /**\r
3614      * Returns the index of the last occurrence of a value in an array.\r
3615      * @param searchElement The value to locate in the array.\r
3616      * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\r
3617      * search starts at index 0.\r
3618      */\r
3619     lastIndexOf(searchElement: number, fromIndex?: number): number;\r
3620 \r
3621     /**\r
3622      * The length of the array.\r
3623      */\r
3624     readonly length: number;\r
3625 \r
3626     /**\r
3627      * Calls a defined callback function on each element of an array, and returns an array that\r
3628      * contains the results.\r
3629      * @param callbackfn A function that accepts up to three arguments. The map method calls the\r
3630      * callbackfn function one time for each element in the array.\r
3631      * @param thisArg An object to which the this keyword can refer in the callbackfn function.\r
3632      * If thisArg is omitted, undefined is used as the this value.\r
3633      */\r
3634     map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array;\r
3635 \r
3636     /**\r
3637      * Calls the specified callback function for all the elements in an array. The return value of\r
3638      * the callback function is the accumulated result, and is provided as an argument in the next\r
3639      * call to the callback function.\r
3640      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\r
3641      * callbackfn function one time for each element in the array.\r
3642      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
3643      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
3644      * instead of an array value.\r
3645      */\r
3646     reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;\r
3647     reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;\r
3648 \r
3649     /**\r
3650      * Calls the specified callback function for all the elements in an array. The return value of\r
3651      * the callback function is the accumulated result, and is provided as an argument in the next\r
3652      * call to the callback function.\r
3653      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\r
3654      * callbackfn function one time for each element in the array.\r
3655      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
3656      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
3657      * instead of an array value.\r
3658      */\r
3659     reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;\r
3660 \r
3661     /**\r
3662      * Calls the specified callback function for all the elements in an array, in descending order.\r
3663      * The return value of the callback function is the accumulated result, and is provided as an\r
3664      * argument in the next call to the callback function.\r
3665      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\r
3666      * the callbackfn function one time for each element in the array.\r
3667      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
3668      * the accumulation. The first call to the callbackfn function provides this value as an\r
3669      * argument instead of an array value.\r
3670      */\r
3671     reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;\r
3672     reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;\r
3673 \r
3674     /**\r
3675      * Calls the specified callback function for all the elements in an array, in descending order.\r
3676      * The return value of the callback function is the accumulated result, and is provided as an\r
3677      * argument in the next call to the callback function.\r
3678      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\r
3679      * the callbackfn function one time for each element in the array.\r
3680      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
3681      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
3682      * instead of an array value.\r
3683      */\r
3684     reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;\r
3685 \r
3686     /**\r
3687      * Reverses the elements in an Array.\r
3688      */\r
3689     reverse(): Uint32Array;\r
3690 \r
3691     /**\r
3692      * Sets a value or an array of values.\r
3693      * @param array A typed or untyped array of values to set.\r
3694      * @param offset The index in the current array at which the values are to be written.\r
3695      */\r
3696     set(array: ArrayLike<number>, offset?: number): void;\r
3697 \r
3698     /**\r
3699      * Returns a section of an array.\r
3700      * @param start The beginning of the specified portion of the array.\r
3701      * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.\r
3702      */\r
3703     slice(start?: number, end?: number): Uint32Array;\r
3704 \r
3705     /**\r
3706      * Determines whether the specified callback function returns true for any element of an array.\r
3707      * @param predicate A function that accepts up to three arguments. The some method calls\r
3708      * the predicate function for each element in the array until the predicate returns a value\r
3709      * which is coercible to the Boolean value true, or until the end of the array.\r
3710      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
3711      * If thisArg is omitted, undefined is used as the this value.\r
3712      */\r
3713     some(predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): boolean;\r
3714 \r
3715     /**\r
3716      * Sorts an array.\r
3717      * @param compareFn Function used to determine the order of the elements. It is expected to return\r
3718      * a negative value if first argument is less than second argument, zero if they're equal and a positive\r
3719      * value otherwise. If omitted, the elements are sorted in ascending order.\r
3720      * ```ts\r
3721      * [11,2,22,1].sort((a, b) => a - b)\r
3722      * ```\r
3723      */\r
3724     sort(compareFn?: (a: number, b: number) => number): this;\r
3725 \r
3726     /**\r
3727      * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements\r
3728      * at begin, inclusive, up to end, exclusive.\r
3729      * @param begin The index of the beginning of the array.\r
3730      * @param end The index of the end of the array.\r
3731      */\r
3732     subarray(begin?: number, end?: number): Uint32Array;\r
3733 \r
3734     /**\r
3735      * Converts a number to a string by using the current locale.\r
3736      */\r
3737     toLocaleString(): string;\r
3738 \r
3739     /**\r
3740      * Returns a string representation of an array.\r
3741      */\r
3742     toString(): string;\r
3743 \r
3744     /** Returns the primitive value of the specified object. */\r
3745     valueOf(): Uint32Array;\r
3746 \r
3747     [index: number]: number;\r
3748 }\r
3749 \r
3750 interface Uint32ArrayConstructor {\r
3751     readonly prototype: Uint32Array;\r
3752     new(length: number): Uint32Array;\r
3753     new(array: ArrayLike<number> | ArrayBufferLike): Uint32Array;\r
3754     new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint32Array;\r
3755 \r
3756     /**\r
3757      * The size in bytes of each element in the array.\r
3758      */\r
3759     readonly BYTES_PER_ELEMENT: number;\r
3760 \r
3761     /**\r
3762      * Returns a new array from a set of elements.\r
3763      * @param items A set of elements to include in the new array object.\r
3764      */\r
3765     of(...items: number[]): Uint32Array;\r
3766 \r
3767     /**\r
3768      * Creates an array from an array-like or iterable object.\r
3769      * @param arrayLike An array-like or iterable object to convert to an array.\r
3770      */\r
3771     from(arrayLike: ArrayLike<number>): Uint32Array;\r
3772 \r
3773     /**\r
3774      * Creates an array from an array-like or iterable object.\r
3775      * @param arrayLike An array-like or iterable object to convert to an array.\r
3776      * @param mapfn A mapping function to call on every element of the array.\r
3777      * @param thisArg Value of 'this' used to invoke the mapfn.\r
3778      */\r
3779     from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array;\r
3780 \r
3781 }\r
3782 declare var Uint32Array: Uint32ArrayConstructor;\r
3783 \r
3784 /**\r
3785  * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number\r
3786  * of bytes could not be allocated an exception is raised.\r
3787  */\r
3788 interface Float32Array {\r
3789     /**\r
3790      * The size in bytes of each element in the array.\r
3791      */\r
3792     readonly BYTES_PER_ELEMENT: number;\r
3793 \r
3794     /**\r
3795      * The ArrayBuffer instance referenced by the array.\r
3796      */\r
3797     readonly buffer: ArrayBufferLike;\r
3798 \r
3799     /**\r
3800      * The length in bytes of the array.\r
3801      */\r
3802     readonly byteLength: number;\r
3803 \r
3804     /**\r
3805      * The offset in bytes of the array.\r
3806      */\r
3807     readonly byteOffset: number;\r
3808 \r
3809     /**\r
3810      * Returns the this object after copying a section of the array identified by start and end\r
3811      * to the same array starting at position target\r
3812      * @param target If target is negative, it is treated as length+target where length is the\r
3813      * length of the array.\r
3814      * @param start If start is negative, it is treated as length+start. If end is negative, it\r
3815      * is treated as length+end.\r
3816      * @param end If not specified, length of the this object is used as its default value.\r
3817      */\r
3818     copyWithin(target: number, start: number, end?: number): this;\r
3819 \r
3820     /**\r
3821      * Determines whether all the members of an array satisfy the specified test.\r
3822      * @param predicate A function that accepts up to three arguments. The every method calls\r
3823      * the predicate function for each element in the array until the predicate returns a value\r
3824      * which is coercible to the Boolean value false, or until the end of the array.\r
3825      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
3826      * If thisArg is omitted, undefined is used as the this value.\r
3827      */\r
3828     every(predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): boolean;\r
3829 \r
3830     /**\r
3831      * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array\r
3832      * @param value value to fill array section with\r
3833      * @param start index to start filling the array at. If start is negative, it is treated as\r
3834      * length+start where length is the length of the array.\r
3835      * @param end index to stop filling the array at. If end is negative, it is treated as\r
3836      * length+end.\r
3837      */\r
3838     fill(value: number, start?: number, end?: number): this;\r
3839 \r
3840     /**\r
3841      * Returns the elements of an array that meet the condition specified in a callback function.\r
3842      * @param predicate A function that accepts up to three arguments. The filter method calls\r
3843      * the predicate function one time for each element in the array.\r
3844      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
3845      * If thisArg is omitted, undefined is used as the this value.\r
3846      */\r
3847     filter(predicate: (value: number, index: number, array: Float32Array) => any, thisArg?: any): Float32Array;\r
3848 \r
3849     /**\r
3850      * Returns the value of the first element in the array where predicate is true, and undefined\r
3851      * otherwise.\r
3852      * @param predicate find calls predicate once for each element of the array, in ascending\r
3853      * order, until it finds one where predicate returns true. If such an element is found, find\r
3854      * immediately returns that element value. Otherwise, find returns undefined.\r
3855      * @param thisArg If provided, it will be used as the this value for each invocation of\r
3856      * predicate. If it is not provided, undefined is used instead.\r
3857      */\r
3858     find(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number | undefined;\r
3859 \r
3860     /**\r
3861      * Returns the index of the first element in the array where predicate is true, and -1\r
3862      * otherwise.\r
3863      * @param predicate find calls predicate once for each element of the array, in ascending\r
3864      * order, until it finds one where predicate returns true. If such an element is found,\r
3865      * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\r
3866      * @param thisArg If provided, it will be used as the this value for each invocation of\r
3867      * predicate. If it is not provided, undefined is used instead.\r
3868      */\r
3869     findIndex(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number;\r
3870 \r
3871     /**\r
3872      * Performs the specified action for each element in an array.\r
3873      * @param callbackfn  A function that accepts up to three arguments. forEach calls the\r
3874      * callbackfn function one time for each element in the array.\r
3875      * @param thisArg  An object to which the this keyword can refer in the callbackfn function.\r
3876      * If thisArg is omitted, undefined is used as the this value.\r
3877      */\r
3878     forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void;\r
3879 \r
3880     /**\r
3881      * Returns the index of the first occurrence of a value in an array.\r
3882      * @param searchElement The value to locate in the array.\r
3883      * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\r
3884      *  search starts at index 0.\r
3885      */\r
3886     indexOf(searchElement: number, fromIndex?: number): number;\r
3887 \r
3888     /**\r
3889      * Adds all the elements of an array separated by the specified separator string.\r
3890      * @param separator A string used to separate one element of an array from the next in the\r
3891      * resulting String. If omitted, the array elements are separated with a comma.\r
3892      */\r
3893     join(separator?: string): string;\r
3894 \r
3895     /**\r
3896      * Returns the index of the last occurrence of a value in an array.\r
3897      * @param searchElement The value to locate in the array.\r
3898      * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\r
3899      * search starts at index 0.\r
3900      */\r
3901     lastIndexOf(searchElement: number, fromIndex?: number): number;\r
3902 \r
3903     /**\r
3904      * The length of the array.\r
3905      */\r
3906     readonly length: number;\r
3907 \r
3908     /**\r
3909      * Calls a defined callback function on each element of an array, and returns an array that\r
3910      * contains the results.\r
3911      * @param callbackfn A function that accepts up to three arguments. The map method calls the\r
3912      * callbackfn function one time for each element in the array.\r
3913      * @param thisArg An object to which the this keyword can refer in the callbackfn function.\r
3914      * If thisArg is omitted, undefined is used as the this value.\r
3915      */\r
3916     map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array;\r
3917 \r
3918     /**\r
3919      * Calls the specified callback function for all the elements in an array. The return value of\r
3920      * the callback function is the accumulated result, and is provided as an argument in the next\r
3921      * call to the callback function.\r
3922      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\r
3923      * callbackfn function one time for each element in the array.\r
3924      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
3925      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
3926      * instead of an array value.\r
3927      */\r
3928     reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;\r
3929     reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;\r
3930 \r
3931     /**\r
3932      * Calls the specified callback function for all the elements in an array. The return value of\r
3933      * the callback function is the accumulated result, and is provided as an argument in the next\r
3934      * call to the callback function.\r
3935      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\r
3936      * callbackfn function one time for each element in the array.\r
3937      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
3938      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
3939      * instead of an array value.\r
3940      */\r
3941     reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;\r
3942 \r
3943     /**\r
3944      * Calls the specified callback function for all the elements in an array, in descending order.\r
3945      * The return value of the callback function is the accumulated result, and is provided as an\r
3946      * argument in the next call to the callback function.\r
3947      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\r
3948      * the callbackfn function one time for each element in the array.\r
3949      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
3950      * the accumulation. The first call to the callbackfn function provides this value as an\r
3951      * argument instead of an array value.\r
3952      */\r
3953     reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;\r
3954     reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;\r
3955 \r
3956     /**\r
3957      * Calls the specified callback function for all the elements in an array, in descending order.\r
3958      * The return value of the callback function is the accumulated result, and is provided as an\r
3959      * argument in the next call to the callback function.\r
3960      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\r
3961      * the callbackfn function one time for each element in the array.\r
3962      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
3963      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
3964      * instead of an array value.\r
3965      */\r
3966     reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;\r
3967 \r
3968     /**\r
3969      * Reverses the elements in an Array.\r
3970      */\r
3971     reverse(): Float32Array;\r
3972 \r
3973     /**\r
3974      * Sets a value or an array of values.\r
3975      * @param array A typed or untyped array of values to set.\r
3976      * @param offset The index in the current array at which the values are to be written.\r
3977      */\r
3978     set(array: ArrayLike<number>, offset?: number): void;\r
3979 \r
3980     /**\r
3981      * Returns a section of an array.\r
3982      * @param start The beginning of the specified portion of the array.\r
3983      * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.\r
3984      */\r
3985     slice(start?: number, end?: number): Float32Array;\r
3986 \r
3987     /**\r
3988      * Determines whether the specified callback function returns true for any element of an array.\r
3989      * @param predicate A function that accepts up to three arguments. The some method calls\r
3990      * the predicate function for each element in the array until the predicate returns a value\r
3991      * which is coercible to the Boolean value true, or until the end of the array.\r
3992      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
3993      * If thisArg is omitted, undefined is used as the this value.\r
3994      */\r
3995     some(predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): boolean;\r
3996 \r
3997     /**\r
3998      * Sorts an array.\r
3999      * @param compareFn Function used to determine the order of the elements. It is expected to return\r
4000      * a negative value if first argument is less than second argument, zero if they're equal and a positive\r
4001      * value otherwise. If omitted, the elements are sorted in ascending order.\r
4002      * ```ts\r
4003      * [11,2,22,1].sort((a, b) => a - b)\r
4004      * ```\r
4005      */\r
4006     sort(compareFn?: (a: number, b: number) => number): this;\r
4007 \r
4008     /**\r
4009      * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements\r
4010      * at begin, inclusive, up to end, exclusive.\r
4011      * @param begin The index of the beginning of the array.\r
4012      * @param end The index of the end of the array.\r
4013      */\r
4014     subarray(begin?: number, end?: number): Float32Array;\r
4015 \r
4016     /**\r
4017      * Converts a number to a string by using the current locale.\r
4018      */\r
4019     toLocaleString(): string;\r
4020 \r
4021     /**\r
4022      * Returns a string representation of an array.\r
4023      */\r
4024     toString(): string;\r
4025 \r
4026     /** Returns the primitive value of the specified object. */\r
4027     valueOf(): Float32Array;\r
4028 \r
4029     [index: number]: number;\r
4030 }\r
4031 \r
4032 interface Float32ArrayConstructor {\r
4033     readonly prototype: Float32Array;\r
4034     new(length: number): Float32Array;\r
4035     new(array: ArrayLike<number> | ArrayBufferLike): Float32Array;\r
4036     new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Float32Array;\r
4037 \r
4038     /**\r
4039      * The size in bytes of each element in the array.\r
4040      */\r
4041     readonly BYTES_PER_ELEMENT: number;\r
4042 \r
4043     /**\r
4044      * Returns a new array from a set of elements.\r
4045      * @param items A set of elements to include in the new array object.\r
4046      */\r
4047     of(...items: number[]): Float32Array;\r
4048 \r
4049     /**\r
4050      * Creates an array from an array-like or iterable object.\r
4051      * @param arrayLike An array-like or iterable object to convert to an array.\r
4052      */\r
4053     from(arrayLike: ArrayLike<number>): Float32Array;\r
4054 \r
4055     /**\r
4056      * Creates an array from an array-like or iterable object.\r
4057      * @param arrayLike An array-like or iterable object to convert to an array.\r
4058      * @param mapfn A mapping function to call on every element of the array.\r
4059      * @param thisArg Value of 'this' used to invoke the mapfn.\r
4060      */\r
4061     from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array;\r
4062 \r
4063 \r
4064 }\r
4065 declare var Float32Array: Float32ArrayConstructor;\r
4066 \r
4067 /**\r
4068  * A typed array of 64-bit float values. The contents are initialized to 0. If the requested\r
4069  * number of bytes could not be allocated an exception is raised.\r
4070  */\r
4071 interface Float64Array {\r
4072     /**\r
4073      * The size in bytes of each element in the array.\r
4074      */\r
4075     readonly BYTES_PER_ELEMENT: number;\r
4076 \r
4077     /**\r
4078      * The ArrayBuffer instance referenced by the array.\r
4079      */\r
4080     readonly buffer: ArrayBufferLike;\r
4081 \r
4082     /**\r
4083      * The length in bytes of the array.\r
4084      */\r
4085     readonly byteLength: number;\r
4086 \r
4087     /**\r
4088      * The offset in bytes of the array.\r
4089      */\r
4090     readonly byteOffset: number;\r
4091 \r
4092     /**\r
4093      * Returns the this object after copying a section of the array identified by start and end\r
4094      * to the same array starting at position target\r
4095      * @param target If target is negative, it is treated as length+target where length is the\r
4096      * length of the array.\r
4097      * @param start If start is negative, it is treated as length+start. If end is negative, it\r
4098      * is treated as length+end.\r
4099      * @param end If not specified, length of the this object is used as its default value.\r
4100      */\r
4101     copyWithin(target: number, start: number, end?: number): this;\r
4102 \r
4103     /**\r
4104      * Determines whether all the members of an array satisfy the specified test.\r
4105      * @param predicate A function that accepts up to three arguments. The every method calls\r
4106      * the predicate function for each element in the array until the predicate returns a value\r
4107      * which is coercible to the Boolean value false, or until the end of the array.\r
4108      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
4109      * If thisArg is omitted, undefined is used as the this value.\r
4110      */\r
4111     every(predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): boolean;\r
4112 \r
4113     /**\r
4114      * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array\r
4115      * @param value value to fill array section with\r
4116      * @param start index to start filling the array at. If start is negative, it is treated as\r
4117      * length+start where length is the length of the array.\r
4118      * @param end index to stop filling the array at. If end is negative, it is treated as\r
4119      * length+end.\r
4120      */\r
4121     fill(value: number, start?: number, end?: number): this;\r
4122 \r
4123     /**\r
4124      * Returns the elements of an array that meet the condition specified in a callback function.\r
4125      * @param predicate A function that accepts up to three arguments. The filter method calls\r
4126      * the predicate function one time for each element in the array.\r
4127      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
4128      * If thisArg is omitted, undefined is used as the this value.\r
4129      */\r
4130     filter(predicate: (value: number, index: number, array: Float64Array) => any, thisArg?: any): Float64Array;\r
4131 \r
4132     /**\r
4133      * Returns the value of the first element in the array where predicate is true, and undefined\r
4134      * otherwise.\r
4135      * @param predicate find calls predicate once for each element of the array, in ascending\r
4136      * order, until it finds one where predicate returns true. If such an element is found, find\r
4137      * immediately returns that element value. Otherwise, find returns undefined.\r
4138      * @param thisArg If provided, it will be used as the this value for each invocation of\r
4139      * predicate. If it is not provided, undefined is used instead.\r
4140      */\r
4141     find(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number | undefined;\r
4142 \r
4143     /**\r
4144      * Returns the index of the first element in the array where predicate is true, and -1\r
4145      * otherwise.\r
4146      * @param predicate find calls predicate once for each element of the array, in ascending\r
4147      * order, until it finds one where predicate returns true. If such an element is found,\r
4148      * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\r
4149      * @param thisArg If provided, it will be used as the this value for each invocation of\r
4150      * predicate. If it is not provided, undefined is used instead.\r
4151      */\r
4152     findIndex(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number;\r
4153 \r
4154     /**\r
4155      * Performs the specified action for each element in an array.\r
4156      * @param callbackfn  A function that accepts up to three arguments. forEach calls the\r
4157      * callbackfn function one time for each element in the array.\r
4158      * @param thisArg  An object to which the this keyword can refer in the callbackfn function.\r
4159      * If thisArg is omitted, undefined is used as the this value.\r
4160      */\r
4161     forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void;\r
4162 \r
4163     /**\r
4164      * Returns the index of the first occurrence of a value in an array.\r
4165      * @param searchElement The value to locate in the array.\r
4166      * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\r
4167      *  search starts at index 0.\r
4168      */\r
4169     indexOf(searchElement: number, fromIndex?: number): number;\r
4170 \r
4171     /**\r
4172      * Adds all the elements of an array separated by the specified separator string.\r
4173      * @param separator A string used to separate one element of an array from the next in the\r
4174      * resulting String. If omitted, the array elements are separated with a comma.\r
4175      */\r
4176     join(separator?: string): string;\r
4177 \r
4178     /**\r
4179      * Returns the index of the last occurrence of a value in an array.\r
4180      * @param searchElement The value to locate in the array.\r
4181      * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\r
4182      * search starts at index 0.\r
4183      */\r
4184     lastIndexOf(searchElement: number, fromIndex?: number): number;\r
4185 \r
4186     /**\r
4187      * The length of the array.\r
4188      */\r
4189     readonly length: number;\r
4190 \r
4191     /**\r
4192      * Calls a defined callback function on each element of an array, and returns an array that\r
4193      * contains the results.\r
4194      * @param callbackfn A function that accepts up to three arguments. The map method calls the\r
4195      * callbackfn function one time for each element in the array.\r
4196      * @param thisArg An object to which the this keyword can refer in the callbackfn function.\r
4197      * If thisArg is omitted, undefined is used as the this value.\r
4198      */\r
4199     map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array;\r
4200 \r
4201     /**\r
4202      * Calls the specified callback function for all the elements in an array. The return value of\r
4203      * the callback function is the accumulated result, and is provided as an argument in the next\r
4204      * call to the callback function.\r
4205      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\r
4206      * callbackfn function one time for each element in the array.\r
4207      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
4208      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
4209      * instead of an array value.\r
4210      */\r
4211     reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;\r
4212     reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;\r
4213 \r
4214     /**\r
4215      * Calls the specified callback function for all the elements in an array. The return value of\r
4216      * the callback function is the accumulated result, and is provided as an argument in the next\r
4217      * call to the callback function.\r
4218      * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\r
4219      * callbackfn function one time for each element in the array.\r
4220      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
4221      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
4222      * instead of an array value.\r
4223      */\r
4224     reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;\r
4225 \r
4226     /**\r
4227      * Calls the specified callback function for all the elements in an array, in descending order.\r
4228      * The return value of the callback function is the accumulated result, and is provided as an\r
4229      * argument in the next call to the callback function.\r
4230      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\r
4231      * the callbackfn function one time for each element in the array.\r
4232      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
4233      * the accumulation. The first call to the callbackfn function provides this value as an\r
4234      * argument instead of an array value.\r
4235      */\r
4236     reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;\r
4237     reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;\r
4238 \r
4239     /**\r
4240      * Calls the specified callback function for all the elements in an array, in descending order.\r
4241      * The return value of the callback function is the accumulated result, and is provided as an\r
4242      * argument in the next call to the callback function.\r
4243      * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\r
4244      * the callbackfn function one time for each element in the array.\r
4245      * @param initialValue If initialValue is specified, it is used as the initial value to start\r
4246      * the accumulation. The first call to the callbackfn function provides this value as an argument\r
4247      * instead of an array value.\r
4248      */\r
4249     reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;\r
4250 \r
4251     /**\r
4252      * Reverses the elements in an Array.\r
4253      */\r
4254     reverse(): Float64Array;\r
4255 \r
4256     /**\r
4257      * Sets a value or an array of values.\r
4258      * @param array A typed or untyped array of values to set.\r
4259      * @param offset The index in the current array at which the values are to be written.\r
4260      */\r
4261     set(array: ArrayLike<number>, offset?: number): void;\r
4262 \r
4263     /**\r
4264      * Returns a section of an array.\r
4265      * @param start The beginning of the specified portion of the array.\r
4266      * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.\r
4267      */\r
4268     slice(start?: number, end?: number): Float64Array;\r
4269 \r
4270     /**\r
4271      * Determines whether the specified callback function returns true for any element of an array.\r
4272      * @param predicate A function that accepts up to three arguments. The some method calls\r
4273      * the predicate function for each element in the array until the predicate returns a value\r
4274      * which is coercible to the Boolean value true, or until the end of the array.\r
4275      * @param thisArg An object to which the this keyword can refer in the predicate function.\r
4276      * If thisArg is omitted, undefined is used as the this value.\r
4277      */\r
4278     some(predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): boolean;\r
4279 \r
4280     /**\r
4281      * Sorts an array.\r
4282      * @param compareFn Function used to determine the order of the elements. It is expected to return\r
4283      * a negative value if first argument is less than second argument, zero if they're equal and a positive\r
4284      * value otherwise. If omitted, the elements are sorted in ascending order.\r
4285      * ```ts\r
4286      * [11,2,22,1].sort((a, b) => a - b)\r
4287      * ```\r
4288      */\r
4289     sort(compareFn?: (a: number, b: number) => number): this;\r
4290 \r
4291     /**\r
4292      * at begin, inclusive, up to end, exclusive.\r
4293      * @param begin The index of the beginning of the array.\r
4294      * @param end The index of the end of the array.\r
4295      */\r
4296     subarray(begin?: number, end?: number): Float64Array;\r
4297 \r
4298     toString(): string;\r
4299 \r
4300     /** Returns the primitive value of the specified object. */\r
4301     valueOf(): Float64Array;\r
4302 \r
4303     [index: number]: number;\r
4304 }\r
4305 \r
4306 interface Float64ArrayConstructor {\r
4307     readonly prototype: Float64Array;\r
4308     new(length: number): Float64Array;\r
4309     new(array: ArrayLike<number> | ArrayBufferLike): Float64Array;\r
4310     new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Float64Array;\r
4311 \r
4312     /**\r
4313      * The size in bytes of each element in the array.\r
4314      */\r
4315     readonly BYTES_PER_ELEMENT: number;\r
4316 \r
4317     /**\r
4318      * Returns a new array from a set of elements.\r
4319      * @param items A set of elements to include in the new array object.\r
4320      */\r
4321     of(...items: number[]): Float64Array;\r
4322 \r
4323     /**\r
4324      * Creates an array from an array-like or iterable object.\r
4325      * @param arrayLike An array-like or iterable object to convert to an array.\r
4326      */\r
4327     from(arrayLike: ArrayLike<number>): Float64Array;\r
4328 \r
4329     /**\r
4330      * Creates an array from an array-like or iterable object.\r
4331      * @param arrayLike An array-like or iterable object to convert to an array.\r
4332      * @param mapfn A mapping function to call on every element of the array.\r
4333      * @param thisArg Value of 'this' used to invoke the mapfn.\r
4334      */\r
4335     from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array;\r
4336 \r
4337 }\r
4338 declare var Float64Array: Float64ArrayConstructor;\r
4339 \r
4340 /////////////////////////////\r
4341 /// ECMAScript Internationalization API\r
4342 /////////////////////////////\r
4343 \r
4344 declare namespace Intl {\r
4345     interface CollatorOptions {\r
4346         usage?: string | undefined;\r
4347         localeMatcher?: string | undefined;\r
4348         numeric?: boolean | undefined;\r
4349         caseFirst?: string | undefined;\r
4350         sensitivity?: string | undefined;\r
4351         ignorePunctuation?: boolean | undefined;\r
4352     }\r
4353 \r
4354     interface ResolvedCollatorOptions {\r
4355         locale: string;\r
4356         usage: string;\r
4357         sensitivity: string;\r
4358         ignorePunctuation: boolean;\r
4359         collation: string;\r
4360         caseFirst: string;\r
4361         numeric: boolean;\r
4362     }\r
4363 \r
4364     interface Collator {\r
4365         compare(x: string, y: string): number;\r
4366         resolvedOptions(): ResolvedCollatorOptions;\r
4367     }\r
4368     var Collator: {\r
4369         new(locales?: string | string[], options?: CollatorOptions): Collator;\r
4370         (locales?: string | string[], options?: CollatorOptions): Collator;\r
4371         supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[];\r
4372     };\r
4373 \r
4374     interface NumberFormatOptions {\r
4375         localeMatcher?: string | undefined;\r
4376         style?: string | undefined;\r
4377         currency?: string | undefined;\r
4378         currencyDisplay?: string | undefined;\r
4379         currencySign?: string | undefined;\r
4380         useGrouping?: boolean | undefined;\r
4381         minimumIntegerDigits?: number | undefined;\r
4382         minimumFractionDigits?: number | undefined;\r
4383         maximumFractionDigits?: number | undefined;\r
4384         minimumSignificantDigits?: number | undefined;\r
4385         maximumSignificantDigits?: number | undefined;\r
4386     }\r
4387 \r
4388     interface ResolvedNumberFormatOptions {\r
4389         locale: string;\r
4390         numberingSystem: string;\r
4391         style: string;\r
4392         currency?: string;\r
4393         currencyDisplay?: string;\r
4394         minimumIntegerDigits: number;\r
4395         minimumFractionDigits: number;\r
4396         maximumFractionDigits: number;\r
4397         minimumSignificantDigits?: number;\r
4398         maximumSignificantDigits?: number;\r
4399         useGrouping: boolean;\r
4400     }\r
4401 \r
4402     interface NumberFormat {\r
4403         format(value: number): string;\r
4404         resolvedOptions(): ResolvedNumberFormatOptions;\r
4405     }\r
4406     var NumberFormat: {\r
4407         new(locales?: string | string[], options?: NumberFormatOptions): NumberFormat;\r
4408         (locales?: string | string[], options?: NumberFormatOptions): NumberFormat;\r
4409         supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[];\r
4410     };\r
4411 \r
4412     interface DateTimeFormatOptions {\r
4413         localeMatcher?: "best fit" | "lookup" | undefined;\r
4414         weekday?: "long" | "short" | "narrow" | undefined;\r
4415         era?: "long" | "short" | "narrow" | undefined;\r
4416         year?: "numeric" | "2-digit" | undefined;\r
4417         month?: "numeric" | "2-digit" | "long" | "short" | "narrow" | undefined;\r
4418         day?: "numeric" | "2-digit" | undefined;\r
4419         hour?: "numeric" | "2-digit" | undefined;\r
4420         minute?: "numeric" | "2-digit" | undefined;\r
4421         second?: "numeric" | "2-digit" | undefined;\r
4422         timeZoneName?: "long" | "short" | undefined;\r
4423         formatMatcher?: "best fit" | "basic" | undefined;\r
4424         hour12?: boolean | undefined;\r
4425         timeZone?: string | undefined;\r
4426     }\r
4427 \r
4428     interface ResolvedDateTimeFormatOptions {\r
4429         locale: string;\r
4430         calendar: string;\r
4431         numberingSystem: string;\r
4432         timeZone: string;\r
4433         hour12?: boolean;\r
4434         weekday?: string;\r
4435         era?: string;\r
4436         year?: string;\r
4437         month?: string;\r
4438         day?: string;\r
4439         hour?: string;\r
4440         minute?: string;\r
4441         second?: string;\r
4442         timeZoneName?: string;\r
4443     }\r
4444 \r
4445     interface DateTimeFormat {\r
4446         format(date?: Date | number): string;\r
4447         resolvedOptions(): ResolvedDateTimeFormatOptions;\r
4448     }\r
4449     var DateTimeFormat: {\r
4450         new(locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;\r
4451         (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;\r
4452         supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[];\r
4453     };\r
4454 }\r
4455 \r
4456 interface String {\r
4457     /**\r
4458      * Determines whether two strings are equivalent in the current or specified locale.\r
4459      * @param that String to compare to target string\r
4460      * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.\r
4461      * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.\r
4462      */\r
4463     localeCompare(that: string, locales?: string | string[], options?: Intl.CollatorOptions): number;\r
4464 }\r
4465 \r
4466 interface Number {\r
4467     /**\r
4468      * Converts a number to a string by using the current or specified locale.\r
4469      * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\r
4470      * @param options An object that contains one or more properties that specify comparison options.\r
4471      */\r
4472     toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string;\r
4473 }\r
4474 \r
4475 interface Date {\r
4476     /**\r
4477      * Converts a date and time to a string by using the current or specified locale.\r
4478      * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\r
4479      * @param options An object that contains one or more properties that specify comparison options.\r
4480      */\r
4481     toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\r
4482     /**\r
4483      * Converts a date to a string by using the current or specified locale.\r
4484      * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\r
4485      * @param options An object that contains one or more properties that specify comparison options.\r
4486      */\r
4487     toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\r
4488 \r
4489     /**\r
4490      * Converts a time to a string by using the current or specified locale.\r
4491      * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\r
4492      * @param options An object that contains one or more properties that specify comparison options.\r
4493      */\r
4494     toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\r
4495 }\r