UNPKG

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