UNPKG

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