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