UNPKG

207 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[]): ReadonlyArray<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: unknown, ...args: any[]) => any ? unknown : 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(): 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(): 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: ReadonlyArray<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 number.
706 * @param x The value to be rounded to the nearest number.
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 an number between 0 and 11 (January to December).
897 * @param date The date as an number between 1 and 31.
898 * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour.
899 * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes.
900 * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds.
901 * @param ms An 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 {
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 {
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 {
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 {
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 {
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 {
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.
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 callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.
1135 * @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.
1136 */
1137 every(callbackfn: (value: T, index: number, array: ReadonlyArray<T>) => unknown, thisArg?: any): boolean;
1138 /**
1139 * Determines whether the specified callback function returns true for any element of an array.
1140 * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.
1141 * @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.
1142 */
1143 some(callbackfn: (value: T, index: number, array: ReadonlyArray<T>) => unknown, thisArg?: any): boolean;
1144 /**
1145 * Performs the specified action for each element in an array.
1146 * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
1147 * @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.
1148 */
1149 forEach(callbackfn: (value: T, index: number, array: ReadonlyArray<T>) => void, thisArg?: any): void;
1150 /**
1151 * Calls a defined callback function on each element of an array, and returns an array that contains the results.
1152 * @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.
1153 * @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.
1154 */
1155 map<U>(callbackfn: (value: T, index: number, array: ReadonlyArray<T>) => U, thisArg?: any): U[];
1156 /**
1157 * Returns the elements of an array that meet the condition specified in a callback function.
1158 * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.
1159 * @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.
1160 */
1161 filter<S extends T>(callbackfn: (value: T, index: number, array: ReadonlyArray<T>) => value is S, thisArg?: any): S[];
1162 /**
1163 * Returns the elements of an array that meet the condition specified in a callback function.
1164 * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.
1165 * @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.
1166 */
1167 filter(callbackfn: (value: T, index: number, array: ReadonlyArray<T>) => unknown, thisArg?: any): T[];
1168 /**
1169 * 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.
1170 * @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.
1171 * @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.
1172 */
1173 reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray<T>) => T): T;
1174 reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray<T>) => T, initialValue: T): T;
1175 /**
1176 * 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.
1177 * @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.
1178 * @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.
1179 */
1180 reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray<T>) => U, initialValue: U): U;
1181 /**
1182 * 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.
1183 * @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.
1184 * @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.
1185 */
1186 reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray<T>) => T): T;
1187 reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray<T>) => T, initialValue: T): T;
1188 /**
1189 * 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.
1190 * @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.
1191 * @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.
1192 */
1193 reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray<T>) => U, initialValue: U): U;
1194
1195 readonly [n: number]: T;
1196}
1197
1198interface ConcatArray<T> {
1199 readonly length: number;
1200 readonly [n: number]: T;
1201 join(separator?: string): string;
1202 slice(start?: number, end?: number): T[];
1203}
1204
1205interface Array<T> {
1206 /**
1207 * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.
1208 */
1209 length: number;
1210 /**
1211 * Returns a string representation of an array.
1212 */
1213 toString(): string;
1214 /**
1215 * Returns a string representation of an array. The elements are converted to string using their toLocalString methods.
1216 */
1217 toLocaleString(): string;
1218 /**
1219 * Removes the last element from an array and returns it.
1220 */
1221 pop(): T | undefined;
1222 /**
1223 * Appends new elements to an array, and returns the new length of the array.
1224 * @param items New elements of the Array.
1225 */
1226 push(...items: T[]): number;
1227 /**
1228 * Combines two or more arrays.
1229 * @param items Additional items to add to the end of array1.
1230 */
1231 concat(...items: ConcatArray<T>[]): T[];
1232 /**
1233 * Combines two or more arrays.
1234 * @param items Additional items to add to the end of array1.
1235 */
1236 concat(...items: (T | ConcatArray<T>)[]): T[];
1237 /**
1238 * Adds all the elements of an array separated by the specified separator string.
1239 * @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.
1240 */
1241 join(separator?: string): string;
1242 /**
1243 * Reverses the elements in an Array.
1244 */
1245 reverse(): T[];
1246 /**
1247 * Removes the first element from an array and returns it.
1248 */
1249 shift(): T | undefined;
1250 /**
1251 * Returns a section of an array.
1252 * @param start The beginning of the specified portion of the array.
1253 * @param end The end of the specified portion of the array.
1254 */
1255 slice(start?: number, end?: number): T[];
1256 /**
1257 * Sorts an array.
1258 * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order.
1259 */
1260 sort(compareFn?: (a: T, b: T) => number): this;
1261 /**
1262 * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
1263 * @param start The zero-based location in the array from which to start removing elements.
1264 * @param deleteCount The number of elements to remove.
1265 */
1266 splice(start: number, deleteCount?: number): T[];
1267 /**
1268 * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
1269 * @param start The zero-based location in the array from which to start removing elements.
1270 * @param deleteCount The number of elements to remove.
1271 * @param items Elements to insert into the array in place of the deleted elements.
1272 */
1273 splice(start: number, deleteCount: number, ...items: T[]): T[];
1274 /**
1275 * Inserts new elements at the start of an array.
1276 * @param items Elements to insert at the start of the Array.
1277 */
1278 unshift(...items: T[]): number;
1279 /**
1280 * Returns the index of the first occurrence of a value in an array.
1281 * @param searchElement The value to locate in the array.
1282 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
1283 */
1284 indexOf(searchElement: T, fromIndex?: number): number;
1285 /**
1286 * Returns the index of the last occurrence of a specified value in an array.
1287 * @param searchElement The value to locate in the array.
1288 * @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.
1289 */
1290 lastIndexOf(searchElement: T, fromIndex?: number): number;
1291 /**
1292 * Determines whether all the members of an array satisfy the specified test.
1293 * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.
1294 * @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.
1295 */
1296 every(callbackfn: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
1297 /**
1298 * Determines whether the specified callback function returns true for any element of an array.
1299 * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.
1300 * @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.
1301 */
1302 some(callbackfn: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
1303 /**
1304 * Performs the specified action for each element in an array.
1305 * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
1306 * @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.
1307 */
1308 forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;
1309 /**
1310 * Calls a defined callback function on each element of an array, and returns an array that contains the results.
1311 * @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.
1312 * @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.
1313 */
1314 map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];
1315 /**
1316 * Returns the elements of an array that meet the condition specified in a callback function.
1317 * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.
1318 * @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.
1319 */
1320 filter<S extends T>(callbackfn: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[];
1321 /**
1322 * Returns the elements of an array that meet the condition specified in a callback function.
1323 * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.
1324 * @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.
1325 */
1326 filter(callbackfn: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[];
1327 /**
1328 * 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.
1329 * @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.
1330 * @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.
1331 */
1332 reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
1333 reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
1334 /**
1335 * 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.
1336 * @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.
1337 * @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.
1338 */
1339 reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
1340 /**
1341 * 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.
1342 * @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.
1343 * @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.
1344 */
1345 reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
1346 reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
1347 /**
1348 * 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.
1349 * @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.
1350 * @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.
1351 */
1352 reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
1353
1354 [n: number]: T;
1355}
1356
1357interface ArrayConstructor {
1358 new(arrayLength?: number): any[];
1359 new <T>(arrayLength: number): T[];
1360 new <T>(...items: T[]): T[];
1361 (arrayLength?: number): any[];
1362 <T>(arrayLength: number): T[];
1363 <T>(...items: T[]): T[];
1364 isArray(arg: any): arg is Array<any>;
1365 readonly prototype: Array<any>;
1366}
1367
1368declare var Array: ArrayConstructor;
1369
1370interface TypedPropertyDescriptor<T> {
1371 enumerable?: boolean;
1372 configurable?: boolean;
1373 writable?: boolean;
1374 value?: T;
1375 get?: () => T;
1376 set?: (value: T) => void;
1377}
1378
1379declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;
1380declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
1381declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
1382declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;
1383
1384declare type PromiseConstructorLike = new <T>(executor: (resolve: (value?: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void) => PromiseLike<T>;
1385
1386interface PromiseLike<T> {
1387 /**
1388 * Attaches callbacks for the resolution and/or rejection of the Promise.
1389 * @param onfulfilled The callback to execute when the Promise is resolved.
1390 * @param onrejected The callback to execute when the Promise is rejected.
1391 * @returns A Promise for the completion of which ever callback is executed.
1392 */
1393 then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): PromiseLike<TResult1 | TResult2>;
1394}
1395
1396/**
1397 * Represents the completion of an asynchronous operation
1398 */
1399interface Promise<T> {
1400 /**
1401 * Attaches callbacks for the resolution and/or rejection of the Promise.
1402 * @param onfulfilled The callback to execute when the Promise is resolved.
1403 * @param onrejected The callback to execute when the Promise is rejected.
1404 * @returns A Promise for the completion of which ever callback is executed.
1405 */
1406 then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
1407
1408 /**
1409 * Attaches a callback for only the rejection of the Promise.
1410 * @param onrejected The callback to execute when the Promise is rejected.
1411 * @returns A Promise for the completion of the callback.
1412 */
1413 catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
1414}
1415
1416interface ArrayLike<T> {
1417 readonly length: number;
1418 readonly [n: number]: T;
1419}
1420
1421/**
1422 * Make all properties in T optional
1423 */
1424type Partial<T> = {
1425 [P in keyof T]?: T[P];
1426};
1427
1428/**
1429 * Make all properties in T required
1430 */
1431type Required<T> = {
1432 [P in keyof T]-?: T[P];
1433};
1434
1435/**
1436 * Make all properties in T readonly
1437 */
1438type Readonly<T> = {
1439 readonly [P in keyof T]: T[P];
1440};
1441
1442/**
1443 * From T, pick a set of properties whose keys are in the union K
1444 */
1445type Pick<T, K extends keyof T> = {
1446 [P in K]: T[P];
1447};
1448
1449/**
1450 * Construct a type with a set of properties K of type T
1451 */
1452type Record<K extends keyof any, T> = {
1453 [P in K]: T;
1454};
1455
1456/**
1457 * Exclude from T those types that are assignable to U
1458 */
1459type Exclude<T, U> = T extends U ? never : T;
1460
1461/**
1462 * Extract from T those types that are assignable to U
1463 */
1464type Extract<T, U> = T extends U ? T : never;
1465
1466/**
1467 * Construct a type with the properties of T except for those in type K.
1468 */
1469type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
1470
1471/**
1472 * Exclude null and undefined from T
1473 */
1474type NonNullable<T> = T extends null | undefined ? never : T;
1475
1476/**
1477 * Obtain the parameters of a function type in a tuple
1478 */
1479type Parameters<T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never;
1480
1481/**
1482 * Obtain the parameters of a constructor function type in a tuple
1483 */
1484type ConstructorParameters<T extends new (...args: any) => any> = T extends new (...args: infer P) => any ? P : never;
1485
1486/**
1487 * Obtain the return type of a function type
1488 */
1489type ReturnType<T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any;
1490
1491/**
1492 * Obtain the return type of a constructor function type
1493 */
1494type InstanceType<T extends new (...args: any) => any> = T extends new (...args: any) => infer R ? R : any;
1495
1496/**
1497 * Marker for contextual 'this' type
1498 */
1499interface ThisType<T> { }
1500
1501/**
1502 * Represents a raw buffer of binary data, which is used to store data for the
1503 * different typed arrays. ArrayBuffers cannot be read from or written to directly,
1504 * but can be passed to a typed array or DataView Object to interpret the raw
1505 * buffer as needed.
1506 */
1507interface ArrayBuffer {
1508 /**
1509 * Read-only. The length of the ArrayBuffer (in bytes).
1510 */
1511 readonly byteLength: number;
1512
1513 /**
1514 * Returns a section of an ArrayBuffer.
1515 */
1516 slice(begin: number, end?: number): ArrayBuffer;
1517}
1518
1519/**
1520 * Allowed ArrayBuffer types for the buffer of an ArrayBufferView and related Typed Arrays.
1521 */
1522interface ArrayBufferTypes {
1523 ArrayBuffer: ArrayBuffer;
1524}
1525type ArrayBufferLike = ArrayBufferTypes[keyof ArrayBufferTypes];
1526
1527interface ArrayBufferConstructor {
1528 readonly prototype: ArrayBuffer;
1529 new(byteLength: number): ArrayBuffer;
1530 isView(arg: any): arg is ArrayBufferView;
1531}
1532declare var ArrayBuffer: ArrayBufferConstructor;
1533
1534interface ArrayBufferView {
1535 /**
1536 * The ArrayBuffer instance referenced by the array.
1537 */
1538 buffer: ArrayBufferLike;
1539
1540 /**
1541 * The length in bytes of the array.
1542 */
1543 byteLength: number;
1544
1545 /**
1546 * The offset in bytes of the array.
1547 */
1548 byteOffset: number;
1549}
1550
1551interface DataView {
1552 readonly buffer: ArrayBuffer;
1553 readonly byteLength: number;
1554 readonly byteOffset: number;
1555 /**
1556 * Gets the Float32 value at the specified byte offset from the start of the view. There is
1557 * no alignment constraint; multi-byte values may be fetched from any offset.
1558 * @param byteOffset The place in the buffer at which the value should be retrieved.
1559 */
1560 getFloat32(byteOffset: number, littleEndian?: boolean): number;
1561
1562 /**
1563 * Gets the Float64 value at the specified byte offset from the start of the view. There is
1564 * no alignment constraint; multi-byte values may be fetched from any offset.
1565 * @param byteOffset The place in the buffer at which the value should be retrieved.
1566 */
1567 getFloat64(byteOffset: number, littleEndian?: boolean): number;
1568
1569 /**
1570 * Gets the Int8 value at the specified byte offset from the start of the view. There is
1571 * no alignment constraint; multi-byte values may be fetched from any offset.
1572 * @param byteOffset The place in the buffer at which the value should be retrieved.
1573 */
1574 getInt8(byteOffset: number): number;
1575
1576 /**
1577 * Gets the Int16 value at the specified byte offset from the start of the view. There is
1578 * no alignment constraint; multi-byte values may be fetched from any offset.
1579 * @param byteOffset The place in the buffer at which the value should be retrieved.
1580 */
1581 getInt16(byteOffset: number, littleEndian?: boolean): number;
1582 /**
1583 * Gets the Int32 value at the specified byte offset from the start of the view. There is
1584 * no alignment constraint; multi-byte values may be fetched from any offset.
1585 * @param byteOffset The place in the buffer at which the value should be retrieved.
1586 */
1587 getInt32(byteOffset: number, littleEndian?: boolean): number;
1588
1589 /**
1590 * Gets the Uint8 value at the specified byte offset from the start of the view. There is
1591 * no alignment constraint; multi-byte values may be fetched from any offset.
1592 * @param byteOffset The place in the buffer at which the value should be retrieved.
1593 */
1594 getUint8(byteOffset: number): number;
1595
1596 /**
1597 * Gets the Uint16 value at the specified byte offset from the start of the view. There is
1598 * no alignment constraint; multi-byte values may be fetched from any offset.
1599 * @param byteOffset The place in the buffer at which the value should be retrieved.
1600 */
1601 getUint16(byteOffset: number, littleEndian?: boolean): number;
1602
1603 /**
1604 * Gets the Uint32 value at the specified byte offset from the start of the view. There is
1605 * no alignment constraint; multi-byte values may be fetched from any offset.
1606 * @param byteOffset The place in the buffer at which the value should be retrieved.
1607 */
1608 getUint32(byteOffset: number, littleEndian?: boolean): number;
1609
1610 /**
1611 * Stores an Float32 value at the specified byte offset from the start of the view.
1612 * @param byteOffset The place in the buffer at which the value should be set.
1613 * @param value The value to set.
1614 * @param littleEndian If false or undefined, a big-endian value should be written,
1615 * otherwise a little-endian value should be written.
1616 */
1617 setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;
1618
1619 /**
1620 * Stores an Float64 value at the specified byte offset from the start of the view.
1621 * @param byteOffset The place in the buffer at which the value should be set.
1622 * @param value The value to set.
1623 * @param littleEndian If false or undefined, a big-endian value should be written,
1624 * otherwise a little-endian value should be written.
1625 */
1626 setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;
1627
1628 /**
1629 * Stores an Int8 value at the specified byte offset from the start of the view.
1630 * @param byteOffset The place in the buffer at which the value should be set.
1631 * @param value The value to set.
1632 */
1633 setInt8(byteOffset: number, value: number): void;
1634
1635 /**
1636 * Stores an Int16 value at the specified byte offset from the start of the view.
1637 * @param byteOffset The place in the buffer at which the value should be set.
1638 * @param value The value to set.
1639 * @param littleEndian If false or undefined, a big-endian value should be written,
1640 * otherwise a little-endian value should be written.
1641 */
1642 setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;
1643
1644 /**
1645 * Stores an Int32 value at the specified byte offset from the start of the view.
1646 * @param byteOffset The place in the buffer at which the value should be set.
1647 * @param value The value to set.
1648 * @param littleEndian If false or undefined, a big-endian value should be written,
1649 * otherwise a little-endian value should be written.
1650 */
1651 setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;
1652
1653 /**
1654 * Stores an Uint8 value at the specified byte offset from the start of the view.
1655 * @param byteOffset The place in the buffer at which the value should be set.
1656 * @param value The value to set.
1657 */
1658 setUint8(byteOffset: number, value: number): void;
1659
1660 /**
1661 * Stores an Uint16 value at the specified byte offset from the start of the view.
1662 * @param byteOffset The place in the buffer at which the value should be set.
1663 * @param value The value to set.
1664 * @param littleEndian If false or undefined, a big-endian value should be written,
1665 * otherwise a little-endian value should be written.
1666 */
1667 setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;
1668
1669 /**
1670 * Stores an Uint32 value at the specified byte offset from the start of the view.
1671 * @param byteOffset The place in the buffer at which the value should be set.
1672 * @param value The value to set.
1673 * @param littleEndian If false or undefined, a big-endian value should be written,
1674 * otherwise a little-endian value should be written.
1675 */
1676 setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;
1677}
1678
1679interface DataViewConstructor {
1680 new(buffer: ArrayBufferLike, byteOffset?: number, byteLength?: number): DataView;
1681}
1682declare var DataView: DataViewConstructor;
1683
1684/**
1685 * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested
1686 * number of bytes could not be allocated an exception is raised.
1687 */
1688interface Int8Array {
1689 /**
1690 * The size in bytes of each element in the array.
1691 */
1692 readonly BYTES_PER_ELEMENT: number;
1693
1694 /**
1695 * The ArrayBuffer instance referenced by the array.
1696 */
1697 readonly buffer: ArrayBufferLike;
1698
1699 /**
1700 * The length in bytes of the array.
1701 */
1702 readonly byteLength: number;
1703
1704 /**
1705 * The offset in bytes of the array.
1706 */
1707 readonly byteOffset: number;
1708
1709 /**
1710 * Returns the this object after copying a section of the array identified by start and end
1711 * to the same array starting at position target
1712 * @param target If target is negative, it is treated as length+target where length is the
1713 * length of the array.
1714 * @param start If start is negative, it is treated as length+start. If end is negative, it
1715 * is treated as length+end.
1716 * @param end If not specified, length of the this object is used as its default value.
1717 */
1718 copyWithin(target: number, start: number, end?: number): this;
1719
1720 /**
1721 * Determines whether all the members of an array satisfy the specified test.
1722 * @param callbackfn A function that accepts up to three arguments. The every method calls
1723 * the callbackfn function for each element in array1 until the callbackfn returns false,
1724 * or until the end of the array.
1725 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
1726 * If thisArg is omitted, undefined is used as the this value.
1727 */
1728 every(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean;
1729
1730 /**
1731 * Returns the this object after filling the section identified by start and end with value
1732 * @param value value to fill array section with
1733 * @param start index to start filling the array at. If start is negative, it is treated as
1734 * length+start where length is the length of the array.
1735 * @param end index to stop filling the array at. If end is negative, it is treated as
1736 * length+end.
1737 */
1738 fill(value: number, start?: number, end?: number): this;
1739
1740 /**
1741 * Returns the elements of an array that meet the condition specified in a callback function.
1742 * @param callbackfn A function that accepts up to three arguments. The filter method calls
1743 * the callbackfn function one time for each element in the array.
1744 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
1745 * If thisArg is omitted, undefined is used as the this value.
1746 */
1747 filter(callbackfn: (value: number, index: number, array: Int8Array) => any, thisArg?: any): Int8Array;
1748
1749 /**
1750 * Returns the value of the first element in the array where predicate is true, and undefined
1751 * otherwise.
1752 * @param predicate find calls predicate once for each element of the array, in ascending
1753 * order, until it finds one where predicate returns true. If such an element is found, find
1754 * immediately returns that element value. Otherwise, find returns undefined.
1755 * @param thisArg If provided, it will be used as the this value for each invocation of
1756 * predicate. If it is not provided, undefined is used instead.
1757 */
1758 find(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number | undefined;
1759
1760 /**
1761 * Returns the index of the first element in the array where predicate is true, and -1
1762 * otherwise.
1763 * @param predicate find calls predicate once for each element of the array, in ascending
1764 * order, until it finds one where predicate returns true. If such an element is found,
1765 * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
1766 * @param thisArg If provided, it will be used as the this value for each invocation of
1767 * predicate. If it is not provided, undefined is used instead.
1768 */
1769 findIndex(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number;
1770
1771 /**
1772 * Performs the specified action for each element in an array.
1773 * @param callbackfn A function that accepts up to three arguments. forEach calls the
1774 * callbackfn function one time for each element in the array.
1775 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
1776 * If thisArg is omitted, undefined is used as the this value.
1777 */
1778 forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void;
1779
1780 /**
1781 * Returns the index of the first occurrence of a value in an array.
1782 * @param searchElement The value to locate in the array.
1783 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
1784 * search starts at index 0.
1785 */
1786 indexOf(searchElement: number, fromIndex?: number): number;
1787
1788 /**
1789 * Adds all the elements of an array separated by the specified separator string.
1790 * @param separator A string used to separate one element of an array from the next in the
1791 * resulting String. If omitted, the array elements are separated with a comma.
1792 */
1793 join(separator?: string): string;
1794
1795 /**
1796 * Returns the index of the last occurrence of a value in an array.
1797 * @param searchElement The value to locate in the array.
1798 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
1799 * search starts at index 0.
1800 */
1801 lastIndexOf(searchElement: number, fromIndex?: number): number;
1802
1803 /**
1804 * The length of the array.
1805 */
1806 readonly length: number;
1807
1808 /**
1809 * Calls a defined callback function on each element of an array, and returns an array that
1810 * contains the results.
1811 * @param callbackfn A function that accepts up to three arguments. The map method calls the
1812 * callbackfn function one time for each element in the array.
1813 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
1814 * If thisArg is omitted, undefined is used as the this value.
1815 */
1816 map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array;
1817
1818 /**
1819 * Calls the specified callback function for all the elements in an array. The return value of
1820 * the callback function is the accumulated result, and is provided as an argument in the next
1821 * call to the callback function.
1822 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
1823 * callbackfn function one time for each element in the array.
1824 * @param initialValue If initialValue is specified, it is used as the initial value to start
1825 * the accumulation. The first call to the callbackfn function provides this value as an argument
1826 * instead of an array value.
1827 */
1828 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;
1829 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;
1830
1831 /**
1832 * Calls the specified callback function for all the elements in an array. The return value of
1833 * the callback function is the accumulated result, and is provided as an argument in the next
1834 * call to the callback function.
1835 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
1836 * callbackfn function one time for each element in the array.
1837 * @param initialValue If initialValue is specified, it is used as the initial value to start
1838 * the accumulation. The first call to the callbackfn function provides this value as an argument
1839 * instead of an array value.
1840 */
1841 reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;
1842
1843 /**
1844 * Calls the specified callback function for all the elements in an array, in descending order.
1845 * The return value of the callback function is the accumulated result, and is provided as an
1846 * argument in the next call to the callback function.
1847 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
1848 * the callbackfn function one time for each element in the array.
1849 * @param initialValue If initialValue is specified, it is used as the initial value to start
1850 * the accumulation. The first call to the callbackfn function provides this value as an
1851 * argument instead of an array value.
1852 */
1853 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;
1854 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;
1855
1856 /**
1857 * Calls the specified callback function for all the elements in an array, in descending order.
1858 * The return value of the callback function is the accumulated result, and is provided as an
1859 * argument in the next call to the callback function.
1860 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
1861 * the callbackfn function one time for each element in the array.
1862 * @param initialValue If initialValue is specified, it is used as the initial value to start
1863 * the accumulation. The first call to the callbackfn function provides this value as an argument
1864 * instead of an array value.
1865 */
1866 reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;
1867
1868 /**
1869 * Reverses the elements in an Array.
1870 */
1871 reverse(): Int8Array;
1872
1873 /**
1874 * Sets a value or an array of values.
1875 * @param array A typed or untyped array of values to set.
1876 * @param offset The index in the current array at which the values are to be written.
1877 */
1878 set(array: ArrayLike<number>, offset?: number): void;
1879
1880 /**
1881 * Returns a section of an array.
1882 * @param start The beginning of the specified portion of the array.
1883 * @param end The end of the specified portion of the array.
1884 */
1885 slice(start?: number, end?: number): Int8Array;
1886
1887 /**
1888 * Determines whether the specified callback function returns true for any element of an array.
1889 * @param callbackfn A function that accepts up to three arguments. The some method calls the
1890 * callbackfn function for each element in array1 until the callbackfn returns true, or until
1891 * the end of the array.
1892 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
1893 * If thisArg is omitted, undefined is used as the this value.
1894 */
1895 some(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean;
1896
1897 /**
1898 * Sorts an array.
1899 * @param compareFn The name of the function used to determine the order of the elements. If
1900 * omitted, the elements are sorted in ascending, ASCII character order.
1901 */
1902 sort(compareFn?: (a: number, b: number) => number): this;
1903
1904 /**
1905 * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements
1906 * at begin, inclusive, up to end, exclusive.
1907 * @param begin The index of the beginning of the array.
1908 * @param end The index of the end of the array.
1909 */
1910 subarray(begin: number, end?: number): Int8Array;
1911
1912 /**
1913 * Converts a number to a string by using the current locale.
1914 */
1915 toLocaleString(): string;
1916
1917 /**
1918 * Returns a string representation of an array.
1919 */
1920 toString(): string;
1921
1922 [index: number]: number;
1923}
1924interface Int8ArrayConstructor {
1925 readonly prototype: Int8Array;
1926 new(length: number): Int8Array;
1927 new(arrayOrArrayBuffer: ArrayLike<number> | ArrayBufferLike): Int8Array;
1928 new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int8Array;
1929
1930 /**
1931 * The size in bytes of each element in the array.
1932 */
1933 readonly BYTES_PER_ELEMENT: number;
1934
1935 /**
1936 * Returns a new array from a set of elements.
1937 * @param items A set of elements to include in the new array object.
1938 */
1939 of(...items: number[]): Int8Array;
1940
1941 /**
1942 * Creates an array from an array-like or iterable object.
1943 * @param arrayLike An array-like or iterable object to convert to an array.
1944 */
1945 from(arrayLike: ArrayLike<number>): Int8Array;
1946
1947 /**
1948 * Creates an array from an array-like or iterable object.
1949 * @param arrayLike An array-like or iterable object to convert to an array.
1950 * @param mapfn A mapping function to call on every element of the array.
1951 * @param thisArg Value of 'this' used to invoke the mapfn.
1952 */
1953 from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array;
1954
1955
1956}
1957declare var Int8Array: Int8ArrayConstructor;
1958
1959/**
1960 * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the
1961 * requested number of bytes could not be allocated an exception is raised.
1962 */
1963interface Uint8Array {
1964 /**
1965 * The size in bytes of each element in the array.
1966 */
1967 readonly BYTES_PER_ELEMENT: number;
1968
1969 /**
1970 * The ArrayBuffer instance referenced by the array.
1971 */
1972 readonly buffer: ArrayBufferLike;
1973
1974 /**
1975 * The length in bytes of the array.
1976 */
1977 readonly byteLength: number;
1978
1979 /**
1980 * The offset in bytes of the array.
1981 */
1982 readonly byteOffset: number;
1983
1984 /**
1985 * Returns the this object after copying a section of the array identified by start and end
1986 * to the same array starting at position target
1987 * @param target If target is negative, it is treated as length+target where length is the
1988 * length of the array.
1989 * @param start If start is negative, it is treated as length+start. If end is negative, it
1990 * is treated as length+end.
1991 * @param end If not specified, length of the this object is used as its default value.
1992 */
1993 copyWithin(target: number, start: number, end?: number): this;
1994
1995 /**
1996 * Determines whether all the members of an array satisfy the specified test.
1997 * @param callbackfn A function that accepts up to three arguments. The every method calls
1998 * the callbackfn function for each element in array1 until the callbackfn returns false,
1999 * or until the end of the array.
2000 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2001 * If thisArg is omitted, undefined is used as the this value.
2002 */
2003 every(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean;
2004
2005 /**
2006 * Returns the this object after filling the section identified by start and end with value
2007 * @param value value to fill array section with
2008 * @param start index to start filling the array at. If start is negative, it is treated as
2009 * length+start where length is the length of the array.
2010 * @param end index to stop filling the array at. If end is negative, it is treated as
2011 * length+end.
2012 */
2013 fill(value: number, start?: number, end?: number): this;
2014
2015 /**
2016 * Returns the elements of an array that meet the condition specified in a callback function.
2017 * @param callbackfn A function that accepts up to three arguments. The filter method calls
2018 * the callbackfn function one time for each element in the array.
2019 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2020 * If thisArg is omitted, undefined is used as the this value.
2021 */
2022 filter(callbackfn: (value: number, index: number, array: Uint8Array) => any, thisArg?: any): Uint8Array;
2023
2024 /**
2025 * Returns the value of the first element in the array where predicate is true, and undefined
2026 * otherwise.
2027 * @param predicate find calls predicate once for each element of the array, in ascending
2028 * order, until it finds one where predicate returns true. If such an element is found, find
2029 * immediately returns that element value. Otherwise, find returns undefined.
2030 * @param thisArg If provided, it will be used as the this value for each invocation of
2031 * predicate. If it is not provided, undefined is used instead.
2032 */
2033 find(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number | undefined;
2034
2035 /**
2036 * Returns the index of the first element in the array where predicate is true, and -1
2037 * otherwise.
2038 * @param predicate find calls predicate once for each element of the array, in ascending
2039 * order, until it finds one where predicate returns true. If such an element is found,
2040 * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
2041 * @param thisArg If provided, it will be used as the this value for each invocation of
2042 * predicate. If it is not provided, undefined is used instead.
2043 */
2044 findIndex(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number;
2045
2046 /**
2047 * Performs the specified action for each element in an array.
2048 * @param callbackfn A function that accepts up to three arguments. forEach calls the
2049 * callbackfn function one time for each element in the array.
2050 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2051 * If thisArg is omitted, undefined is used as the this value.
2052 */
2053 forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void;
2054
2055 /**
2056 * Returns the index of the first occurrence of a value in an array.
2057 * @param searchElement The value to locate in the array.
2058 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
2059 * search starts at index 0.
2060 */
2061 indexOf(searchElement: number, fromIndex?: number): number;
2062
2063 /**
2064 * Adds all the elements of an array separated by the specified separator string.
2065 * @param separator A string used to separate one element of an array from the next in the
2066 * resulting String. If omitted, the array elements are separated with a comma.
2067 */
2068 join(separator?: string): string;
2069
2070 /**
2071 * Returns the index of the last occurrence of a value in an array.
2072 * @param searchElement The value to locate in the array.
2073 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
2074 * search starts at index 0.
2075 */
2076 lastIndexOf(searchElement: number, fromIndex?: number): number;
2077
2078 /**
2079 * The length of the array.
2080 */
2081 readonly length: number;
2082
2083 /**
2084 * Calls a defined callback function on each element of an array, and returns an array that
2085 * contains the results.
2086 * @param callbackfn A function that accepts up to three arguments. The map method calls the
2087 * callbackfn function one time for each element in the array.
2088 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2089 * If thisArg is omitted, undefined is used as the this value.
2090 */
2091 map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array;
2092
2093 /**
2094 * Calls the specified callback function for all the elements in an array. The return value of
2095 * the callback function is the accumulated result, and is provided as an argument in the next
2096 * call to the callback function.
2097 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
2098 * callbackfn function one time for each element in the array.
2099 * @param initialValue If initialValue is specified, it is used as the initial value to start
2100 * the accumulation. The first call to the callbackfn function provides this value as an argument
2101 * instead of an array value.
2102 */
2103 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;
2104 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;
2105
2106 /**
2107 * Calls the specified callback function for all the elements in an array. The return value of
2108 * the callback function is the accumulated result, and is provided as an argument in the next
2109 * call to the callback function.
2110 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
2111 * callbackfn function one time for each element in the array.
2112 * @param initialValue If initialValue is specified, it is used as the initial value to start
2113 * the accumulation. The first call to the callbackfn function provides this value as an argument
2114 * instead of an array value.
2115 */
2116 reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;
2117
2118 /**
2119 * Calls the specified callback function for all the elements in an array, in descending order.
2120 * The return value of the callback function is the accumulated result, and is provided as an
2121 * argument in the next call to the callback function.
2122 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
2123 * the callbackfn function one time for each element in the array.
2124 * @param initialValue If initialValue is specified, it is used as the initial value to start
2125 * the accumulation. The first call to the callbackfn function provides this value as an
2126 * argument instead of an array value.
2127 */
2128 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;
2129 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;
2130
2131 /**
2132 * Calls the specified callback function for all the elements in an array, in descending order.
2133 * The return value of the callback function is the accumulated result, and is provided as an
2134 * argument in the next call to the callback function.
2135 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
2136 * the callbackfn function one time for each element in the array.
2137 * @param initialValue If initialValue is specified, it is used as the initial value to start
2138 * the accumulation. The first call to the callbackfn function provides this value as an argument
2139 * instead of an array value.
2140 */
2141 reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;
2142
2143 /**
2144 * Reverses the elements in an Array.
2145 */
2146 reverse(): Uint8Array;
2147
2148 /**
2149 * Sets a value or an array of values.
2150 * @param array A typed or untyped array of values to set.
2151 * @param offset The index in the current array at which the values are to be written.
2152 */
2153 set(array: ArrayLike<number>, offset?: number): void;
2154
2155 /**
2156 * Returns a section of an array.
2157 * @param start The beginning of the specified portion of the array.
2158 * @param end The end of the specified portion of the array.
2159 */
2160 slice(start?: number, end?: number): Uint8Array;
2161
2162 /**
2163 * Determines whether the specified callback function returns true for any element of an array.
2164 * @param callbackfn A function that accepts up to three arguments. The some method calls the
2165 * callbackfn function for each element in array1 until the callbackfn returns true, or until
2166 * the end of the array.
2167 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2168 * If thisArg is omitted, undefined is used as the this value.
2169 */
2170 some(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean;
2171
2172 /**
2173 * Sorts an array.
2174 * @param compareFn The name of the function used to determine the order of the elements. If
2175 * omitted, the elements are sorted in ascending, ASCII character order.
2176 */
2177 sort(compareFn?: (a: number, b: number) => number): this;
2178
2179 /**
2180 * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements
2181 * at begin, inclusive, up to end, exclusive.
2182 * @param begin The index of the beginning of the array.
2183 * @param end The index of the end of the array.
2184 */
2185 subarray(begin: number, end?: number): Uint8Array;
2186
2187 /**
2188 * Converts a number to a string by using the current locale.
2189 */
2190 toLocaleString(): string;
2191
2192 /**
2193 * Returns a string representation of an array.
2194 */
2195 toString(): string;
2196
2197 [index: number]: number;
2198}
2199
2200interface Uint8ArrayConstructor {
2201 readonly prototype: Uint8Array;
2202 new(length: number): Uint8Array;
2203 new(arrayOrArrayBuffer: ArrayLike<number> | ArrayBufferLike): Uint8Array;
2204 new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint8Array;
2205
2206 /**
2207 * The size in bytes of each element in the array.
2208 */
2209 readonly BYTES_PER_ELEMENT: number;
2210
2211 /**
2212 * Returns a new array from a set of elements.
2213 * @param items A set of elements to include in the new array object.
2214 */
2215 of(...items: number[]): Uint8Array;
2216
2217 /**
2218 * Creates an array from an array-like or iterable object.
2219 * @param arrayLike An array-like or iterable object to convert to an array.
2220 */
2221 from(arrayLike: ArrayLike<number>): Uint8Array;
2222
2223 /**
2224 * Creates an array from an array-like or iterable object.
2225 * @param arrayLike An array-like or iterable object to convert to an array.
2226 * @param mapfn A mapping function to call on every element of the array.
2227 * @param thisArg Value of 'this' used to invoke the mapfn.
2228 */
2229 from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array;
2230
2231}
2232declare var Uint8Array: Uint8ArrayConstructor;
2233
2234/**
2235 * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.
2236 * If the requested number of bytes could not be allocated an exception is raised.
2237 */
2238interface Uint8ClampedArray {
2239 /**
2240 * The size in bytes of each element in the array.
2241 */
2242 readonly BYTES_PER_ELEMENT: number;
2243
2244 /**
2245 * The ArrayBuffer instance referenced by the array.
2246 */
2247 readonly buffer: ArrayBufferLike;
2248
2249 /**
2250 * The length in bytes of the array.
2251 */
2252 readonly byteLength: number;
2253
2254 /**
2255 * The offset in bytes of the array.
2256 */
2257 readonly byteOffset: number;
2258
2259 /**
2260 * Returns the this object after copying a section of the array identified by start and end
2261 * to the same array starting at position target
2262 * @param target If target is negative, it is treated as length+target where length is the
2263 * length of the array.
2264 * @param start If start is negative, it is treated as length+start. If end is negative, it
2265 * is treated as length+end.
2266 * @param end If not specified, length of the this object is used as its default value.
2267 */
2268 copyWithin(target: number, start: number, end?: number): this;
2269
2270 /**
2271 * Determines whether all the members of an array satisfy the specified test.
2272 * @param callbackfn A function that accepts up to three arguments. The every method calls
2273 * the callbackfn function for each element in array1 until the callbackfn returns false,
2274 * or until the end of the array.
2275 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2276 * If thisArg is omitted, undefined is used as the this value.
2277 */
2278 every(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean;
2279
2280 /**
2281 * Returns the this object after filling the section identified by start and end with value
2282 * @param value value to fill array section with
2283 * @param start index to start filling the array at. If start is negative, it is treated as
2284 * length+start where length is the length of the array.
2285 * @param end index to stop filling the array at. If end is negative, it is treated as
2286 * length+end.
2287 */
2288 fill(value: number, start?: number, end?: number): this;
2289
2290 /**
2291 * Returns the elements of an array that meet the condition specified in a callback function.
2292 * @param callbackfn A function that accepts up to three arguments. The filter method calls
2293 * the callbackfn function one time for each element in the array.
2294 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2295 * If thisArg is omitted, undefined is used as the this value.
2296 */
2297 filter(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => any, thisArg?: any): Uint8ClampedArray;
2298
2299 /**
2300 * Returns the value of the first element in the array where predicate is true, and undefined
2301 * otherwise.
2302 * @param predicate find calls predicate once for each element of the array, in ascending
2303 * order, until it finds one where predicate returns true. If such an element is found, find
2304 * immediately returns that element value. Otherwise, find returns undefined.
2305 * @param thisArg If provided, it will be used as the this value for each invocation of
2306 * predicate. If it is not provided, undefined is used instead.
2307 */
2308 find(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number | undefined;
2309
2310 /**
2311 * Returns the index of the first element in the array where predicate is true, and -1
2312 * otherwise.
2313 * @param predicate find calls predicate once for each element of the array, in ascending
2314 * order, until it finds one where predicate returns true. If such an element is found,
2315 * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
2316 * @param thisArg If provided, it will be used as the this value for each invocation of
2317 * predicate. If it is not provided, undefined is used instead.
2318 */
2319 findIndex(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number;
2320
2321 /**
2322 * Performs the specified action for each element in an array.
2323 * @param callbackfn A function that accepts up to three arguments. forEach calls the
2324 * callbackfn function one time for each element in the array.
2325 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2326 * If thisArg is omitted, undefined is used as the this value.
2327 */
2328 forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void;
2329
2330 /**
2331 * Returns the index of the first occurrence of a value in an array.
2332 * @param searchElement The value to locate in the array.
2333 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
2334 * search starts at index 0.
2335 */
2336 indexOf(searchElement: number, fromIndex?: number): number;
2337
2338 /**
2339 * Adds all the elements of an array separated by the specified separator string.
2340 * @param separator A string used to separate one element of an array from the next in the
2341 * resulting String. If omitted, the array elements are separated with a comma.
2342 */
2343 join(separator?: string): string;
2344
2345 /**
2346 * Returns the index of the last occurrence of a value in an array.
2347 * @param searchElement The value to locate in the array.
2348 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
2349 * search starts at index 0.
2350 */
2351 lastIndexOf(searchElement: number, fromIndex?: number): number;
2352
2353 /**
2354 * The length of the array.
2355 */
2356 readonly length: number;
2357
2358 /**
2359 * Calls a defined callback function on each element of an array, and returns an array that
2360 * contains the results.
2361 * @param callbackfn A function that accepts up to three arguments. The map method calls the
2362 * callbackfn function one time for each element in the array.
2363 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2364 * If thisArg is omitted, undefined is used as the this value.
2365 */
2366 map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray;
2367
2368 /**
2369 * Calls the specified callback function for all the elements in an array. The return value of
2370 * the callback function is the accumulated result, and is provided as an argument in the next
2371 * call to the callback function.
2372 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
2373 * callbackfn function one time for each element in the array.
2374 * @param initialValue If initialValue is specified, it is used as the initial value to start
2375 * the accumulation. The first call to the callbackfn function provides this value as an argument
2376 * instead of an array value.
2377 */
2378 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;
2379 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;
2380
2381 /**
2382 * Calls the specified callback function for all the elements in an array. The return value of
2383 * the callback function is the accumulated result, and is provided as an argument in the next
2384 * call to the callback function.
2385 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
2386 * callbackfn function one time for each element in the array.
2387 * @param initialValue If initialValue is specified, it is used as the initial value to start
2388 * the accumulation. The first call to the callbackfn function provides this value as an argument
2389 * instead of an array value.
2390 */
2391 reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;
2392
2393 /**
2394 * Calls the specified callback function for all the elements in an array, in descending order.
2395 * The return value of the callback function is the accumulated result, and is provided as an
2396 * argument in the next call to the callback function.
2397 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
2398 * the callbackfn function one time for each element in the array.
2399 * @param initialValue If initialValue is specified, it is used as the initial value to start
2400 * the accumulation. The first call to the callbackfn function provides this value as an
2401 * argument instead of an array value.
2402 */
2403 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;
2404 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;
2405
2406 /**
2407 * Calls the specified callback function for all the elements in an array, in descending order.
2408 * The return value of the callback function is the accumulated result, and is provided as an
2409 * argument in the next call to the callback function.
2410 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
2411 * the callbackfn function one time for each element in the array.
2412 * @param initialValue If initialValue is specified, it is used as the initial value to start
2413 * the accumulation. The first call to the callbackfn function provides this value as an argument
2414 * instead of an array value.
2415 */
2416 reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;
2417
2418 /**
2419 * Reverses the elements in an Array.
2420 */
2421 reverse(): Uint8ClampedArray;
2422
2423 /**
2424 * Sets a value or an array of values.
2425 * @param array A typed or untyped array of values to set.
2426 * @param offset The index in the current array at which the values are to be written.
2427 */
2428 set(array: ArrayLike<number>, offset?: number): void;
2429
2430 /**
2431 * Returns a section of an array.
2432 * @param start The beginning of the specified portion of the array.
2433 * @param end The end of the specified portion of the array.
2434 */
2435 slice(start?: number, end?: number): Uint8ClampedArray;
2436
2437 /**
2438 * Determines whether the specified callback function returns true for any element of an array.
2439 * @param callbackfn A function that accepts up to three arguments. The some method calls the
2440 * callbackfn function for each element in array1 until the callbackfn returns true, or until
2441 * the end of the array.
2442 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2443 * If thisArg is omitted, undefined is used as the this value.
2444 */
2445 some(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean;
2446
2447 /**
2448 * Sorts an array.
2449 * @param compareFn The name of the function used to determine the order of the elements. If
2450 * omitted, the elements are sorted in ascending, ASCII character order.
2451 */
2452 sort(compareFn?: (a: number, b: number) => number): this;
2453
2454 /**
2455 * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements
2456 * at begin, inclusive, up to end, exclusive.
2457 * @param begin The index of the beginning of the array.
2458 * @param end The index of the end of the array.
2459 */
2460 subarray(begin: number, end?: number): Uint8ClampedArray;
2461
2462 /**
2463 * Converts a number to a string by using the current locale.
2464 */
2465 toLocaleString(): string;
2466
2467 /**
2468 * Returns a string representation of an array.
2469 */
2470 toString(): string;
2471
2472 [index: number]: number;
2473}
2474
2475interface Uint8ClampedArrayConstructor {
2476 readonly prototype: Uint8ClampedArray;
2477 new(length: number): Uint8ClampedArray;
2478 new(arrayOrArrayBuffer: ArrayLike<number> | ArrayBufferLike): Uint8ClampedArray;
2479 new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint8ClampedArray;
2480
2481 /**
2482 * The size in bytes of each element in the array.
2483 */
2484 readonly BYTES_PER_ELEMENT: number;
2485
2486 /**
2487 * Returns a new array from a set of elements.
2488 * @param items A set of elements to include in the new array object.
2489 */
2490 of(...items: number[]): Uint8ClampedArray;
2491
2492 /**
2493 * Creates an array from an array-like or iterable object.
2494 * @param arrayLike An array-like or iterable object to convert to an array.
2495 */
2496 from(arrayLike: ArrayLike<number>): Uint8ClampedArray;
2497
2498 /**
2499 * Creates an array from an array-like or iterable object.
2500 * @param arrayLike An array-like or iterable object to convert to an array.
2501 * @param mapfn A mapping function to call on every element of the array.
2502 * @param thisArg Value of 'this' used to invoke the mapfn.
2503 */
2504 from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray;
2505}
2506declare var Uint8ClampedArray: Uint8ClampedArrayConstructor;
2507
2508/**
2509 * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the
2510 * requested number of bytes could not be allocated an exception is raised.
2511 */
2512interface Int16Array {
2513 /**
2514 * The size in bytes of each element in the array.
2515 */
2516 readonly BYTES_PER_ELEMENT: number;
2517
2518 /**
2519 * The ArrayBuffer instance referenced by the array.
2520 */
2521 readonly buffer: ArrayBufferLike;
2522
2523 /**
2524 * The length in bytes of the array.
2525 */
2526 readonly byteLength: number;
2527
2528 /**
2529 * The offset in bytes of the array.
2530 */
2531 readonly byteOffset: number;
2532
2533 /**
2534 * Returns the this object after copying a section of the array identified by start and end
2535 * to the same array starting at position target
2536 * @param target If target is negative, it is treated as length+target where length is the
2537 * length of the array.
2538 * @param start If start is negative, it is treated as length+start. If end is negative, it
2539 * is treated as length+end.
2540 * @param end If not specified, length of the this object is used as its default value.
2541 */
2542 copyWithin(target: number, start: number, end?: number): this;
2543
2544 /**
2545 * Determines whether all the members of an array satisfy the specified test.
2546 * @param callbackfn A function that accepts up to three arguments. The every method calls
2547 * the callbackfn function for each element in array1 until the callbackfn returns false,
2548 * or until the end of the array.
2549 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2550 * If thisArg is omitted, undefined is used as the this value.
2551 */
2552 every(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean;
2553
2554 /**
2555 * Returns the this object after filling the section identified by start and end with value
2556 * @param value value to fill array section with
2557 * @param start index to start filling the array at. If start is negative, it is treated as
2558 * length+start where length is the length of the array.
2559 * @param end index to stop filling the array at. If end is negative, it is treated as
2560 * length+end.
2561 */
2562 fill(value: number, start?: number, end?: number): this;
2563
2564 /**
2565 * Returns the elements of an array that meet the condition specified in a callback function.
2566 * @param callbackfn A function that accepts up to three arguments. The filter method calls
2567 * the callbackfn function one time for each element in the array.
2568 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2569 * If thisArg is omitted, undefined is used as the this value.
2570 */
2571 filter(callbackfn: (value: number, index: number, array: Int16Array) => any, thisArg?: any): Int16Array;
2572
2573 /**
2574 * Returns the value of the first element in the array where predicate is true, and undefined
2575 * otherwise.
2576 * @param predicate find calls predicate once for each element of the array, in ascending
2577 * order, until it finds one where predicate returns true. If such an element is found, find
2578 * immediately returns that element value. Otherwise, find returns undefined.
2579 * @param thisArg If provided, it will be used as the this value for each invocation of
2580 * predicate. If it is not provided, undefined is used instead.
2581 */
2582 find(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number | undefined;
2583
2584 /**
2585 * Returns the index of the first element in the array where predicate is true, and -1
2586 * otherwise.
2587 * @param predicate find calls predicate once for each element of the array, in ascending
2588 * order, until it finds one where predicate returns true. If such an element is found,
2589 * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
2590 * @param thisArg If provided, it will be used as the this value for each invocation of
2591 * predicate. If it is not provided, undefined is used instead.
2592 */
2593 findIndex(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number;
2594
2595 /**
2596 * Performs the specified action for each element in an array.
2597 * @param callbackfn A function that accepts up to three arguments. forEach calls the
2598 * callbackfn function one time for each element in the array.
2599 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2600 * If thisArg is omitted, undefined is used as the this value.
2601 */
2602 forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void;
2603 /**
2604 * Returns the index of the first occurrence of a value in an array.
2605 * @param searchElement The value to locate in the array.
2606 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
2607 * search starts at index 0.
2608 */
2609 indexOf(searchElement: number, fromIndex?: number): number;
2610
2611 /**
2612 * Adds all the elements of an array separated by the specified separator string.
2613 * @param separator A string used to separate one element of an array from the next in the
2614 * resulting String. If omitted, the array elements are separated with a comma.
2615 */
2616 join(separator?: string): string;
2617
2618 /**
2619 * Returns the index of the last occurrence of a value in an array.
2620 * @param searchElement The value to locate in the array.
2621 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
2622 * search starts at index 0.
2623 */
2624 lastIndexOf(searchElement: number, fromIndex?: number): number;
2625
2626 /**
2627 * The length of the array.
2628 */
2629 readonly length: number;
2630
2631 /**
2632 * Calls a defined callback function on each element of an array, and returns an array that
2633 * contains the results.
2634 * @param callbackfn A function that accepts up to three arguments. The map method calls the
2635 * callbackfn function one time for each element in the array.
2636 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2637 * If thisArg is omitted, undefined is used as the this value.
2638 */
2639 map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array;
2640
2641 /**
2642 * Calls the specified callback function for all the elements in an array. The return value of
2643 * the callback function is the accumulated result, and is provided as an argument in the next
2644 * call to the callback function.
2645 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
2646 * callbackfn function one time for each element in the array.
2647 * @param initialValue If initialValue is specified, it is used as the initial value to start
2648 * the accumulation. The first call to the callbackfn function provides this value as an argument
2649 * instead of an array value.
2650 */
2651 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;
2652 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;
2653
2654 /**
2655 * Calls the specified callback function for all the elements in an array. The return value of
2656 * the callback function is the accumulated result, and is provided as an argument in the next
2657 * call to the callback function.
2658 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
2659 * callbackfn function one time for each element in the array.
2660 * @param initialValue If initialValue is specified, it is used as the initial value to start
2661 * the accumulation. The first call to the callbackfn function provides this value as an argument
2662 * instead of an array value.
2663 */
2664 reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;
2665
2666 /**
2667 * Calls the specified callback function for all the elements in an array, in descending order.
2668 * The return value of the callback function is the accumulated result, and is provided as an
2669 * argument in the next call to the callback function.
2670 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
2671 * the callbackfn function one time for each element in the array.
2672 * @param initialValue If initialValue is specified, it is used as the initial value to start
2673 * the accumulation. The first call to the callbackfn function provides this value as an
2674 * argument instead of an array value.
2675 */
2676 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;
2677 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;
2678
2679 /**
2680 * Calls the specified callback function for all the elements in an array, in descending order.
2681 * The return value of the callback function is the accumulated result, and is provided as an
2682 * argument in the next call to the callback function.
2683 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
2684 * the callbackfn function one time for each element in the array.
2685 * @param initialValue If initialValue is specified, it is used as the initial value to start
2686 * the accumulation. The first call to the callbackfn function provides this value as an argument
2687 * instead of an array value.
2688 */
2689 reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;
2690
2691 /**
2692 * Reverses the elements in an Array.
2693 */
2694 reverse(): Int16Array;
2695
2696 /**
2697 * Sets a value or an array of values.
2698 * @param array A typed or untyped array of values to set.
2699 * @param offset The index in the current array at which the values are to be written.
2700 */
2701 set(array: ArrayLike<number>, offset?: number): void;
2702
2703 /**
2704 * Returns a section of an array.
2705 * @param start The beginning of the specified portion of the array.
2706 * @param end The end of the specified portion of the array.
2707 */
2708 slice(start?: number, end?: number): Int16Array;
2709
2710 /**
2711 * Determines whether the specified callback function returns true for any element of an array.
2712 * @param callbackfn A function that accepts up to three arguments. The some method calls the
2713 * callbackfn function for each element in array1 until the callbackfn returns true, or until
2714 * the end of the array.
2715 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2716 * If thisArg is omitted, undefined is used as the this value.
2717 */
2718 some(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean;
2719
2720 /**
2721 * Sorts an array.
2722 * @param compareFn The name of the function used to determine the order of the elements. If
2723 * omitted, the elements are sorted in ascending, ASCII character order.
2724 */
2725 sort(compareFn?: (a: number, b: number) => number): this;
2726
2727 /**
2728 * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements
2729 * at begin, inclusive, up to end, exclusive.
2730 * @param begin The index of the beginning of the array.
2731 * @param end The index of the end of the array.
2732 */
2733 subarray(begin: number, end?: number): Int16Array;
2734
2735 /**
2736 * Converts a number to a string by using the current locale.
2737 */
2738 toLocaleString(): string;
2739
2740 /**
2741 * Returns a string representation of an array.
2742 */
2743 toString(): string;
2744
2745 [index: number]: number;
2746}
2747
2748interface Int16ArrayConstructor {
2749 readonly prototype: Int16Array;
2750 new(length: number): Int16Array;
2751 new(arrayOrArrayBuffer: ArrayLike<number> | ArrayBufferLike): Int16Array;
2752 new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int16Array;
2753
2754 /**
2755 * The size in bytes of each element in the array.
2756 */
2757 readonly BYTES_PER_ELEMENT: number;
2758
2759 /**
2760 * Returns a new array from a set of elements.
2761 * @param items A set of elements to include in the new array object.
2762 */
2763 of(...items: number[]): Int16Array;
2764
2765 /**
2766 * Creates an array from an array-like or iterable object.
2767 * @param arrayLike An array-like or iterable object to convert to an array.
2768 */
2769 from(arrayLike: ArrayLike<number>): Int16Array;
2770
2771 /**
2772 * Creates an array from an array-like or iterable object.
2773 * @param arrayLike An array-like or iterable object to convert to an array.
2774 * @param mapfn A mapping function to call on every element of the array.
2775 * @param thisArg Value of 'this' used to invoke the mapfn.
2776 */
2777 from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array;
2778
2779
2780}
2781declare var Int16Array: Int16ArrayConstructor;
2782
2783/**
2784 * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the
2785 * requested number of bytes could not be allocated an exception is raised.
2786 */
2787interface Uint16Array {
2788 /**
2789 * The size in bytes of each element in the array.
2790 */
2791 readonly BYTES_PER_ELEMENT: number;
2792
2793 /**
2794 * The ArrayBuffer instance referenced by the array.
2795 */
2796 readonly buffer: ArrayBufferLike;
2797
2798 /**
2799 * The length in bytes of the array.
2800 */
2801 readonly byteLength: number;
2802
2803 /**
2804 * The offset in bytes of the array.
2805 */
2806 readonly byteOffset: number;
2807
2808 /**
2809 * Returns the this object after copying a section of the array identified by start and end
2810 * to the same array starting at position target
2811 * @param target If target is negative, it is treated as length+target where length is the
2812 * length of the array.
2813 * @param start If start is negative, it is treated as length+start. If end is negative, it
2814 * is treated as length+end.
2815 * @param end If not specified, length of the this object is used as its default value.
2816 */
2817 copyWithin(target: number, start: number, end?: number): this;
2818
2819 /**
2820 * Determines whether all the members of an array satisfy the specified test.
2821 * @param callbackfn A function that accepts up to three arguments. The every method calls
2822 * the callbackfn function for each element in array1 until the callbackfn returns false,
2823 * or until the end of the array.
2824 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2825 * If thisArg is omitted, undefined is used as the this value.
2826 */
2827 every(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean;
2828
2829 /**
2830 * Returns the this object after filling the section identified by start and end with value
2831 * @param value value to fill array section with
2832 * @param start index to start filling the array at. If start is negative, it is treated as
2833 * length+start where length is the length of the array.
2834 * @param end index to stop filling the array at. If end is negative, it is treated as
2835 * length+end.
2836 */
2837 fill(value: number, start?: number, end?: number): this;
2838
2839 /**
2840 * Returns the elements of an array that meet the condition specified in a callback function.
2841 * @param callbackfn A function that accepts up to three arguments. The filter method calls
2842 * the callbackfn function one time for each element in the array.
2843 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2844 * If thisArg is omitted, undefined is used as the this value.
2845 */
2846 filter(callbackfn: (value: number, index: number, array: Uint16Array) => any, thisArg?: any): Uint16Array;
2847
2848 /**
2849 * Returns the value of the first element in the array where predicate is true, and undefined
2850 * otherwise.
2851 * @param predicate find calls predicate once for each element of the array, in ascending
2852 * order, until it finds one where predicate returns true. If such an element is found, find
2853 * immediately returns that element value. Otherwise, find returns undefined.
2854 * @param thisArg If provided, it will be used as the this value for each invocation of
2855 * predicate. If it is not provided, undefined is used instead.
2856 */
2857 find(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number | undefined;
2858
2859 /**
2860 * Returns the index of the first element in the array where predicate is true, and -1
2861 * otherwise.
2862 * @param predicate find calls predicate once for each element of the array, in ascending
2863 * order, until it finds one where predicate returns true. If such an element is found,
2864 * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
2865 * @param thisArg If provided, it will be used as the this value for each invocation of
2866 * predicate. If it is not provided, undefined is used instead.
2867 */
2868 findIndex(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number;
2869
2870 /**
2871 * Performs the specified action for each element in an array.
2872 * @param callbackfn A function that accepts up to three arguments. forEach calls the
2873 * callbackfn function one time for each element in the array.
2874 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2875 * If thisArg is omitted, undefined is used as the this value.
2876 */
2877 forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void;
2878
2879 /**
2880 * Returns the index of the first occurrence of a value in an array.
2881 * @param searchElement The value to locate in the array.
2882 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
2883 * search starts at index 0.
2884 */
2885 indexOf(searchElement: number, fromIndex?: number): number;
2886
2887 /**
2888 * Adds all the elements of an array separated by the specified separator string.
2889 * @param separator A string used to separate one element of an array from the next in the
2890 * resulting String. If omitted, the array elements are separated with a comma.
2891 */
2892 join(separator?: string): string;
2893
2894 /**
2895 * Returns the index of the last occurrence of a value in an array.
2896 * @param searchElement The value to locate in the array.
2897 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
2898 * search starts at index 0.
2899 */
2900 lastIndexOf(searchElement: number, fromIndex?: number): number;
2901
2902 /**
2903 * The length of the array.
2904 */
2905 readonly length: number;
2906
2907 /**
2908 * Calls a defined callback function on each element of an array, and returns an array that
2909 * contains the results.
2910 * @param callbackfn A function that accepts up to three arguments. The map method calls the
2911 * callbackfn function one time for each element in the array.
2912 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2913 * If thisArg is omitted, undefined is used as the this value.
2914 */
2915 map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array;
2916
2917 /**
2918 * Calls the specified callback function for all the elements in an array. The return value of
2919 * the callback function is the accumulated result, and is provided as an argument in the next
2920 * call to the callback function.
2921 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
2922 * callbackfn function one time for each element in the array.
2923 * @param initialValue If initialValue is specified, it is used as the initial value to start
2924 * the accumulation. The first call to the callbackfn function provides this value as an argument
2925 * instead of an array value.
2926 */
2927 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;
2928 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;
2929
2930 /**
2931 * Calls the specified callback function for all the elements in an array. The return value of
2932 * the callback function is the accumulated result, and is provided as an argument in the next
2933 * call to the callback function.
2934 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
2935 * callbackfn function one time for each element in the array.
2936 * @param initialValue If initialValue is specified, it is used as the initial value to start
2937 * the accumulation. The first call to the callbackfn function provides this value as an argument
2938 * instead of an array value.
2939 */
2940 reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;
2941
2942 /**
2943 * Calls the specified callback function for all the elements in an array, in descending order.
2944 * The return value of the callback function is the accumulated result, and is provided as an
2945 * argument in the next call to the callback function.
2946 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
2947 * the callbackfn function one time for each element in the array.
2948 * @param initialValue If initialValue is specified, it is used as the initial value to start
2949 * the accumulation. The first call to the callbackfn function provides this value as an
2950 * argument instead of an array value.
2951 */
2952 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;
2953 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;
2954
2955 /**
2956 * Calls the specified callback function for all the elements in an array, in descending order.
2957 * The return value of the callback function is the accumulated result, and is provided as an
2958 * argument in the next call to the callback function.
2959 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
2960 * the callbackfn function one time for each element in the array.
2961 * @param initialValue If initialValue is specified, it is used as the initial value to start
2962 * the accumulation. The first call to the callbackfn function provides this value as an argument
2963 * instead of an array value.
2964 */
2965 reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;
2966
2967 /**
2968 * Reverses the elements in an Array.
2969 */
2970 reverse(): Uint16Array;
2971
2972 /**
2973 * Sets a value or an array of values.
2974 * @param array A typed or untyped array of values to set.
2975 * @param offset The index in the current array at which the values are to be written.
2976 */
2977 set(array: ArrayLike<number>, offset?: number): void;
2978
2979 /**
2980 * Returns a section of an array.
2981 * @param start The beginning of the specified portion of the array.
2982 * @param end The end of the specified portion of the array.
2983 */
2984 slice(start?: number, end?: number): Uint16Array;
2985
2986 /**
2987 * Determines whether the specified callback function returns true for any element of an array.
2988 * @param callbackfn A function that accepts up to three arguments. The some method calls the
2989 * callbackfn function for each element in array1 until the callbackfn returns true, or until
2990 * the end of the array.
2991 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2992 * If thisArg is omitted, undefined is used as the this value.
2993 */
2994 some(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean;
2995
2996 /**
2997 * Sorts an array.
2998 * @param compareFn The name of the function used to determine the order of the elements. If
2999 * omitted, the elements are sorted in ascending, ASCII character order.
3000 */
3001 sort(compareFn?: (a: number, b: number) => number): this;
3002
3003 /**
3004 * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements
3005 * at begin, inclusive, up to end, exclusive.
3006 * @param begin The index of the beginning of the array.
3007 * @param end The index of the end of the array.
3008 */
3009 subarray(begin: number, end?: number): Uint16Array;
3010
3011 /**
3012 * Converts a number to a string by using the current locale.
3013 */
3014 toLocaleString(): string;
3015
3016 /**
3017 * Returns a string representation of an array.
3018 */
3019 toString(): string;
3020
3021 [index: number]: number;
3022}
3023
3024interface Uint16ArrayConstructor {
3025 readonly prototype: Uint16Array;
3026 new(length: number): Uint16Array;
3027 new(arrayOrArrayBuffer: ArrayLike<number> | ArrayBufferLike): Uint16Array;
3028 new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint16Array;
3029
3030 /**
3031 * The size in bytes of each element in the array.
3032 */
3033 readonly BYTES_PER_ELEMENT: number;
3034
3035 /**
3036 * Returns a new array from a set of elements.
3037 * @param items A set of elements to include in the new array object.
3038 */
3039 of(...items: number[]): Uint16Array;
3040
3041 /**
3042 * Creates an array from an array-like or iterable object.
3043 * @param arrayLike An array-like or iterable object to convert to an array.
3044 */
3045 from(arrayLike: ArrayLike<number>): Uint16Array;
3046
3047 /**
3048 * Creates an array from an array-like or iterable object.
3049 * @param arrayLike An array-like or iterable object to convert to an array.
3050 * @param mapfn A mapping function to call on every element of the array.
3051 * @param thisArg Value of 'this' used to invoke the mapfn.
3052 */
3053 from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array;
3054
3055
3056}
3057declare var Uint16Array: Uint16ArrayConstructor;
3058/**
3059 * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the
3060 * requested number of bytes could not be allocated an exception is raised.
3061 */
3062interface Int32Array {
3063 /**
3064 * The size in bytes of each element in the array.
3065 */
3066 readonly BYTES_PER_ELEMENT: number;
3067
3068 /**
3069 * The ArrayBuffer instance referenced by the array.
3070 */
3071 readonly buffer: ArrayBufferLike;
3072
3073 /**
3074 * The length in bytes of the array.
3075 */
3076 readonly byteLength: number;
3077
3078 /**
3079 * The offset in bytes of the array.
3080 */
3081 readonly byteOffset: number;
3082
3083 /**
3084 * Returns the this object after copying a section of the array identified by start and end
3085 * to the same array starting at position target
3086 * @param target If target is negative, it is treated as length+target where length is the
3087 * length of the array.
3088 * @param start If start is negative, it is treated as length+start. If end is negative, it
3089 * is treated as length+end.
3090 * @param end If not specified, length of the this object is used as its default value.
3091 */
3092 copyWithin(target: number, start: number, end?: number): this;
3093
3094 /**
3095 * Determines whether all the members of an array satisfy the specified test.
3096 * @param callbackfn A function that accepts up to three arguments. The every method calls
3097 * the callbackfn function for each element in array1 until the callbackfn returns false,
3098 * or until the end of the array.
3099 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3100 * If thisArg is omitted, undefined is used as the this value.
3101 */
3102 every(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean;
3103
3104 /**
3105 * Returns the this object after filling the section identified by start and end with value
3106 * @param value value to fill array section with
3107 * @param start index to start filling the array at. If start is negative, it is treated as
3108 * length+start where length is the length of the array.
3109 * @param end index to stop filling the array at. If end is negative, it is treated as
3110 * length+end.
3111 */
3112 fill(value: number, start?: number, end?: number): this;
3113
3114 /**
3115 * Returns the elements of an array that meet the condition specified in a callback function.
3116 * @param callbackfn A function that accepts up to three arguments. The filter method calls
3117 * the callbackfn function one time for each element in the array.
3118 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3119 * If thisArg is omitted, undefined is used as the this value.
3120 */
3121 filter(callbackfn: (value: number, index: number, array: Int32Array) => any, thisArg?: any): Int32Array;
3122
3123 /**
3124 * Returns the value of the first element in the array where predicate is true, and undefined
3125 * otherwise.
3126 * @param predicate find calls predicate once for each element of the array, in ascending
3127 * order, until it finds one where predicate returns true. If such an element is found, find
3128 * immediately returns that element value. Otherwise, find returns undefined.
3129 * @param thisArg If provided, it will be used as the this value for each invocation of
3130 * predicate. If it is not provided, undefined is used instead.
3131 */
3132 find(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number | undefined;
3133
3134 /**
3135 * Returns the index of the first element in the array where predicate is true, and -1
3136 * otherwise.
3137 * @param predicate find calls predicate once for each element of the array, in ascending
3138 * order, until it finds one where predicate returns true. If such an element is found,
3139 * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
3140 * @param thisArg If provided, it will be used as the this value for each invocation of
3141 * predicate. If it is not provided, undefined is used instead.
3142 */
3143 findIndex(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number;
3144
3145 /**
3146 * Performs the specified action for each element in an array.
3147 * @param callbackfn A function that accepts up to three arguments. forEach calls the
3148 * callbackfn function one time for each element in the array.
3149 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3150 * If thisArg is omitted, undefined is used as the this value.
3151 */
3152 forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void;
3153
3154 /**
3155 * Returns the index of the first occurrence of a value in an array.
3156 * @param searchElement The value to locate in the array.
3157 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
3158 * search starts at index 0.
3159 */
3160 indexOf(searchElement: number, fromIndex?: number): number;
3161
3162 /**
3163 * Adds all the elements of an array separated by the specified separator string.
3164 * @param separator A string used to separate one element of an array from the next in the
3165 * resulting String. If omitted, the array elements are separated with a comma.
3166 */
3167 join(separator?: string): string;
3168
3169 /**
3170 * Returns the index of the last occurrence of a value in an array.
3171 * @param searchElement The value to locate in the array.
3172 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
3173 * search starts at index 0.
3174 */
3175 lastIndexOf(searchElement: number, fromIndex?: number): number;
3176
3177 /**
3178 * The length of the array.
3179 */
3180 readonly length: number;
3181
3182 /**
3183 * Calls a defined callback function on each element of an array, and returns an array that
3184 * contains the results.
3185 * @param callbackfn A function that accepts up to three arguments. The map method calls the
3186 * callbackfn function one time for each element in the array.
3187 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3188 * If thisArg is omitted, undefined is used as the this value.
3189 */
3190 map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array;
3191
3192 /**
3193 * Calls the specified callback function for all the elements in an array. The return value of
3194 * the callback function is the accumulated result, and is provided as an argument in the next
3195 * call to the callback function.
3196 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
3197 * callbackfn function one time for each element in the array.
3198 * @param initialValue If initialValue is specified, it is used as the initial value to start
3199 * the accumulation. The first call to the callbackfn function provides this value as an argument
3200 * instead of an array value.
3201 */
3202 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;
3203 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;
3204
3205 /**
3206 * Calls the specified callback function for all the elements in an array. The return value of
3207 * the callback function is the accumulated result, and is provided as an argument in the next
3208 * call to the callback function.
3209 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
3210 * callbackfn function one time for each element in the array.
3211 * @param initialValue If initialValue is specified, it is used as the initial value to start
3212 * the accumulation. The first call to the callbackfn function provides this value as an argument
3213 * instead of an array value.
3214 */
3215 reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;
3216
3217 /**
3218 * Calls the specified callback function for all the elements in an array, in descending order.
3219 * The return value of the callback function is the accumulated result, and is provided as an
3220 * argument in the next call to the callback function.
3221 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
3222 * the callbackfn function one time for each element in the array.
3223 * @param initialValue If initialValue is specified, it is used as the initial value to start
3224 * the accumulation. The first call to the callbackfn function provides this value as an
3225 * argument instead of an array value.
3226 */
3227 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;
3228 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;
3229
3230 /**
3231 * Calls the specified callback function for all the elements in an array, in descending order.
3232 * The return value of the callback function is the accumulated result, and is provided as an
3233 * argument in the next call to the callback function.
3234 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
3235 * the callbackfn function one time for each element in the array.
3236 * @param initialValue If initialValue is specified, it is used as the initial value to start
3237 * the accumulation. The first call to the callbackfn function provides this value as an argument
3238 * instead of an array value.
3239 */
3240 reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;
3241
3242 /**
3243 * Reverses the elements in an Array.
3244 */
3245 reverse(): Int32Array;
3246
3247 /**
3248 * Sets a value or an array of values.
3249 * @param array A typed or untyped array of values to set.
3250 * @param offset The index in the current array at which the values are to be written.
3251 */
3252 set(array: ArrayLike<number>, offset?: number): void;
3253
3254 /**
3255 * Returns a section of an array.
3256 * @param start The beginning of the specified portion of the array.
3257 * @param end The end of the specified portion of the array.
3258 */
3259 slice(start?: number, end?: number): Int32Array;
3260
3261 /**
3262 * Determines whether the specified callback function returns true for any element of an array.
3263 * @param callbackfn A function that accepts up to three arguments. The some method calls the
3264 * callbackfn function for each element in array1 until the callbackfn returns true, or until
3265 * the end of the array.
3266 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3267 * If thisArg is omitted, undefined is used as the this value.
3268 */
3269 some(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean;
3270
3271 /**
3272 * Sorts an array.
3273 * @param compareFn The name of the function used to determine the order of the elements. If
3274 * omitted, the elements are sorted in ascending, ASCII character order.
3275 */
3276 sort(compareFn?: (a: number, b: number) => number): this;
3277
3278 /**
3279 * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements
3280 * at begin, inclusive, up to end, exclusive.
3281 * @param begin The index of the beginning of the array.
3282 * @param end The index of the end of the array.
3283 */
3284 subarray(begin: number, end?: number): Int32Array;
3285
3286 /**
3287 * Converts a number to a string by using the current locale.
3288 */
3289 toLocaleString(): string;
3290
3291 /**
3292 * Returns a string representation of an array.
3293 */
3294 toString(): string;
3295
3296 [index: number]: number;
3297}
3298
3299interface Int32ArrayConstructor {
3300 readonly prototype: Int32Array;
3301 new(length: number): Int32Array;
3302 new(arrayOrArrayBuffer: ArrayLike<number> | ArrayBufferLike): Int32Array;
3303 new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int32Array;
3304
3305 /**
3306 * The size in bytes of each element in the array.
3307 */
3308 readonly BYTES_PER_ELEMENT: number;
3309
3310 /**
3311 * Returns a new array from a set of elements.
3312 * @param items A set of elements to include in the new array object.
3313 */
3314 of(...items: number[]): Int32Array;
3315
3316 /**
3317 * Creates an array from an array-like or iterable object.
3318 * @param arrayLike An array-like or iterable object to convert to an array.
3319 */
3320 from(arrayLike: ArrayLike<number>): Int32Array;
3321
3322 /**
3323 * Creates an array from an array-like or iterable object.
3324 * @param arrayLike An array-like or iterable object to convert to an array.
3325 * @param mapfn A mapping function to call on every element of the array.
3326 * @param thisArg Value of 'this' used to invoke the mapfn.
3327 */
3328 from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array;
3329
3330}
3331declare var Int32Array: Int32ArrayConstructor;
3332
3333/**
3334 * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the
3335 * requested number of bytes could not be allocated an exception is raised.
3336 */
3337interface Uint32Array {
3338 /**
3339 * The size in bytes of each element in the array.
3340 */
3341 readonly BYTES_PER_ELEMENT: number;
3342
3343 /**
3344 * The ArrayBuffer instance referenced by the array.
3345 */
3346 readonly buffer: ArrayBufferLike;
3347
3348 /**
3349 * The length in bytes of the array.
3350 */
3351 readonly byteLength: number;
3352
3353 /**
3354 * The offset in bytes of the array.
3355 */
3356 readonly byteOffset: number;
3357
3358 /**
3359 * Returns the this object after copying a section of the array identified by start and end
3360 * to the same array starting at position target
3361 * @param target If target is negative, it is treated as length+target where length is the
3362 * length of the array.
3363 * @param start If start is negative, it is treated as length+start. If end is negative, it
3364 * is treated as length+end.
3365 * @param end If not specified, length of the this object is used as its default value.
3366 */
3367 copyWithin(target: number, start: number, end?: number): this;
3368
3369 /**
3370 * Determines whether all the members of an array satisfy the specified test.
3371 * @param callbackfn A function that accepts up to three arguments. The every method calls
3372 * the callbackfn function for each element in array1 until the callbackfn returns false,
3373 * or until the end of the array.
3374 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3375 * If thisArg is omitted, undefined is used as the this value.
3376 */
3377 every(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean;
3378
3379 /**
3380 * Returns the this object after filling the section identified by start and end with value
3381 * @param value value to fill array section with
3382 * @param start index to start filling the array at. If start is negative, it is treated as
3383 * length+start where length is the length of the array.
3384 * @param end index to stop filling the array at. If end is negative, it is treated as
3385 * length+end.
3386 */
3387 fill(value: number, start?: number, end?: number): this;
3388
3389 /**
3390 * Returns the elements of an array that meet the condition specified in a callback function.
3391 * @param callbackfn A function that accepts up to three arguments. The filter method calls
3392 * the callbackfn function one time for each element in the array.
3393 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3394 * If thisArg is omitted, undefined is used as the this value.
3395 */
3396 filter(callbackfn: (value: number, index: number, array: Uint32Array) => any, thisArg?: any): Uint32Array;
3397
3398 /**
3399 * Returns the value of the first element in the array where predicate is true, and undefined
3400 * otherwise.
3401 * @param predicate find calls predicate once for each element of the array, in ascending
3402 * order, until it finds one where predicate returns true. If such an element is found, find
3403 * immediately returns that element value. Otherwise, find returns undefined.
3404 * @param thisArg If provided, it will be used as the this value for each invocation of
3405 * predicate. If it is not provided, undefined is used instead.
3406 */
3407 find(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number | undefined;
3408
3409 /**
3410 * Returns the index of the first element in the array where predicate is true, and -1
3411 * otherwise.
3412 * @param predicate find calls predicate once for each element of the array, in ascending
3413 * order, until it finds one where predicate returns true. If such an element is found,
3414 * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
3415 * @param thisArg If provided, it will be used as the this value for each invocation of
3416 * predicate. If it is not provided, undefined is used instead.
3417 */
3418 findIndex(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number;
3419
3420 /**
3421 * Performs the specified action for each element in an array.
3422 * @param callbackfn A function that accepts up to three arguments. forEach calls the
3423 * callbackfn function one time for each element in the array.
3424 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3425 * If thisArg is omitted, undefined is used as the this value.
3426 */
3427 forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void;
3428 /**
3429 * Returns the index of the first occurrence of a value in an array.
3430 * @param searchElement The value to locate in the array.
3431 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
3432 * search starts at index 0.
3433 */
3434 indexOf(searchElement: number, fromIndex?: number): number;
3435
3436 /**
3437 * Adds all the elements of an array separated by the specified separator string.
3438 * @param separator A string used to separate one element of an array from the next in the
3439 * resulting String. If omitted, the array elements are separated with a comma.
3440 */
3441 join(separator?: string): string;
3442
3443 /**
3444 * Returns the index of the last occurrence of a value in an array.
3445 * @param searchElement The value to locate in the array.
3446 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
3447 * search starts at index 0.
3448 */
3449 lastIndexOf(searchElement: number, fromIndex?: number): number;
3450
3451 /**
3452 * The length of the array.
3453 */
3454 readonly length: number;
3455
3456 /**
3457 * Calls a defined callback function on each element of an array, and returns an array that
3458 * contains the results.
3459 * @param callbackfn A function that accepts up to three arguments. The map method calls the
3460 * callbackfn function one time for each element in the array.
3461 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3462 * If thisArg is omitted, undefined is used as the this value.
3463 */
3464 map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array;
3465
3466 /**
3467 * Calls the specified callback function for all the elements in an array. The return value of
3468 * the callback function is the accumulated result, and is provided as an argument in the next
3469 * call to the callback function.
3470 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
3471 * callbackfn function one time for each element in the array.
3472 * @param initialValue If initialValue is specified, it is used as the initial value to start
3473 * the accumulation. The first call to the callbackfn function provides this value as an argument
3474 * instead of an array value.
3475 */
3476 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;
3477 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;
3478
3479 /**
3480 * Calls the specified callback function for all the elements in an array. The return value of
3481 * the callback function is the accumulated result, and is provided as an argument in the next
3482 * call to the callback function.
3483 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
3484 * callbackfn function one time for each element in the array.
3485 * @param initialValue If initialValue is specified, it is used as the initial value to start
3486 * the accumulation. The first call to the callbackfn function provides this value as an argument
3487 * instead of an array value.
3488 */
3489 reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;
3490
3491 /**
3492 * Calls the specified callback function for all the elements in an array, in descending order.
3493 * The return value of the callback function is the accumulated result, and is provided as an
3494 * argument in the next call to the callback function.
3495 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
3496 * the callbackfn function one time for each element in the array.
3497 * @param initialValue If initialValue is specified, it is used as the initial value to start
3498 * the accumulation. The first call to the callbackfn function provides this value as an
3499 * argument instead of an array value.
3500 */
3501 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;
3502 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;
3503
3504 /**
3505 * Calls the specified callback function for all the elements in an array, in descending order.
3506 * The return value of the callback function is the accumulated result, and is provided as an
3507 * argument in the next call to the callback function.
3508 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
3509 * the callbackfn function one time for each element in the array.
3510 * @param initialValue If initialValue is specified, it is used as the initial value to start
3511 * the accumulation. The first call to the callbackfn function provides this value as an argument
3512 * instead of an array value.
3513 */
3514 reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;
3515
3516 /**
3517 * Reverses the elements in an Array.
3518 */
3519 reverse(): Uint32Array;
3520
3521 /**
3522 * Sets a value or an array of values.
3523 * @param array A typed or untyped array of values to set.
3524 * @param offset The index in the current array at which the values are to be written.
3525 */
3526 set(array: ArrayLike<number>, offset?: number): void;
3527
3528 /**
3529 * Returns a section of an array.
3530 * @param start The beginning of the specified portion of the array.
3531 * @param end The end of the specified portion of the array.
3532 */
3533 slice(start?: number, end?: number): Uint32Array;
3534
3535 /**
3536 * Determines whether the specified callback function returns true for any element of an array.
3537 * @param callbackfn A function that accepts up to three arguments. The some method calls the
3538 * callbackfn function for each element in array1 until the callbackfn returns true, or until
3539 * the end of the array.
3540 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3541 * If thisArg is omitted, undefined is used as the this value.
3542 */
3543 some(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean;
3544
3545 /**
3546 * Sorts an array.
3547 * @param compareFn The name of the function used to determine the order of the elements. If
3548 * omitted, the elements are sorted in ascending, ASCII character order.
3549 */
3550 sort(compareFn?: (a: number, b: number) => number): this;
3551
3552 /**
3553 * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements
3554 * at begin, inclusive, up to end, exclusive.
3555 * @param begin The index of the beginning of the array.
3556 * @param end The index of the end of the array.
3557 */
3558 subarray(begin: number, end?: number): Uint32Array;
3559
3560 /**
3561 * Converts a number to a string by using the current locale.
3562 */
3563 toLocaleString(): string;
3564
3565 /**
3566 * Returns a string representation of an array.
3567 */
3568 toString(): string;
3569
3570 [index: number]: number;
3571}
3572
3573interface Uint32ArrayConstructor {
3574 readonly prototype: Uint32Array;
3575 new(length: number): Uint32Array;
3576 new(arrayOrArrayBuffer: ArrayLike<number> | ArrayBufferLike): Uint32Array;
3577 new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint32Array;
3578
3579 /**
3580 * The size in bytes of each element in the array.
3581 */
3582 readonly BYTES_PER_ELEMENT: number;
3583
3584 /**
3585 * Returns a new array from a set of elements.
3586 * @param items A set of elements to include in the new array object.
3587 */
3588 of(...items: number[]): Uint32Array;
3589
3590 /**
3591 * Creates an array from an array-like or iterable object.
3592 * @param arrayLike An array-like or iterable object to convert to an array.
3593 */
3594 from(arrayLike: ArrayLike<number>): Uint32Array;
3595
3596 /**
3597 * Creates an array from an array-like or iterable object.
3598 * @param arrayLike An array-like or iterable object to convert to an array.
3599 * @param mapfn A mapping function to call on every element of the array.
3600 * @param thisArg Value of 'this' used to invoke the mapfn.
3601 */
3602 from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array;
3603
3604}
3605declare var Uint32Array: Uint32ArrayConstructor;
3606
3607/**
3608 * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number
3609 * of bytes could not be allocated an exception is raised.
3610 */
3611interface Float32Array {
3612 /**
3613 * The size in bytes of each element in the array.
3614 */
3615 readonly BYTES_PER_ELEMENT: number;
3616
3617 /**
3618 * The ArrayBuffer instance referenced by the array.
3619 */
3620 readonly buffer: ArrayBufferLike;
3621
3622 /**
3623 * The length in bytes of the array.
3624 */
3625 readonly byteLength: number;
3626
3627 /**
3628 * The offset in bytes of the array.
3629 */
3630 readonly byteOffset: number;
3631
3632 /**
3633 * Returns the this object after copying a section of the array identified by start and end
3634 * to the same array starting at position target
3635 * @param target If target is negative, it is treated as length+target where length is the
3636 * length of the array.
3637 * @param start If start is negative, it is treated as length+start. If end is negative, it
3638 * is treated as length+end.
3639 * @param end If not specified, length of the this object is used as its default value.
3640 */
3641 copyWithin(target: number, start: number, end?: number): this;
3642
3643 /**
3644 * Determines whether all the members of an array satisfy the specified test.
3645 * @param callbackfn A function that accepts up to three arguments. The every method calls
3646 * the callbackfn function for each element in array1 until the callbackfn returns false,
3647 * or until the end of the array.
3648 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3649 * If thisArg is omitted, undefined is used as the this value.
3650 */
3651 every(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean;
3652
3653 /**
3654 * Returns the this object after filling the section identified by start and end with value
3655 * @param value value to fill array section with
3656 * @param start index to start filling the array at. If start is negative, it is treated as
3657 * length+start where length is the length of the array.
3658 * @param end index to stop filling the array at. If end is negative, it is treated as
3659 * length+end.
3660 */
3661 fill(value: number, start?: number, end?: number): this;
3662
3663 /**
3664 * Returns the elements of an array that meet the condition specified in a callback function.
3665 * @param callbackfn A function that accepts up to three arguments. The filter method calls
3666 * the callbackfn function one time for each element in the array.
3667 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3668 * If thisArg is omitted, undefined is used as the this value.
3669 */
3670 filter(callbackfn: (value: number, index: number, array: Float32Array) => any, thisArg?: any): Float32Array;
3671
3672 /**
3673 * Returns the value of the first element in the array where predicate is true, and undefined
3674 * otherwise.
3675 * @param predicate find calls predicate once for each element of the array, in ascending
3676 * order, until it finds one where predicate returns true. If such an element is found, find
3677 * immediately returns that element value. Otherwise, find returns undefined.
3678 * @param thisArg If provided, it will be used as the this value for each invocation of
3679 * predicate. If it is not provided, undefined is used instead.
3680 */
3681 find(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number | undefined;
3682
3683 /**
3684 * Returns the index of the first element in the array where predicate is true, and -1
3685 * otherwise.
3686 * @param predicate find calls predicate once for each element of the array, in ascending
3687 * order, until it finds one where predicate returns true. If such an element is found,
3688 * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
3689 * @param thisArg If provided, it will be used as the this value for each invocation of
3690 * predicate. If it is not provided, undefined is used instead.
3691 */
3692 findIndex(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number;
3693
3694 /**
3695 * Performs the specified action for each element in an array.
3696 * @param callbackfn A function that accepts up to three arguments. forEach calls the
3697 * callbackfn function one time for each element in the array.
3698 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3699 * If thisArg is omitted, undefined is used as the this value.
3700 */
3701 forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void;
3702
3703 /**
3704 * Returns the index of the first occurrence of a value in an array.
3705 * @param searchElement The value to locate in the array.
3706 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
3707 * search starts at index 0.
3708 */
3709 indexOf(searchElement: number, fromIndex?: number): number;
3710
3711 /**
3712 * Adds all the elements of an array separated by the specified separator string.
3713 * @param separator A string used to separate one element of an array from the next in the
3714 * resulting String. If omitted, the array elements are separated with a comma.
3715 */
3716 join(separator?: string): string;
3717
3718 /**
3719 * Returns the index of the last occurrence of a value in an array.
3720 * @param searchElement The value to locate in the array.
3721 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
3722 * search starts at index 0.
3723 */
3724 lastIndexOf(searchElement: number, fromIndex?: number): number;
3725
3726 /**
3727 * The length of the array.
3728 */
3729 readonly length: number;
3730
3731 /**
3732 * Calls a defined callback function on each element of an array, and returns an array that
3733 * contains the results.
3734 * @param callbackfn A function that accepts up to three arguments. The map method calls the
3735 * callbackfn function one time for each element in the array.
3736 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3737 * If thisArg is omitted, undefined is used as the this value.
3738 */
3739 map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array;
3740
3741 /**
3742 * Calls the specified callback function for all the elements in an array. The return value of
3743 * the callback function is the accumulated result, and is provided as an argument in the next
3744 * call to the callback function.
3745 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
3746 * callbackfn function one time for each element in the array.
3747 * @param initialValue If initialValue is specified, it is used as the initial value to start
3748 * the accumulation. The first call to the callbackfn function provides this value as an argument
3749 * instead of an array value.
3750 */
3751 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;
3752 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;
3753
3754 /**
3755 * Calls the specified callback function for all the elements in an array. The return value of
3756 * the callback function is the accumulated result, and is provided as an argument in the next
3757 * call to the callback function.
3758 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
3759 * callbackfn function one time for each element in the array.
3760 * @param initialValue If initialValue is specified, it is used as the initial value to start
3761 * the accumulation. The first call to the callbackfn function provides this value as an argument
3762 * instead of an array value.
3763 */
3764 reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;
3765
3766 /**
3767 * Calls the specified callback function for all the elements in an array, in descending order.
3768 * The return value of the callback function is the accumulated result, and is provided as an
3769 * argument in the next call to the callback function.
3770 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
3771 * the callbackfn function one time for each element in the array.
3772 * @param initialValue If initialValue is specified, it is used as the initial value to start
3773 * the accumulation. The first call to the callbackfn function provides this value as an
3774 * argument instead of an array value.
3775 */
3776 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;
3777 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;
3778
3779 /**
3780 * Calls the specified callback function for all the elements in an array, in descending order.
3781 * The return value of the callback function is the accumulated result, and is provided as an
3782 * argument in the next call to the callback function.
3783 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
3784 * the callbackfn function one time for each element in the array.
3785 * @param initialValue If initialValue is specified, it is used as the initial value to start
3786 * the accumulation. The first call to the callbackfn function provides this value as an argument
3787 * instead of an array value.
3788 */
3789 reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;
3790
3791 /**
3792 * Reverses the elements in an Array.
3793 */
3794 reverse(): Float32Array;
3795
3796 /**
3797 * Sets a value or an array of values.
3798 * @param array A typed or untyped array of values to set.
3799 * @param offset The index in the current array at which the values are to be written.
3800 */
3801 set(array: ArrayLike<number>, offset?: number): void;
3802
3803 /**
3804 * Returns a section of an array.
3805 * @param start The beginning of the specified portion of the array.
3806 * @param end The end of the specified portion of the array.
3807 */
3808 slice(start?: number, end?: number): Float32Array;
3809
3810 /**
3811 * Determines whether the specified callback function returns true for any element of an array.
3812 * @param callbackfn A function that accepts up to three arguments. The some method calls the
3813 * callbackfn function for each element in array1 until the callbackfn returns true, or until
3814 * the end of the array.
3815 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3816 * If thisArg is omitted, undefined is used as the this value.
3817 */
3818 some(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean;
3819
3820 /**
3821 * Sorts an array.
3822 * @param compareFn The name of the function used to determine the order of the elements. If
3823 * omitted, the elements are sorted in ascending, ASCII character order.
3824 */
3825 sort(compareFn?: (a: number, b: number) => number): this;
3826
3827 /**
3828 * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements
3829 * at begin, inclusive, up to end, exclusive.
3830 * @param begin The index of the beginning of the array.
3831 * @param end The index of the end of the array.
3832 */
3833 subarray(begin: number, end?: number): Float32Array;
3834
3835 /**
3836 * Converts a number to a string by using the current locale.
3837 */
3838 toLocaleString(): string;
3839
3840 /**
3841 * Returns a string representation of an array.
3842 */
3843 toString(): string;
3844
3845 [index: number]: number;
3846}
3847
3848interface Float32ArrayConstructor {
3849 readonly prototype: Float32Array;
3850 new(length: number): Float32Array;
3851 new(arrayOrArrayBuffer: ArrayLike<number> | ArrayBufferLike): Float32Array;
3852 new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Float32Array;
3853
3854 /**
3855 * The size in bytes of each element in the array.
3856 */
3857 readonly BYTES_PER_ELEMENT: number;
3858
3859 /**
3860 * Returns a new array from a set of elements.
3861 * @param items A set of elements to include in the new array object.
3862 */
3863 of(...items: number[]): Float32Array;
3864
3865 /**
3866 * Creates an array from an array-like or iterable object.
3867 * @param arrayLike An array-like or iterable object to convert to an array.
3868 */
3869 from(arrayLike: ArrayLike<number>): Float32Array;
3870
3871 /**
3872 * Creates an array from an array-like or iterable object.
3873 * @param arrayLike An array-like or iterable object to convert to an array.
3874 * @param mapfn A mapping function to call on every element of the array.
3875 * @param thisArg Value of 'this' used to invoke the mapfn.
3876 */
3877 from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array;
3878
3879
3880}
3881declare var Float32Array: Float32ArrayConstructor;
3882
3883/**
3884 * A typed array of 64-bit float values. The contents are initialized to 0. If the requested
3885 * number of bytes could not be allocated an exception is raised.
3886 */
3887interface Float64Array {
3888 /**
3889 * The size in bytes of each element in the array.
3890 */
3891 readonly BYTES_PER_ELEMENT: number;
3892
3893 /**
3894 * The ArrayBuffer instance referenced by the array.
3895 */
3896 readonly buffer: ArrayBufferLike;
3897
3898 /**
3899 * The length in bytes of the array.
3900 */
3901 readonly byteLength: number;
3902
3903 /**
3904 * The offset in bytes of the array.
3905 */
3906 readonly byteOffset: number;
3907
3908 /**
3909 * Returns the this object after copying a section of the array identified by start and end
3910 * to the same array starting at position target
3911 * @param target If target is negative, it is treated as length+target where length is the
3912 * length of the array.
3913 * @param start If start is negative, it is treated as length+start. If end is negative, it
3914 * is treated as length+end.
3915 * @param end If not specified, length of the this object is used as its default value.
3916 */
3917 copyWithin(target: number, start: number, end?: number): this;
3918
3919 /**
3920 * Determines whether all the members of an array satisfy the specified test.
3921 * @param callbackfn A function that accepts up to three arguments. The every method calls
3922 * the callbackfn function for each element in array1 until the callbackfn returns false,
3923 * or until the end of the array.
3924 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3925 * If thisArg is omitted, undefined is used as the this value.
3926 */
3927 every(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean;
3928
3929 /**
3930 * Returns the this object after filling the section identified by start and end with value
3931 * @param value value to fill array section with
3932 * @param start index to start filling the array at. If start is negative, it is treated as
3933 * length+start where length is the length of the array.
3934 * @param end index to stop filling the array at. If end is negative, it is treated as
3935 * length+end.
3936 */
3937 fill(value: number, start?: number, end?: number): this;
3938
3939 /**
3940 * Returns the elements of an array that meet the condition specified in a callback function.
3941 * @param callbackfn A function that accepts up to three arguments. The filter method calls
3942 * the callbackfn function one time for each element in the array.
3943 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3944 * If thisArg is omitted, undefined is used as the this value.
3945 */
3946 filter(callbackfn: (value: number, index: number, array: Float64Array) => any, thisArg?: any): Float64Array;
3947
3948 /**
3949 * Returns the value of the first element in the array where predicate is true, and undefined
3950 * otherwise.
3951 * @param predicate find calls predicate once for each element of the array, in ascending
3952 * order, until it finds one where predicate returns true. If such an element is found, find
3953 * immediately returns that element value. Otherwise, find returns undefined.
3954 * @param thisArg If provided, it will be used as the this value for each invocation of
3955 * predicate. If it is not provided, undefined is used instead.
3956 */
3957 find(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number | undefined;
3958
3959 /**
3960 * Returns the index of the first element in the array where predicate is true, and -1
3961 * otherwise.
3962 * @param predicate find calls predicate once for each element of the array, in ascending
3963 * order, until it finds one where predicate returns true. If such an element is found,
3964 * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
3965 * @param thisArg If provided, it will be used as the this value for each invocation of
3966 * predicate. If it is not provided, undefined is used instead.
3967 */
3968 findIndex(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number;
3969
3970 /**
3971 * Performs the specified action for each element in an array.
3972 * @param callbackfn A function that accepts up to three arguments. forEach calls the
3973 * callbackfn function one time for each element in the array.
3974 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3975 * If thisArg is omitted, undefined is used as the this value.
3976 */
3977 forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void;
3978
3979 /**
3980 * Returns the index of the first occurrence of a value in an array.
3981 * @param searchElement The value to locate in the array.
3982 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
3983 * search starts at index 0.
3984 */
3985 indexOf(searchElement: number, fromIndex?: number): number;
3986
3987 /**
3988 * Adds all the elements of an array separated by the specified separator string.
3989 * @param separator A string used to separate one element of an array from the next in the
3990 * resulting String. If omitted, the array elements are separated with a comma.
3991 */
3992 join(separator?: string): string;
3993
3994 /**
3995 * Returns the index of the last occurrence of a value in an array.
3996 * @param searchElement The value to locate in the array.
3997 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
3998 * search starts at index 0.
3999 */
4000 lastIndexOf(searchElement: number, fromIndex?: number): number;
4001
4002 /**
4003 * The length of the array.
4004 */
4005 readonly length: number;
4006
4007 /**
4008 * Calls a defined callback function on each element of an array, and returns an array that
4009 * contains the results.
4010 * @param callbackfn A function that accepts up to three arguments. The map method calls the
4011 * callbackfn function one time for each element in the array.
4012 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
4013 * If thisArg is omitted, undefined is used as the this value.
4014 */
4015 map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array;
4016
4017 /**
4018 * Calls the specified callback function for all the elements in an array. The return value of
4019 * the callback function is the accumulated result, and is provided as an argument in the next
4020 * call to the callback function.
4021 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
4022 * callbackfn function one time for each element in the array.
4023 * @param initialValue If initialValue is specified, it is used as the initial value to start
4024 * the accumulation. The first call to the callbackfn function provides this value as an argument
4025 * instead of an array value.
4026 */
4027 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;
4028 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;
4029
4030 /**
4031 * Calls the specified callback function for all the elements in an array. The return value of
4032 * the callback function is the accumulated result, and is provided as an argument in the next
4033 * call to the callback function.
4034 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
4035 * callbackfn function one time for each element in the array.
4036 * @param initialValue If initialValue is specified, it is used as the initial value to start
4037 * the accumulation. The first call to the callbackfn function provides this value as an argument
4038 * instead of an array value.
4039 */
4040 reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;
4041
4042 /**
4043 * Calls the specified callback function for all the elements in an array, in descending order.
4044 * The return value of the callback function is the accumulated result, and is provided as an
4045 * argument in the next call to the callback function.
4046 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
4047 * the callbackfn function one time for each element in the array.
4048 * @param initialValue If initialValue is specified, it is used as the initial value to start
4049 * the accumulation. The first call to the callbackfn function provides this value as an
4050 * argument instead of an array value.
4051 */
4052 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;
4053 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;
4054
4055 /**
4056 * Calls the specified callback function for all the elements in an array, in descending order.
4057 * The return value of the callback function is the accumulated result, and is provided as an
4058 * argument in the next call to the callback function.
4059 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
4060 * the callbackfn function one time for each element in the array.
4061 * @param initialValue If initialValue is specified, it is used as the initial value to start
4062 * the accumulation. The first call to the callbackfn function provides this value as an argument
4063 * instead of an array value.
4064 */
4065 reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;
4066
4067 /**
4068 * Reverses the elements in an Array.
4069 */
4070 reverse(): Float64Array;
4071
4072 /**
4073 * Sets a value or an array of values.
4074 * @param array A typed or untyped array of values to set.
4075 * @param offset The index in the current array at which the values are to be written.
4076 */
4077 set(array: ArrayLike<number>, offset?: number): void;
4078
4079 /**
4080 * Returns a section of an array.
4081 * @param start The beginning of the specified portion of the array.
4082 * @param end The end of the specified portion of the array.
4083 */
4084 slice(start?: number, end?: number): Float64Array;
4085
4086 /**
4087 * Determines whether the specified callback function returns true for any element of an array.
4088 * @param callbackfn A function that accepts up to three arguments. The some method calls the
4089 * callbackfn function for each element in array1 until the callbackfn returns true, or until
4090 * the end of the array.
4091 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
4092 * If thisArg is omitted, undefined is used as the this value.
4093 */
4094 some(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean;
4095
4096 /**
4097 * Sorts an array.
4098 * @param compareFn The name of the function used to determine the order of the elements. If
4099 * omitted, the elements are sorted in ascending, ASCII character order.
4100 */
4101 sort(compareFn?: (a: number, b: number) => number): this;
4102
4103 /**
4104 * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements
4105 * at begin, inclusive, up to end, exclusive.
4106 * @param begin The index of the beginning of the array.
4107 * @param end The index of the end of the array.
4108 */
4109 subarray(begin: number, end?: number): Float64Array;
4110
4111 /**
4112 * Converts a number to a string by using the current locale.
4113 */
4114 toLocaleString(): string;
4115
4116 /**
4117 * Returns a string representation of an array.
4118 */
4119 toString(): string;
4120
4121 [index: number]: number;
4122}
4123
4124interface Float64ArrayConstructor {
4125 readonly prototype: Float64Array;
4126 new(length: number): Float64Array;
4127 new(arrayOrArrayBuffer: ArrayLike<number> | ArrayBufferLike): Float64Array;
4128 new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Float64Array;
4129
4130 /**
4131 * The size in bytes of each element in the array.
4132 */
4133 readonly BYTES_PER_ELEMENT: number;
4134
4135 /**
4136 * Returns a new array from a set of elements.
4137 * @param items A set of elements to include in the new array object.
4138 */
4139 of(...items: number[]): Float64Array;
4140
4141 /**
4142 * Creates an array from an array-like or iterable object.
4143 * @param arrayLike An array-like or iterable object to convert to an array.
4144 */
4145 from(arrayLike: ArrayLike<number>): Float64Array;
4146
4147 /**
4148 * Creates an array from an array-like or iterable object.
4149 * @param arrayLike An array-like or iterable object to convert to an array.
4150 * @param mapfn A mapping function to call on every element of the array.
4151 * @param thisArg Value of 'this' used to invoke the mapfn.
4152 */
4153 from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array;
4154
4155}
4156declare var Float64Array: Float64ArrayConstructor;
4157
4158/////////////////////////////
4159/// ECMAScript Internationalization API
4160/////////////////////////////
4161
4162declare namespace Intl {
4163 interface CollatorOptions {
4164 usage?: string;
4165 localeMatcher?: string;
4166 numeric?: boolean;
4167 caseFirst?: string;
4168 sensitivity?: string;
4169 ignorePunctuation?: boolean;
4170 }
4171
4172 interface ResolvedCollatorOptions {
4173 locale: string;
4174 usage: string;
4175 sensitivity: string;
4176 ignorePunctuation: boolean;
4177 collation: string;
4178 caseFirst: string;
4179 numeric: boolean;
4180 }
4181
4182 interface Collator {
4183 compare(x: string, y: string): number;
4184 resolvedOptions(): ResolvedCollatorOptions;
4185 }
4186 var Collator: {
4187 new(locales?: string | string[], options?: CollatorOptions): Collator;
4188 (locales?: string | string[], options?: CollatorOptions): Collator;
4189 supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[];
4190 };
4191
4192 interface NumberFormatOptions {
4193 localeMatcher?: string;
4194 style?: string;
4195 currency?: string;
4196 currencyDisplay?: string;
4197 useGrouping?: boolean;
4198 minimumIntegerDigits?: number;
4199 minimumFractionDigits?: number;
4200 maximumFractionDigits?: number;
4201 minimumSignificantDigits?: number;
4202 maximumSignificantDigits?: number;
4203 }
4204
4205 interface ResolvedNumberFormatOptions {
4206 locale: string;
4207 numberingSystem: string;
4208 style: string;
4209 currency?: string;
4210 currencyDisplay?: string;
4211 minimumIntegerDigits: number;
4212 minimumFractionDigits: number;
4213 maximumFractionDigits: number;
4214 minimumSignificantDigits?: number;
4215 maximumSignificantDigits?: number;
4216 useGrouping: boolean;
4217 }
4218
4219 interface NumberFormat {
4220 format(value: number): string;
4221 resolvedOptions(): ResolvedNumberFormatOptions;
4222 }
4223 var NumberFormat: {
4224 new(locales?: string | string[], options?: NumberFormatOptions): NumberFormat;
4225 (locales?: string | string[], options?: NumberFormatOptions): NumberFormat;
4226 supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[];
4227 };
4228
4229 interface DateTimeFormatOptions {
4230 localeMatcher?: string;
4231 weekday?: string;
4232 era?: string;
4233 year?: string;
4234 month?: string;
4235 day?: string;
4236 hour?: string;
4237 minute?: string;
4238 second?: string;
4239 timeZoneName?: string;
4240 formatMatcher?: string;
4241 hour12?: boolean;
4242 timeZone?: string;
4243 }
4244
4245 interface ResolvedDateTimeFormatOptions {
4246 locale: string;
4247 calendar: string;
4248 numberingSystem: string;
4249 timeZone: string;
4250 hour12?: boolean;
4251 weekday?: string;
4252 era?: string;
4253 year?: string;
4254 month?: string;
4255 day?: string;
4256 hour?: string;
4257 minute?: string;
4258 second?: string;
4259 timeZoneName?: string;
4260 }
4261
4262 interface DateTimeFormat {
4263 format(date?: Date | number): string;
4264 resolvedOptions(): ResolvedDateTimeFormatOptions;
4265 }
4266 var DateTimeFormat: {
4267 new(locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;
4268 (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;
4269 supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[];
4270 };
4271}
4272
4273interface String {
4274 /**
4275 * Determines whether two strings are equivalent in the current or specified locale.
4276 * @param that String to compare to target string
4277 * @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.
4278 * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.
4279 */
4280 localeCompare(that: string, locales?: string | string[], options?: Intl.CollatorOptions): number;
4281}
4282
4283interface Number {
4284 /**
4285 * Converts a number to a string by using the current or specified locale.
4286 * @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.
4287 * @param options An object that contains one or more properties that specify comparison options.
4288 */
4289 toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string;
4290}
4291
4292interface Date {
4293 /**
4294 * Converts a date and time to a string by using the current or specified locale.
4295 * @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.
4296 * @param options An object that contains one or more properties that specify comparison options.
4297 */
4298 toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
4299 /**
4300 * Converts a date to a string by using the current or specified locale.
4301 * @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.
4302 * @param options An object that contains one or more properties that specify comparison options.
4303 */
4304 toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
4305
4306 /**
4307 * Converts a time to a string by using the current or specified locale.
4308 * @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.
4309 * @param options An object that contains one or more properties that specify comparison options.
4310 */
4311 toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
4312}
4313
\No newline at end of file