1 /*! *****************************************************************************
2 Copyright (c) Microsoft Corporation. All rights reserved.
3 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 this file except in compliance with the License. You may obtain a copy of the
5 License at http://www.apache.org/licenses/LICENSE-2.0
7 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8 KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9 WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10 MERCHANTABLITY OR NON-INFRINGEMENT.
12 See the Apache Version 2.0 License for specific language governing permissions
13 and limitations under the License.
14 ***************************************************************************** */
18 /// <reference no-default-lib="true"/>
\r
21 /////////////////////////////
\r
23 /////////////////////////////
\r
25 declare var NaN: number;
\r
26 declare var Infinity: number;
\r
29 * Evaluates JavaScript code and executes it.
\r
30 * @param x A String value that contains valid JavaScript code.
\r
32 declare function eval(x: string): any;
\r
35 * Converts a string to an integer.
\r
36 * @param s A string to convert into a number.
\r
37 * @param radix A value between 2 and 36 that specifies the base of the number in numString.
\r
38 * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
\r
39 * All other strings are considered decimal.
\r
41 declare function parseInt(s: string, radix?: number): number;
\r
44 * Converts a string to a floating-point number.
\r
45 * @param string A string that contains a floating-point number.
\r
47 declare function parseFloat(string: string): number;
\r
50 * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).
\r
51 * @param number A numeric value.
\r
53 declare function isNaN(number: number): boolean;
\r
56 * Determines whether a supplied number is finite.
\r
57 * @param number Any numeric value.
\r
59 declare function isFinite(number: number): boolean;
\r
62 * Gets the unencoded version of an encoded Uniform Resource Identifier (URI).
\r
63 * @param encodedURI A value representing an encoded URI.
\r
65 declare function decodeURI(encodedURI: string): string;
\r
68 * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).
\r
69 * @param encodedURIComponent A value representing an encoded URI component.
\r
71 declare function decodeURIComponent(encodedURIComponent: string): string;
\r
74 * Encodes a text string as a valid Uniform Resource Identifier (URI)
\r
75 * @param uri A value representing an encoded URI.
\r
77 declare function encodeURI(uri: string): string;
\r
80 * Encodes a text string as a valid component of a Uniform Resource Identifier (URI).
\r
81 * @param uriComponent A value representing an encoded URI component.
\r
83 declare function encodeURIComponent(uriComponent: string | number | boolean): string;
\r
86 * Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.
\r
87 * @param string A string value
\r
89 declare function escape(string: string): string;
\r
92 * Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents.
\r
93 * @param string A string value
\r
95 declare function unescape(string: string): string;
\r
98 /** Returns a string representation of an object. */
\r
101 /** Returns the primitive value of the specified object. */
\r
105 declare type PropertyKey = string | number | symbol;
\r
107 interface PropertyDescriptor {
\r
108 configurable?: boolean;
\r
109 enumerable?: boolean;
\r
111 writable?: boolean;
\r
113 set?(v: any): void;
\r
116 interface PropertyDescriptorMap {
\r
117 [s: string]: PropertyDescriptor;
\r
121 /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */
\r
122 constructor: Function;
\r
124 /** Returns a string representation of an object. */
\r
125 toString(): string;
\r
127 /** Returns a date converted to a string using the current locale. */
\r
128 toLocaleString(): string;
\r
130 /** Returns the primitive value of the specified object. */
\r
134 * Determines whether an object has a property with the specified name.
\r
135 * @param v A property name.
\r
137 hasOwnProperty(v: PropertyKey): boolean;
\r
140 * Determines whether an object exists in another object's prototype chain.
\r
141 * @param v Another object whose prototype chain is to be checked.
\r
143 isPrototypeOf(v: Object): boolean;
\r
146 * Determines whether a specified property is enumerable.
\r
147 * @param v A property name.
\r
149 propertyIsEnumerable(v: PropertyKey): boolean;
\r
152 interface ObjectConstructor {
\r
153 new(value?: any): Object;
\r
157 /** A reference to the prototype for a class of objects. */
\r
158 readonly prototype: Object;
\r
161 * Returns the prototype of an object.
\r
162 * @param o The object that references the prototype.
\r
164 getPrototypeOf(o: any): any;
\r
167 * Gets the own property descriptor of the specified object.
\r
168 * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.
\r
169 * @param o Object that contains the property.
\r
170 * @param p Name of the property.
\r
172 getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
\r
175 * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly
\r
176 * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions.
\r
177 * @param o Object that contains the own properties.
\r
179 getOwnPropertyNames(o: any): string[];
\r
182 * Creates an object that has the specified prototype or that has null prototype.
\r
183 * @param o Object to use as a prototype. May be null.
\r
185 create(o: object | null): any;
\r
188 * Creates an object that has the specified prototype, and that optionally contains specified properties.
\r
189 * @param o Object to use as a prototype. May be null
\r
190 * @param properties JavaScript object that contains one or more property descriptors.
\r
192 create(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
\r
195 * Adds a property to an object, or modifies attributes of an existing property.
\r
196 * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object.
\r
197 * @param p The property name.
\r
198 * @param attributes Descriptor for the property. It can be for a data property or an accessor property.
\r
200 defineProperty(o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): any;
\r
203 * Adds one or more properties to an object, and/or modifies attributes of existing properties.
\r
204 * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.
\r
205 * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.
\r
207 defineProperties(o: any, properties: PropertyDescriptorMap & ThisType<any>): any;
\r
210 * Prevents the modification of attributes of existing properties, and prevents the addition of new properties.
\r
211 * @param o Object on which to lock the attributes.
\r
216 * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
\r
217 * @param o Object on which to lock the attributes.
\r
219 freeze<T>(a: T[]): readonly T[];
\r
222 * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
\r
223 * @param o Object on which to lock the attributes.
\r
225 freeze<T extends Function>(f: T): T;
\r
228 * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
\r
229 * @param o Object on which to lock the attributes.
\r
231 freeze<T>(o: T): Readonly<T>;
\r
234 * Prevents the addition of new properties to an object.
\r
235 * @param o Object to make non-extensible.
\r
237 preventExtensions<T>(o: T): T;
\r
240 * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object.
\r
241 * @param o Object to test.
\r
243 isSealed(o: any): boolean;
\r
246 * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object.
\r
247 * @param o Object to test.
\r
249 isFrozen(o: any): boolean;
\r
252 * Returns a value that indicates whether new properties can be added to an object.
\r
253 * @param o Object to test.
\r
255 isExtensible(o: any): boolean;
\r
258 * Returns the names of the enumerable string properties and methods of an object.
\r
259 * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
\r
261 keys(o: object): string[];
\r
265 * Provides functionality common to all JavaScript objects.
\r
267 declare var Object: ObjectConstructor;
\r
270 * Creates a new function.
\r
272 interface Function {
\r
274 * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.
\r
275 * @param thisArg The object to be used as the this object.
\r
276 * @param argArray A set of arguments to be passed to the function.
\r
278 apply(this: Function, thisArg: any, argArray?: any): any;
\r
281 * Calls a method of an object, substituting another object for the current object.
\r
282 * @param thisArg The object to be used as the current object.
\r
283 * @param argArray A list of arguments to be passed to the method.
\r
285 call(this: Function, thisArg: any, ...argArray: any[]): any;
\r
288 * For a given function, creates a bound function that has the same body as the original function.
\r
289 * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
\r
290 * @param thisArg An object to which the this keyword can refer inside the new function.
\r
291 * @param argArray A list of arguments to be passed to the new function.
\r
293 bind(this: Function, thisArg: any, ...argArray: any[]): any;
\r
295 /** Returns a string representation of a function. */
\r
296 toString(): string;
\r
299 readonly length: number;
\r
301 // Non-standard extensions
\r
306 interface FunctionConstructor {
\r
308 * Creates a new function.
\r
309 * @param args A list of arguments the function accepts.
\r
311 new(...args: string[]): Function;
\r
312 (...args: string[]): Function;
\r
313 readonly prototype: Function;
\r
316 declare var Function: FunctionConstructor;
\r
319 * Extracts the type of the 'this' parameter of a function type, or 'unknown' if the function type has no 'this' parameter.
\r
321 type ThisParameterType<T> = T extends (this: infer U, ...args: any[]) => any ? U : unknown;
\r
324 * Removes the 'this' parameter from a function type.
\r
326 type OmitThisParameter<T> = unknown extends ThisParameterType<T> ? T : T extends (...args: infer A) => infer R ? (...args: A) => R : T;
\r
328 interface CallableFunction extends Function {
\r
330 * Calls the function with the specified object as the this value and the elements of specified array as the arguments.
\r
331 * @param thisArg The object to be used as the this object.
\r
332 * @param args An array of argument values to be passed to the function.
\r
334 apply<T, R>(this: (this: T) => R, thisArg: T): R;
\r
335 apply<T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T, args: A): R;
\r
338 * Calls the function with the specified object as the this value and the specified rest arguments as the arguments.
\r
339 * @param thisArg The object to be used as the this object.
\r
340 * @param args Argument values to be passed to the function.
\r
342 call<T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T, ...args: A): R;
\r
345 * For a given function, creates a bound function that has the same body as the original function.
\r
346 * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
\r
347 * @param thisArg The object to be used as the this object.
\r
348 * @param args Arguments to bind to the parameters of the function.
\r
350 bind<T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>;
\r
351 bind<T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R;
\r
352 bind<T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R;
\r
353 bind<T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R;
\r
354 bind<T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R;
\r
355 bind<T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R;
\r
358 interface NewableFunction extends Function {
\r
360 * Calls the function with the specified object as the this value and the elements of specified array as the arguments.
\r
361 * @param thisArg The object to be used as the this object.
\r
362 * @param args An array of argument values to be passed to the function.
\r
364 apply<T>(this: new () => T, thisArg: T): void;
\r
365 apply<T, A extends any[]>(this: new (...args: A) => T, thisArg: T, args: A): void;
\r
368 * Calls the function with the specified object as the this value and the specified rest arguments as the arguments.
\r
369 * @param thisArg The object to be used as the this object.
\r
370 * @param args Argument values to be passed to the function.
\r
372 call<T, A extends any[]>(this: new (...args: A) => T, thisArg: T, ...args: A): void;
\r
375 * For a given function, creates a bound function that has the same body as the original function.
\r
376 * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
\r
377 * @param thisArg The object to be used as the this object.
\r
378 * @param args Arguments to bind to the parameters of the function.
\r
380 bind<T>(this: T, thisArg: any): T;
\r
381 bind<A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R;
\r
382 bind<A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R;
\r
383 bind<A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R;
\r
384 bind<A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R;
\r
385 bind<AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R;
\r
388 interface IArguments {
\r
389 [index: number]: any;
\r
395 /** Returns a string representation of a string. */
\r
396 toString(): string;
\r
399 * Returns the character at the specified index.
\r
400 * @param pos The zero-based index of the desired character.
\r
402 charAt(pos: number): string;
\r
405 * Returns the Unicode value of the character at the specified location.
\r
406 * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.
\r
408 charCodeAt(index: number): number;
\r
411 * Returns a string that contains the concatenation of two or more strings.
\r
412 * @param strings The strings to append to the end of the string.
\r
414 concat(...strings: string[]): string;
\r
417 * Returns the position of the first occurrence of a substring.
\r
418 * @param searchString The substring to search for in the string
\r
419 * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.
\r
421 indexOf(searchString: string, position?: number): number;
\r
424 * Returns the last occurrence of a substring in the string.
\r
425 * @param searchString The substring to search for.
\r
426 * @param position The index at which to begin searching. If omitted, the search begins at the end of the string.
\r
428 lastIndexOf(searchString: string, position?: number): number;
\r
431 * Determines whether two strings are equivalent in the current locale.
\r
432 * @param that String to compare to target string
\r
434 localeCompare(that: string): number;
\r
437 * Matches a string with a regular expression, and returns an array containing the results of that search.
\r
438 * @param regexp A variable name or string literal containing the regular expression pattern and flags.
\r
440 match(regexp: string | RegExp): RegExpMatchArray | null;
\r
443 * Replaces text in a string, using a regular expression or search string.
\r
444 * @param searchValue A string to search for.
\r
445 * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
\r
447 replace(searchValue: string | RegExp, replaceValue: string): string;
\r
450 * Replaces text in a string, using a regular expression or search string.
\r
451 * @param searchValue A string to search for.
\r
452 * @param replacer A function that returns the replacement text.
\r
454 replace(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;
\r
457 * Finds the first substring match in a regular expression search.
\r
458 * @param regexp The regular expression pattern and applicable flags.
\r
460 search(regexp: string | RegExp): number;
\r
463 * Returns a section of a string.
\r
464 * @param start The index to the beginning of the specified portion of stringObj.
\r
465 * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end.
\r
466 * If this value is not specified, the substring continues to the end of stringObj.
\r
468 slice(start?: number, end?: number): string;
\r
471 * Split a string into substrings using the specified separator and return them as an array.
\r
472 * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.
\r
473 * @param limit A value used to limit the number of elements returned in the array.
\r
475 split(separator: string | RegExp, limit?: number): string[];
\r
478 * Returns the substring at the specified location within a String object.
\r
479 * @param start The zero-based index number indicating the beginning of the substring.
\r
480 * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.
\r
481 * If end is omitted, the characters from start through the end of the original string are returned.
\r
483 substring(start: number, end?: number): string;
\r
485 /** Converts all the alphabetic characters in a string to lowercase. */
\r
486 toLowerCase(): string;
\r
488 /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */
\r
489 toLocaleLowerCase(locales?: string | string[]): string;
\r
491 /** Converts all the alphabetic characters in a string to uppercase. */
\r
492 toUpperCase(): string;
\r
494 /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */
\r
495 toLocaleUpperCase(locales?: string | string[]): string;
\r
497 /** Removes the leading and trailing white space and line terminator characters from a string. */
\r
500 /** Returns the length of a String object. */
\r
501 readonly length: number;
\r
505 * Gets a substring beginning at the specified location and having the specified length.
\r
506 * @param from The starting position of the desired substring. The index of the first character in the string is zero.
\r
507 * @param length The number of characters to include in the returned substring.
\r
509 substr(from: number, length?: number): string;
\r
511 /** Returns the primitive value of the specified object. */
\r
514 readonly [index: number]: string;
\r
517 interface StringConstructor {
\r
518 new(value?: any): String;
\r
519 (value?: any): string;
\r
520 readonly prototype: String;
\r
521 fromCharCode(...codes: number[]): string;
\r
525 * Allows manipulation and formatting of text strings and determination and location of substrings within strings.
\r
527 declare var String: StringConstructor;
\r
529 interface Boolean {
\r
530 /** Returns the primitive value of the specified object. */
\r
531 valueOf(): boolean;
\r
534 interface BooleanConstructor {
\r
535 new(value?: any): Boolean;
\r
536 <T>(value?: T): boolean;
\r
537 readonly prototype: Boolean;
\r
540 declare var Boolean: BooleanConstructor;
\r
544 * Returns a string representation of an object.
\r
545 * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.
\r
547 toString(radix?: number): string;
\r
550 * Returns a string representing a number in fixed-point notation.
\r
551 * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.
\r
553 toFixed(fractionDigits?: number): string;
\r
556 * Returns a string containing a number represented in exponential notation.
\r
557 * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.
\r
559 toExponential(fractionDigits?: number): string;
\r
562 * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.
\r
563 * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive.
\r
565 toPrecision(precision?: number): string;
\r
567 /** Returns the primitive value of the specified object. */
\r
571 interface NumberConstructor {
\r
572 new(value?: any): Number;
\r
573 (value?: any): number;
\r
574 readonly prototype: Number;
\r
576 /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */
\r
577 readonly MAX_VALUE: number;
\r
579 /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */
\r
580 readonly MIN_VALUE: number;
\r
583 * A value that is not a number.
\r
584 * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function.
\r
586 readonly NaN: number;
\r
589 * A value that is less than the largest negative number that can be represented in JavaScript.
\r
590 * JavaScript displays NEGATIVE_INFINITY values as -infinity.
\r
592 readonly NEGATIVE_INFINITY: number;
\r
595 * A value greater than the largest number that can be represented in JavaScript.
\r
596 * JavaScript displays POSITIVE_INFINITY values as infinity.
\r
598 readonly POSITIVE_INFINITY: number;
\r
601 /** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */
\r
602 declare var Number: NumberConstructor;
\r
604 interface TemplateStringsArray extends ReadonlyArray<string> {
\r
605 readonly raw: readonly string[];
\r
609 * The type of `import.meta`.
\r
611 * If you need to declare that a given property exists on `import.meta`,
\r
612 * this type may be augmented via interface merging.
\r
614 interface ImportMeta {
\r
618 /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */
\r
619 readonly E: number;
\r
620 /** The natural logarithm of 10. */
\r
621 readonly LN10: number;
\r
622 /** The natural logarithm of 2. */
\r
623 readonly LN2: number;
\r
624 /** The base-2 logarithm of e. */
\r
625 readonly LOG2E: number;
\r
626 /** The base-10 logarithm of e. */
\r
627 readonly LOG10E: number;
\r
628 /** Pi. This is the ratio of the circumference of a circle to its diameter. */
\r
629 readonly PI: number;
\r
630 /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */
\r
631 readonly SQRT1_2: number;
\r
632 /** The square root of 2. */
\r
633 readonly SQRT2: number;
\r
635 * Returns the absolute value of a number (the value without regard to whether it is positive or negative).
\r
636 * For example, the absolute value of -5 is the same as the absolute value of 5.
\r
637 * @param x A numeric expression for which the absolute value is needed.
\r
639 abs(x: number): number;
\r
641 * Returns the arc cosine (or inverse cosine) of a number.
\r
642 * @param x A numeric expression.
\r
644 acos(x: number): number;
\r
646 * Returns the arcsine of a number.
\r
647 * @param x A numeric expression.
\r
649 asin(x: number): number;
\r
651 * Returns the arctangent of a number.
\r
652 * @param x A numeric expression for which the arctangent is needed.
\r
654 atan(x: number): number;
\r
656 * Returns the angle (in radians) from the X axis to a point.
\r
657 * @param y A numeric expression representing the cartesian y-coordinate.
\r
658 * @param x A numeric expression representing the cartesian x-coordinate.
\r
660 atan2(y: number, x: number): number;
\r
662 * Returns the smallest integer greater than or equal to its numeric argument.
\r
663 * @param x A numeric expression.
\r
665 ceil(x: number): number;
\r
667 * Returns the cosine of a number.
\r
668 * @param x A numeric expression that contains an angle measured in radians.
\r
670 cos(x: number): number;
\r
672 * Returns e (the base of natural logarithms) raised to a power.
\r
673 * @param x A numeric expression representing the power of e.
\r
675 exp(x: number): number;
\r
677 * Returns the greatest integer less than or equal to its numeric argument.
\r
678 * @param x A numeric expression.
\r
680 floor(x: number): number;
\r
682 * Returns the natural logarithm (base e) of a number.
\r
683 * @param x A numeric expression.
\r
685 log(x: number): number;
\r
687 * Returns the larger of a set of supplied numeric expressions.
\r
688 * @param values Numeric expressions to be evaluated.
\r
690 max(...values: number[]): number;
\r
692 * Returns the smaller of a set of supplied numeric expressions.
\r
693 * @param values Numeric expressions to be evaluated.
\r
695 min(...values: number[]): number;
\r
697 * Returns the value of a base expression taken to a specified power.
\r
698 * @param x The base value of the expression.
\r
699 * @param y The exponent value of the expression.
\r
701 pow(x: number, y: number): number;
\r
702 /** Returns a pseudorandom number between 0 and 1. */
\r
705 * Returns a supplied numeric expression rounded to the nearest integer.
\r
706 * @param x The value to be rounded to the nearest integer.
\r
708 round(x: number): number;
\r
710 * Returns the sine of a number.
\r
711 * @param x A numeric expression that contains an angle measured in radians.
\r
713 sin(x: number): number;
\r
715 * Returns the square root of a number.
\r
716 * @param x A numeric expression.
\r
718 sqrt(x: number): number;
\r
720 * Returns the tangent of a number.
\r
721 * @param x A numeric expression that contains an angle measured in radians.
\r
723 tan(x: number): number;
\r
725 /** An intrinsic object that provides basic mathematics functionality and constants. */
\r
726 declare var Math: Math;
\r
728 /** Enables basic storage and retrieval of dates and times. */
\r
730 /** Returns a string representation of a date. The format of the string depends on the locale. */
\r
731 toString(): string;
\r
732 /** Returns a date as a string value. */
\r
733 toDateString(): string;
\r
734 /** Returns a time as a string value. */
\r
735 toTimeString(): string;
\r
736 /** Returns a value as a string value appropriate to the host environment's current locale. */
\r
737 toLocaleString(): string;
\r
738 /** Returns a date as a string value appropriate to the host environment's current locale. */
\r
739 toLocaleDateString(): string;
\r
740 /** Returns a time as a string value appropriate to the host environment's current locale. */
\r
741 toLocaleTimeString(): string;
\r
742 /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */
\r
744 /** Gets the time value in milliseconds. */
\r
746 /** Gets the year, using local time. */
\r
747 getFullYear(): number;
\r
748 /** Gets the year using Universal Coordinated Time (UTC). */
\r
749 getUTCFullYear(): number;
\r
750 /** Gets the month, using local time. */
\r
751 getMonth(): number;
\r
752 /** Gets the month of a Date object using Universal Coordinated Time (UTC). */
\r
753 getUTCMonth(): number;
\r
754 /** Gets the day-of-the-month, using local time. */
\r
756 /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */
\r
757 getUTCDate(): number;
\r
758 /** Gets the day of the week, using local time. */
\r
760 /** Gets the day of the week using Universal Coordinated Time (UTC). */
\r
761 getUTCDay(): number;
\r
762 /** Gets the hours in a date, using local time. */
\r
763 getHours(): number;
\r
764 /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */
\r
765 getUTCHours(): number;
\r
766 /** Gets the minutes of a Date object, using local time. */
\r
767 getMinutes(): number;
\r
768 /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */
\r
769 getUTCMinutes(): number;
\r
770 /** Gets the seconds of a Date object, using local time. */
\r
771 getSeconds(): number;
\r
772 /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */
\r
773 getUTCSeconds(): number;
\r
774 /** Gets the milliseconds of a Date, using local time. */
\r
775 getMilliseconds(): number;
\r
776 /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */
\r
777 getUTCMilliseconds(): number;
\r
778 /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */
\r
779 getTimezoneOffset(): number;
\r
781 * Sets the date and time value in the Date object.
\r
782 * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.
\r
784 setTime(time: number): number;
\r
786 * Sets the milliseconds value in the Date object using local time.
\r
787 * @param ms A numeric value equal to the millisecond value.
\r
789 setMilliseconds(ms: number): number;
\r
791 * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).
\r
792 * @param ms A numeric value equal to the millisecond value.
\r
794 setUTCMilliseconds(ms: number): number;
\r
797 * Sets the seconds value in the Date object using local time.
\r
798 * @param sec A numeric value equal to the seconds value.
\r
799 * @param ms A numeric value equal to the milliseconds value.
\r
801 setSeconds(sec: number, ms?: number): number;
\r
803 * Sets the seconds value in the Date object using Universal Coordinated Time (UTC).
\r
804 * @param sec A numeric value equal to the seconds value.
\r
805 * @param ms A numeric value equal to the milliseconds value.
\r
807 setUTCSeconds(sec: number, ms?: number): number;
\r
809 * Sets the minutes value in the Date object using local time.
\r
810 * @param min A numeric value equal to the minutes value.
\r
811 * @param sec A numeric value equal to the seconds value.
\r
812 * @param ms A numeric value equal to the milliseconds value.
\r
814 setMinutes(min: number, sec?: number, ms?: number): number;
\r
816 * Sets the minutes value in the Date object using Universal Coordinated Time (UTC).
\r
817 * @param min A numeric value equal to the minutes value.
\r
818 * @param sec A numeric value equal to the seconds value.
\r
819 * @param ms A numeric value equal to the milliseconds value.
\r
821 setUTCMinutes(min: number, sec?: number, ms?: number): number;
\r
823 * Sets the hour value in the Date object using local time.
\r
824 * @param hours A numeric value equal to the hours value.
\r
825 * @param min A numeric value equal to the minutes value.
\r
826 * @param sec A numeric value equal to the seconds value.
\r
827 * @param ms A numeric value equal to the milliseconds value.
\r
829 setHours(hours: number, min?: number, sec?: number, ms?: number): number;
\r
831 * Sets the hours value in the Date object using Universal Coordinated Time (UTC).
\r
832 * @param hours A numeric value equal to the hours value.
\r
833 * @param min A numeric value equal to the minutes value.
\r
834 * @param sec A numeric value equal to the seconds value.
\r
835 * @param ms A numeric value equal to the milliseconds value.
\r
837 setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number;
\r
839 * Sets the numeric day-of-the-month value of the Date object using local time.
\r
840 * @param date A numeric value equal to the day of the month.
\r
842 setDate(date: number): number;
\r
844 * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).
\r
845 * @param date A numeric value equal to the day of the month.
\r
847 setUTCDate(date: number): number;
\r
849 * Sets the month value in the Date object using local time.
\r
850 * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
\r
851 * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.
\r
853 setMonth(month: number, date?: number): number;
\r
855 * Sets the month value in the Date object using Universal Coordinated Time (UTC).
\r
856 * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
\r
857 * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.
\r
859 setUTCMonth(month: number, date?: number): number;
\r
861 * Sets the year of the Date object using local time.
\r
862 * @param year A numeric value for the year.
\r
863 * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.
\r
864 * @param date A numeric value equal for the day of the month.
\r
866 setFullYear(year: number, month?: number, date?: number): number;
\r
868 * Sets the year value in the Date object using Universal Coordinated Time (UTC).
\r
869 * @param year A numeric value equal to the year.
\r
870 * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.
\r
871 * @param date A numeric value equal to the day of the month.
\r
873 setUTCFullYear(year: number, month?: number, date?: number): number;
\r
874 /** Returns a date converted to a string using Universal Coordinated Time (UTC). */
\r
875 toUTCString(): string;
\r
876 /** Returns a date as a string value in ISO format. */
\r
877 toISOString(): string;
\r
878 /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */
\r
879 toJSON(key?: any): string;
\r
882 interface DateConstructor {
\r
884 new(value: number | string): Date;
\r
885 new(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;
\r
887 readonly prototype: Date;
\r
889 * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.
\r
890 * @param s A date string
\r
892 parse(s: string): number;
\r
894 * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
\r
895 * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.
\r
896 * @param month The month as a number between 0 and 11 (January to December).
\r
897 * @param date The date as a number between 1 and 31.
\r
898 * @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.
\r
899 * @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.
\r
900 * @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.
\r
901 * @param ms A number from 0 to 999 that specifies the milliseconds.
\r
903 UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;
\r
907 declare var Date: DateConstructor;
\r
909 interface RegExpMatchArray extends Array<string> {
\r
914 interface RegExpExecArray extends Array<string> {
\r
921 * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search.
\r
922 * @param string The String object or string literal on which to perform the search.
\r
924 exec(string: string): RegExpExecArray | null;
\r
927 * Returns a Boolean value that indicates whether or not a pattern exists in a searched string.
\r
928 * @param string String on which to perform the search.
\r
930 test(string: string): boolean;
\r
932 /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */
\r
933 readonly source: string;
\r
935 /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */
\r
936 readonly global: boolean;
\r
938 /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */
\r
939 readonly ignoreCase: boolean;
\r
941 /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */
\r
942 readonly multiline: boolean;
\r
946 // Non-standard extensions
\r
950 interface RegExpConstructor {
\r
951 new(pattern: RegExp | string): RegExp;
\r
952 new(pattern: string, flags?: string): RegExp;
\r
953 (pattern: RegExp | string): RegExp;
\r
954 (pattern: string, flags?: string): RegExp;
\r
955 readonly prototype: RegExp;
\r
957 // Non-standard extensions
\r
970 declare var RegExp: RegExpConstructor;
\r
978 interface ErrorConstructor {
\r
979 new(message?: string): Error;
\r
980 (message?: string): Error;
\r
981 readonly prototype: Error;
\r
984 declare var Error: ErrorConstructor;
\r
986 interface EvalError extends Error {
\r
989 interface EvalErrorConstructor extends ErrorConstructor {
\r
990 new(message?: string): EvalError;
\r
991 (message?: string): EvalError;
\r
992 readonly prototype: EvalError;
\r
995 declare var EvalError: EvalErrorConstructor;
\r
997 interface RangeError extends Error {
\r
1000 interface RangeErrorConstructor extends ErrorConstructor {
\r
1001 new(message?: string): RangeError;
\r
1002 (message?: string): RangeError;
\r
1003 readonly prototype: RangeError;
\r
1006 declare var RangeError: RangeErrorConstructor;
\r
1008 interface ReferenceError extends Error {
\r
1011 interface ReferenceErrorConstructor extends ErrorConstructor {
\r
1012 new(message?: string): ReferenceError;
\r
1013 (message?: string): ReferenceError;
\r
1014 readonly prototype: ReferenceError;
\r
1017 declare var ReferenceError: ReferenceErrorConstructor;
\r
1019 interface SyntaxError extends Error {
\r
1022 interface SyntaxErrorConstructor extends ErrorConstructor {
\r
1023 new(message?: string): SyntaxError;
\r
1024 (message?: string): SyntaxError;
\r
1025 readonly prototype: SyntaxError;
\r
1028 declare var SyntaxError: SyntaxErrorConstructor;
\r
1030 interface TypeError extends Error {
\r
1033 interface TypeErrorConstructor extends ErrorConstructor {
\r
1034 new(message?: string): TypeError;
\r
1035 (message?: string): TypeError;
\r
1036 readonly prototype: TypeError;
\r
1039 declare var TypeError: TypeErrorConstructor;
\r
1041 interface URIError extends Error {
\r
1044 interface URIErrorConstructor extends ErrorConstructor {
\r
1045 new(message?: string): URIError;
\r
1046 (message?: string): URIError;
\r
1047 readonly prototype: URIError;
\r
1050 declare var URIError: URIErrorConstructor;
\r
1054 * Converts a JavaScript Object Notation (JSON) string into an object.
\r
1055 * @param text A valid JSON string.
\r
1056 * @param reviver A function that transforms the results. This function is called for each member of the object.
\r
1057 * If a member contains nested objects, the nested objects are transformed before the parent object is.
\r
1059 parse(text: string, reviver?: (this: any, key: string, value: any) => any): any;
\r
1061 * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
\r
1062 * @param value A JavaScript value, usually an object or array, to be converted.
\r
1063 * @param replacer A function that transforms the results.
\r
1064 * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
\r
1066 stringify(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
\r
1068 * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
\r
1069 * @param value A JavaScript value, usually an object or array, to be converted.
\r
1070 * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified.
\r
1071 * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
\r
1073 stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
\r
1077 * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.
\r
1079 declare var JSON: JSON;
\r
1082 /////////////////////////////
\r
1083 /// ECMAScript Array API (specially handled by compiler)
\r
1084 /////////////////////////////
\r
1086 interface ReadonlyArray<T> {
\r
1088 * Gets the length of the array. This is a number one higher than the highest element defined in an array.
\r
1090 readonly length: number;
\r
1092 * Returns a string representation of an array.
\r
1094 toString(): string;
\r
1096 * Returns a string representation of an array. The elements are converted to string using their toLocalString methods.
\r
1098 toLocaleString(): string;
\r
1100 * Combines two or more arrays.
\r
1101 * @param items Additional items to add to the end of array1.
\r
1103 concat(...items: ConcatArray<T>[]): T[];
\r
1105 * Combines two or more arrays.
\r
1106 * @param items Additional items to add to the end of array1.
\r
1108 concat(...items: (T | ConcatArray<T>)[]): T[];
\r
1110 * Adds all the elements of an array separated by the specified separator string.
\r
1111 * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
\r
1113 join(separator?: string): string;
\r
1115 * Returns a section of an array.
\r
1116 * @param start The beginning of the specified portion of the array.
\r
1117 * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
\r
1119 slice(start?: number, end?: number): T[];
\r
1121 * Returns the index of the first occurrence of a value in an array.
\r
1122 * @param searchElement The value to locate in the array.
\r
1123 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
\r
1125 indexOf(searchElement: T, fromIndex?: number): number;
\r
1127 * Returns the index of the last occurrence of a specified value in an array.
\r
1128 * @param searchElement The value to locate in the array.
\r
1129 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.
\r
1131 lastIndexOf(searchElement: T, fromIndex?: number): number;
\r
1133 * Determines whether all the members of an array satisfy the specified test.
\r
1134 * @param predicate A function that accepts up to three arguments. The every method calls
\r
1135 * the predicate function for each element in the array until the predicate returns a value
\r
1136 * which is coercible to the Boolean value false, or until the end of the array.
\r
1137 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
1138 * If thisArg is omitted, undefined is used as the this value.
\r
1140 every<S extends T>(predicate: (value: T, index: number, array: readonly T[]) => value is S, thisArg?: any): this is readonly S[];
\r
1142 * Determines whether all the members of an array satisfy the specified test.
\r
1143 * @param predicate A function that accepts up to three arguments. The every method calls
\r
1144 * the predicate function for each element in the array until the predicate returns a value
\r
1145 * which is coercible to the Boolean value false, or until the end of the array.
\r
1146 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
1147 * If thisArg is omitted, undefined is used as the this value.
\r
1149 every(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): boolean;
\r
1151 * Determines whether the specified callback function returns true for any element of an array.
\r
1152 * @param predicate A function that accepts up to three arguments. The some method calls
\r
1153 * the predicate function for each element in the array until the predicate returns a value
\r
1154 * which is coercible to the Boolean value true, or until the end of the array.
\r
1155 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
1156 * If thisArg is omitted, undefined is used as the this value.
\r
1158 some(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): boolean;
\r
1160 * Performs the specified action for each element in an array.
\r
1161 * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
\r
1162 * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
\r
1164 forEach(callbackfn: (value: T, index: number, array: readonly T[]) => void, thisArg?: any): void;
\r
1166 * Calls a defined callback function on each element of an array, and returns an array that contains the results.
\r
1167 * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
\r
1168 * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
\r
1170 map<U>(callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: any): U[];
\r
1172 * Returns the elements of an array that meet the condition specified in a callback function.
\r
1173 * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
\r
1174 * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
\r
1176 filter<S extends T>(predicate: (value: T, index: number, array: readonly T[]) => value is S, thisArg?: any): S[];
\r
1178 * Returns the elements of an array that meet the condition specified in a callback function.
\r
1179 * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
\r
1180 * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
\r
1182 filter(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): T[];
\r
1184 * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
\r
1185 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
\r
1186 * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
\r
1188 reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T): T;
\r
1189 reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T;
\r
1191 * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
\r
1192 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
\r
1193 * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
\r
1195 reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U, initialValue: U): U;
\r
1197 * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
\r
1198 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
\r
1199 * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
\r
1201 reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T): T;
\r
1202 reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T;
\r
1204 * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
\r
1205 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
\r
1206 * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
\r
1208 reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U, initialValue: U): U;
\r
1210 readonly [n: number]: T;
\r
1213 interface ConcatArray<T> {
\r
1214 readonly length: number;
\r
1215 readonly [n: number]: T;
\r
1216 join(separator?: string): string;
\r
1217 slice(start?: number, end?: number): T[];
\r
1220 interface Array<T> {
\r
1222 * Gets or sets the length of the array. This is a number one higher than the highest index in the array.
\r
1226 * Returns a string representation of an array.
\r
1228 toString(): string;
\r
1230 * Returns a string representation of an array. The elements are converted to string using their toLocalString methods.
\r
1232 toLocaleString(): string;
\r
1234 * Removes the last element from an array and returns it.
\r
1235 * If the array is empty, undefined is returned and the array is not modified.
\r
1237 pop(): T | undefined;
\r
1239 * Appends new elements to the end of an array, and returns the new length of the array.
\r
1240 * @param items New elements to add to the array.
\r
1242 push(...items: T[]): number;
\r
1244 * Combines two or more arrays.
\r
1245 * This method returns a new array without modifying any existing arrays.
\r
1246 * @param items Additional arrays and/or items to add to the end of the array.
\r
1248 concat(...items: ConcatArray<T>[]): T[];
\r
1250 * Combines two or more arrays.
\r
1251 * This method returns a new array without modifying any existing arrays.
\r
1252 * @param items Additional arrays and/or items to add to the end of the array.
\r
1254 concat(...items: (T | ConcatArray<T>)[]): T[];
\r
1256 * Adds all the elements of an array into a string, separated by the specified separator string.
\r
1257 * @param separator A string used to separate one element of the array from the next in the resulting string. If omitted, the array elements are separated with a comma.
\r
1259 join(separator?: string): string;
\r
1261 * Reverses the elements in an array in place.
\r
1262 * This method mutates the array and returns a reference to the same array.
\r
1266 * Removes the first element from an array and returns it.
\r
1267 * If the array is empty, undefined is returned and the array is not modified.
\r
1269 shift(): T | undefined;
\r
1271 * Returns a copy of a section of an array.
\r
1272 * For both start and end, a negative index can be used to indicate an offset from the end of the array.
\r
1273 * For example, -2 refers to the second to last element of the array.
\r
1274 * @param start The beginning index of the specified portion of the array.
\r
1275 * If start is undefined, then the slice begins at index 0.
\r
1276 * @param end The end index of the specified portion of the array. This is exclusive of the element at the index 'end'.
\r
1277 * If end is undefined, then the slice extends to the end of the array.
\r
1279 slice(start?: number, end?: number): T[];
\r
1281 * Sorts an array in place.
\r
1282 * This method mutates the array and returns a reference to the same array.
\r
1283 * @param compareFn Function used to determine the order of the elements. It is expected to return
\r
1284 * a negative value if first argument is less than second argument, zero if they're equal and a positive
\r
1285 * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
\r
1287 * [11,2,22,1].sort((a, b) => a - b)
\r
1290 sort(compareFn?: (a: T, b: T) => number): this;
\r
1292 * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
\r
1293 * @param start The zero-based location in the array from which to start removing elements.
\r
1294 * @param deleteCount The number of elements to remove.
\r
1295 * @returns An array containing the elements that were deleted.
\r
1297 splice(start: number, deleteCount?: number): T[];
\r
1299 * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
\r
1300 * @param start The zero-based location in the array from which to start removing elements.
\r
1301 * @param deleteCount The number of elements to remove.
\r
1302 * @param items Elements to insert into the array in place of the deleted elements.
\r
1303 * @returns An array containing the elements that were deleted.
\r
1305 splice(start: number, deleteCount: number, ...items: T[]): T[];
\r
1307 * Inserts new elements at the start of an array, and returns the new length of the array.
\r
1308 * @param items Elements to insert at the start of the array.
\r
1310 unshift(...items: T[]): number;
\r
1312 * Returns the index of the first occurrence of a value in an array, or -1 if it is not present.
\r
1313 * @param searchElement The value to locate in the array.
\r
1314 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
\r
1316 indexOf(searchElement: T, fromIndex?: number): number;
\r
1318 * Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present.
\r
1319 * @param searchElement The value to locate in the array.
\r
1320 * @param fromIndex The array index at which to begin searching backward. If fromIndex is omitted, the search starts at the last index in the array.
\r
1322 lastIndexOf(searchElement: T, fromIndex?: number): number;
\r
1324 * Determines whether all the members of an array satisfy the specified test.
\r
1325 * @param predicate A function that accepts up to three arguments. The every method calls
\r
1326 * the predicate function for each element in the array until the predicate returns a value
\r
1327 * which is coercible to the Boolean value false, or until the end of the array.
\r
1328 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
1329 * If thisArg is omitted, undefined is used as the this value.
\r
1331 every<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): this is S[];
\r
1333 * Determines whether all the members of an array satisfy the specified test.
\r
1334 * @param predicate A function that accepts up to three arguments. The every method calls
\r
1335 * the predicate function for each element in the array until the predicate returns a value
\r
1336 * which is coercible to the Boolean value false, or until the end of the array.
\r
1337 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
1338 * If thisArg is omitted, undefined is used as the this value.
\r
1340 every(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
\r
1342 * Determines whether the specified callback function returns true for any element of an array.
\r
1343 * @param predicate A function that accepts up to three arguments. The some method calls
\r
1344 * the predicate function for each element in the array until the predicate returns a value
\r
1345 * which is coercible to the Boolean value true, or until the end of the array.
\r
1346 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
1347 * If thisArg is omitted, undefined is used as the this value.
\r
1349 some(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
\r
1351 * Performs the specified action for each element in an array.
\r
1352 * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
\r
1353 * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
\r
1355 forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;
\r
1357 * Calls a defined callback function on each element of an array, and returns an array that contains the results.
\r
1358 * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
\r
1359 * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
\r
1361 map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];
\r
1363 * Returns the elements of an array that meet the condition specified in a callback function.
\r
1364 * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
\r
1365 * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
\r
1367 filter<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[];
\r
1369 * Returns the elements of an array that meet the condition specified in a callback function.
\r
1370 * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
\r
1371 * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
\r
1373 filter(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[];
\r
1375 * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
\r
1376 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
\r
1377 * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
\r
1379 reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
\r
1380 reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
\r
1382 * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
\r
1383 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
\r
1384 * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
\r
1386 reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
\r
1388 * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
\r
1389 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
\r
1390 * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
\r
1392 reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
\r
1393 reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
\r
1395 * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
\r
1396 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
\r
1397 * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
\r
1399 reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
\r
1404 interface ArrayConstructor {
\r
1405 new(arrayLength?: number): any[];
\r
1406 new <T>(arrayLength: number): T[];
\r
1407 new <T>(...items: T[]): T[];
\r
1408 (arrayLength?: number): any[];
\r
1409 <T>(arrayLength: number): T[];
\r
1410 <T>(...items: T[]): T[];
\r
1411 isArray(arg: any): arg is any[];
\r
1412 readonly prototype: any[];
\r
1415 declare var Array: ArrayConstructor;
\r
1417 interface TypedPropertyDescriptor<T> {
\r
1418 enumerable?: boolean;
\r
1419 configurable?: boolean;
\r
1420 writable?: boolean;
\r
1423 set?: (value: T) => void;
\r
1426 declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;
\r
1427 declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
\r
1428 declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
\r
1429 declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;
\r
1431 declare type PromiseConstructorLike = new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void) => PromiseLike<T>;
\r
1433 interface PromiseLike<T> {
\r
1435 * Attaches callbacks for the resolution and/or rejection of the Promise.
\r
1436 * @param onfulfilled The callback to execute when the Promise is resolved.
\r
1437 * @param onrejected The callback to execute when the Promise is rejected.
\r
1438 * @returns A Promise for the completion of which ever callback is executed.
\r
1440 then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): PromiseLike<TResult1 | TResult2>;
\r
1444 * Represents the completion of an asynchronous operation
\r
1446 interface Promise<T> {
\r
1448 * Attaches callbacks for the resolution and/or rejection of the Promise.
\r
1449 * @param onfulfilled The callback to execute when the Promise is resolved.
\r
1450 * @param onrejected The callback to execute when the Promise is rejected.
\r
1451 * @returns A Promise for the completion of which ever callback is executed.
\r
1453 then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
\r
1456 * Attaches a callback for only the rejection of the Promise.
\r
1457 * @param onrejected The callback to execute when the Promise is rejected.
\r
1458 * @returns A Promise for the completion of the callback.
\r
1460 catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
\r
1463 interface ArrayLike<T> {
\r
1464 readonly length: number;
\r
1465 readonly [n: number]: T;
\r
1469 * Make all properties in T optional
\r
1471 type Partial<T> = {
\r
1472 [P in keyof T]?: T[P];
\r
1476 * Make all properties in T required
\r
1478 type Required<T> = {
\r
1479 [P in keyof T]-?: T[P];
\r
1483 * Make all properties in T readonly
\r
1485 type Readonly<T> = {
\r
1486 readonly [P in keyof T]: T[P];
\r
1490 * From T, pick a set of properties whose keys are in the union K
\r
1492 type Pick<T, K extends keyof T> = {
\r
1497 * Construct a type with a set of properties K of type T
\r
1499 type Record<K extends keyof any, T> = {
\r
1504 * Exclude from T those types that are assignable to U
\r
1506 type Exclude<T, U> = T extends U ? never : T;
\r
1509 * Extract from T those types that are assignable to U
\r
1511 type Extract<T, U> = T extends U ? T : never;
\r
1514 * Construct a type with the properties of T except for those in type K.
\r
1516 type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
\r
1519 * Exclude null and undefined from T
\r
1521 type NonNullable<T> = T extends null | undefined ? never : T;
\r
1524 * Obtain the parameters of a function type in a tuple
\r
1526 type Parameters<T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never;
\r
1529 * Obtain the parameters of a constructor function type in a tuple
\r
1531 type ConstructorParameters<T extends new (...args: any) => any> = T extends new (...args: infer P) => any ? P : never;
\r
1534 * Obtain the return type of a function type
\r
1536 type ReturnType<T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any;
\r
1539 * Obtain the return type of a constructor function type
\r
1541 type InstanceType<T extends new (...args: any) => any> = T extends new (...args: any) => infer R ? R : any;
\r
1544 * Convert string literal type to uppercase
\r
1546 type Uppercase<S extends string> = intrinsic;
\r
1549 * Convert string literal type to lowercase
\r
1551 type Lowercase<S extends string> = intrinsic;
\r
1554 * Convert first character of string literal type to uppercase
\r
1556 type Capitalize<S extends string> = intrinsic;
\r
1559 * Convert first character of string literal type to lowercase
\r
1561 type Uncapitalize<S extends string> = intrinsic;
\r
1564 * Marker for contextual 'this' type
\r
1566 interface ThisType<T> { }
\r
1569 * Represents a raw buffer of binary data, which is used to store data for the
\r
1570 * different typed arrays. ArrayBuffers cannot be read from or written to directly,
\r
1571 * but can be passed to a typed array or DataView Object to interpret the raw
\r
1572 * buffer as needed.
\r
1574 interface ArrayBuffer {
\r
1576 * Read-only. The length of the ArrayBuffer (in bytes).
\r
1578 readonly byteLength: number;
\r
1581 * Returns a section of an ArrayBuffer.
\r
1583 slice(begin: number, end?: number): ArrayBuffer;
\r
1587 * Allowed ArrayBuffer types for the buffer of an ArrayBufferView and related Typed Arrays.
\r
1589 interface ArrayBufferTypes {
\r
1590 ArrayBuffer: ArrayBuffer;
\r
1592 type ArrayBufferLike = ArrayBufferTypes[keyof ArrayBufferTypes];
\r
1594 interface ArrayBufferConstructor {
\r
1595 readonly prototype: ArrayBuffer;
\r
1596 new(byteLength: number): ArrayBuffer;
\r
1597 isView(arg: any): arg is ArrayBufferView;
\r
1599 declare var ArrayBuffer: ArrayBufferConstructor;
\r
1601 interface ArrayBufferView {
\r
1603 * The ArrayBuffer instance referenced by the array.
\r
1605 buffer: ArrayBufferLike;
\r
1608 * The length in bytes of the array.
\r
1610 byteLength: number;
\r
1613 * The offset in bytes of the array.
\r
1615 byteOffset: number;
\r
1618 interface DataView {
\r
1619 readonly buffer: ArrayBuffer;
\r
1620 readonly byteLength: number;
\r
1621 readonly byteOffset: number;
\r
1623 * Gets the Float32 value at the specified byte offset from the start of the view. There is
\r
1624 * no alignment constraint; multi-byte values may be fetched from any offset.
\r
1625 * @param byteOffset The place in the buffer at which the value should be retrieved.
\r
1627 getFloat32(byteOffset: number, littleEndian?: boolean): number;
\r
1630 * Gets the Float64 value at the specified byte offset from the start of the view. There is
\r
1631 * no alignment constraint; multi-byte values may be fetched from any offset.
\r
1632 * @param byteOffset The place in the buffer at which the value should be retrieved.
\r
1634 getFloat64(byteOffset: number, littleEndian?: boolean): number;
\r
1637 * Gets the Int8 value at the specified byte offset from the start of the view. There is
\r
1638 * no alignment constraint; multi-byte values may be fetched from any offset.
\r
1639 * @param byteOffset The place in the buffer at which the value should be retrieved.
\r
1641 getInt8(byteOffset: number): number;
\r
1644 * Gets the Int16 value at the specified byte offset from the start of the view. There is
\r
1645 * no alignment constraint; multi-byte values may be fetched from any offset.
\r
1646 * @param byteOffset The place in the buffer at which the value should be retrieved.
\r
1648 getInt16(byteOffset: number, littleEndian?: boolean): number;
\r
1650 * Gets the Int32 value at the specified byte offset from the start of the view. There is
\r
1651 * no alignment constraint; multi-byte values may be fetched from any offset.
\r
1652 * @param byteOffset The place in the buffer at which the value should be retrieved.
\r
1654 getInt32(byteOffset: number, littleEndian?: boolean): number;
\r
1657 * Gets the Uint8 value at the specified byte offset from the start of the view. There is
\r
1658 * no alignment constraint; multi-byte values may be fetched from any offset.
\r
1659 * @param byteOffset The place in the buffer at which the value should be retrieved.
\r
1661 getUint8(byteOffset: number): number;
\r
1664 * Gets the Uint16 value at the specified byte offset from the start of the view. There is
\r
1665 * no alignment constraint; multi-byte values may be fetched from any offset.
\r
1666 * @param byteOffset The place in the buffer at which the value should be retrieved.
\r
1668 getUint16(byteOffset: number, littleEndian?: boolean): number;
\r
1671 * Gets the Uint32 value at the specified byte offset from the start of the view. There is
\r
1672 * no alignment constraint; multi-byte values may be fetched from any offset.
\r
1673 * @param byteOffset The place in the buffer at which the value should be retrieved.
\r
1675 getUint32(byteOffset: number, littleEndian?: boolean): number;
\r
1678 * Stores an Float32 value at the specified byte offset from the start of the view.
\r
1679 * @param byteOffset The place in the buffer at which the value should be set.
\r
1680 * @param value The value to set.
\r
1681 * @param littleEndian If false or undefined, a big-endian value should be written,
\r
1682 * otherwise a little-endian value should be written.
\r
1684 setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;
\r
1687 * Stores an Float64 value at the specified byte offset from the start of the view.
\r
1688 * @param byteOffset The place in the buffer at which the value should be set.
\r
1689 * @param value The value to set.
\r
1690 * @param littleEndian If false or undefined, a big-endian value should be written,
\r
1691 * otherwise a little-endian value should be written.
\r
1693 setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;
\r
1696 * Stores an Int8 value at the specified byte offset from the start of the view.
\r
1697 * @param byteOffset The place in the buffer at which the value should be set.
\r
1698 * @param value The value to set.
\r
1700 setInt8(byteOffset: number, value: number): void;
\r
1703 * Stores an Int16 value at the specified byte offset from the start of the view.
\r
1704 * @param byteOffset The place in the buffer at which the value should be set.
\r
1705 * @param value The value to set.
\r
1706 * @param littleEndian If false or undefined, a big-endian value should be written,
\r
1707 * otherwise a little-endian value should be written.
\r
1709 setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;
\r
1712 * Stores an Int32 value at the specified byte offset from the start of the view.
\r
1713 * @param byteOffset The place in the buffer at which the value should be set.
\r
1714 * @param value The value to set.
\r
1715 * @param littleEndian If false or undefined, a big-endian value should be written,
\r
1716 * otherwise a little-endian value should be written.
\r
1718 setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;
\r
1721 * Stores an Uint8 value at the specified byte offset from the start of the view.
\r
1722 * @param byteOffset The place in the buffer at which the value should be set.
\r
1723 * @param value The value to set.
\r
1725 setUint8(byteOffset: number, value: number): void;
\r
1728 * Stores an Uint16 value at the specified byte offset from the start of the view.
\r
1729 * @param byteOffset The place in the buffer at which the value should be set.
\r
1730 * @param value The value to set.
\r
1731 * @param littleEndian If false or undefined, a big-endian value should be written,
\r
1732 * otherwise a little-endian value should be written.
\r
1734 setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;
\r
1737 * Stores an Uint32 value at the specified byte offset from the start of the view.
\r
1738 * @param byteOffset The place in the buffer at which the value should be set.
\r
1739 * @param value The value to set.
\r
1740 * @param littleEndian If false or undefined, a big-endian value should be written,
\r
1741 * otherwise a little-endian value should be written.
\r
1743 setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;
\r
1746 interface DataViewConstructor {
\r
1747 readonly prototype: DataView;
\r
1748 new(buffer: ArrayBufferLike, byteOffset?: number, byteLength?: number): DataView;
\r
1750 declare var DataView: DataViewConstructor;
\r
1753 * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested
\r
1754 * number of bytes could not be allocated an exception is raised.
\r
1756 interface Int8Array {
\r
1758 * The size in bytes of each element in the array.
\r
1760 readonly BYTES_PER_ELEMENT: number;
\r
1763 * The ArrayBuffer instance referenced by the array.
\r
1765 readonly buffer: ArrayBufferLike;
\r
1768 * The length in bytes of the array.
\r
1770 readonly byteLength: number;
\r
1773 * The offset in bytes of the array.
\r
1775 readonly byteOffset: number;
\r
1778 * Returns the this object after copying a section of the array identified by start and end
\r
1779 * to the same array starting at position target
\r
1780 * @param target If target is negative, it is treated as length+target where length is the
\r
1781 * length of the array.
\r
1782 * @param start If start is negative, it is treated as length+start. If end is negative, it
\r
1783 * is treated as length+end.
\r
1784 * @param end If not specified, length of the this object is used as its default value.
\r
1786 copyWithin(target: number, start: number, end?: number): this;
\r
1789 * Determines whether all the members of an array satisfy the specified test.
\r
1790 * @param predicate A function that accepts up to three arguments. The every method calls
\r
1791 * the predicate function for each element in the array until the predicate returns a value
\r
1792 * which is coercible to the Boolean value false, or until the end of the array.
\r
1793 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
1794 * If thisArg is omitted, undefined is used as the this value.
\r
1796 every(predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): boolean;
\r
1799 * Returns the this object after filling the section identified by start and end with value
\r
1800 * @param value value to fill array section with
\r
1801 * @param start index to start filling the array at. If start is negative, it is treated as
\r
1802 * length+start where length is the length of the array.
\r
1803 * @param end index to stop filling the array at. If end is negative, it is treated as
\r
1806 fill(value: number, start?: number, end?: number): this;
\r
1809 * Returns the elements of an array that meet the condition specified in a callback function.
\r
1810 * @param predicate A function that accepts up to three arguments. The filter method calls
\r
1811 * the predicate function one time for each element in the array.
\r
1812 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
1813 * If thisArg is omitted, undefined is used as the this value.
\r
1815 filter(predicate: (value: number, index: number, array: Int8Array) => any, thisArg?: any): Int8Array;
\r
1818 * Returns the value of the first element in the array where predicate is true, and undefined
\r
1820 * @param predicate find calls predicate once for each element of the array, in ascending
\r
1821 * order, until it finds one where predicate returns true. If such an element is found, find
\r
1822 * immediately returns that element value. Otherwise, find returns undefined.
\r
1823 * @param thisArg If provided, it will be used as the this value for each invocation of
\r
1824 * predicate. If it is not provided, undefined is used instead.
\r
1826 find(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number | undefined;
\r
1829 * Returns the index of the first element in the array where predicate is true, and -1
\r
1831 * @param predicate find calls predicate once for each element of the array, in ascending
\r
1832 * order, until it finds one where predicate returns true. If such an element is found,
\r
1833 * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
\r
1834 * @param thisArg If provided, it will be used as the this value for each invocation of
\r
1835 * predicate. If it is not provided, undefined is used instead.
\r
1837 findIndex(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number;
\r
1840 * Performs the specified action for each element in an array.
\r
1841 * @param callbackfn A function that accepts up to three arguments. forEach calls the
\r
1842 * callbackfn function one time for each element in the array.
\r
1843 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
\r
1844 * If thisArg is omitted, undefined is used as the this value.
\r
1846 forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void;
\r
1849 * Returns the index of the first occurrence of a value in an array.
\r
1850 * @param searchElement The value to locate in the array.
\r
1851 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
\r
1852 * search starts at index 0.
\r
1854 indexOf(searchElement: number, fromIndex?: number): number;
\r
1857 * Adds all the elements of an array separated by the specified separator string.
\r
1858 * @param separator A string used to separate one element of an array from the next in the
\r
1859 * resulting String. If omitted, the array elements are separated with a comma.
\r
1861 join(separator?: string): string;
\r
1864 * Returns the index of the last occurrence of a value in an array.
\r
1865 * @param searchElement The value to locate in the array.
\r
1866 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
\r
1867 * search starts at index 0.
\r
1869 lastIndexOf(searchElement: number, fromIndex?: number): number;
\r
1872 * The length of the array.
\r
1874 readonly length: number;
\r
1877 * Calls a defined callback function on each element of an array, and returns an array that
\r
1878 * contains the results.
\r
1879 * @param callbackfn A function that accepts up to three arguments. The map method calls the
\r
1880 * callbackfn function one time for each element in the array.
\r
1881 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
\r
1882 * If thisArg is omitted, undefined is used as the this value.
\r
1884 map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array;
\r
1887 * Calls the specified callback function for all the elements in an array. The return value of
\r
1888 * the callback function is the accumulated result, and is provided as an argument in the next
\r
1889 * call to the callback function.
\r
1890 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
\r
1891 * callbackfn function one time for each element in the array.
\r
1892 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
1893 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
1894 * instead of an array value.
\r
1896 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;
\r
1897 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;
\r
1900 * Calls the specified callback function for all the elements in an array. The return value of
\r
1901 * the callback function is the accumulated result, and is provided as an argument in the next
\r
1902 * call to the callback function.
\r
1903 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
\r
1904 * callbackfn function one time for each element in the array.
\r
1905 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
1906 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
1907 * instead of an array value.
\r
1909 reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;
\r
1912 * Calls the specified callback function for all the elements in an array, in descending order.
\r
1913 * The return value of the callback function is the accumulated result, and is provided as an
\r
1914 * argument in the next call to the callback function.
\r
1915 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
\r
1916 * the callbackfn function one time for each element in the array.
\r
1917 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
1918 * the accumulation. The first call to the callbackfn function provides this value as an
\r
1919 * argument instead of an array value.
\r
1921 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;
\r
1922 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;
\r
1925 * Calls the specified callback function for all the elements in an array, in descending order.
\r
1926 * The return value of the callback function is the accumulated result, and is provided as an
\r
1927 * argument in the next call to the callback function.
\r
1928 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
\r
1929 * the callbackfn function one time for each element in the array.
\r
1930 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
1931 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
1932 * instead of an array value.
\r
1934 reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;
\r
1937 * Reverses the elements in an Array.
\r
1939 reverse(): Int8Array;
\r
1942 * Sets a value or an array of values.
\r
1943 * @param array A typed or untyped array of values to set.
\r
1944 * @param offset The index in the current array at which the values are to be written.
\r
1946 set(array: ArrayLike<number>, offset?: number): void;
\r
1949 * Returns a section of an array.
\r
1950 * @param start The beginning of the specified portion of the array.
\r
1951 * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
\r
1953 slice(start?: number, end?: number): Int8Array;
\r
1956 * Determines whether the specified callback function returns true for any element of an array.
\r
1957 * @param predicate A function that accepts up to three arguments. The some method calls
\r
1958 * the predicate function for each element in the array until the predicate returns a value
\r
1959 * which is coercible to the Boolean value true, or until the end of the array.
\r
1960 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
1961 * If thisArg is omitted, undefined is used as the this value.
\r
1963 some(predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): boolean;
\r
1967 * @param compareFn Function used to determine the order of the elements. It is expected to return
\r
1968 * a negative value if first argument is less than second argument, zero if they're equal and a positive
\r
1969 * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
\r
1971 * [11,2,22,1].sort((a, b) => a - b)
\r
1974 sort(compareFn?: (a: number, b: number) => number): this;
\r
1977 * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements
\r
1978 * at begin, inclusive, up to end, exclusive.
\r
1979 * @param begin The index of the beginning of the array.
\r
1980 * @param end The index of the end of the array.
\r
1982 subarray(begin?: number, end?: number): Int8Array;
\r
1985 * Converts a number to a string by using the current locale.
\r
1987 toLocaleString(): string;
\r
1990 * Returns a string representation of an array.
\r
1992 toString(): string;
\r
1994 /** Returns the primitive value of the specified object. */
\r
1995 valueOf(): Int8Array;
\r
1997 [index: number]: number;
\r
1999 interface Int8ArrayConstructor {
\r
2000 readonly prototype: Int8Array;
\r
2001 new(length: number): Int8Array;
\r
2002 new(array: ArrayLike<number> | ArrayBufferLike): Int8Array;
\r
2003 new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int8Array;
\r
2006 * The size in bytes of each element in the array.
\r
2008 readonly BYTES_PER_ELEMENT: number;
\r
2011 * Returns a new array from a set of elements.
\r
2012 * @param items A set of elements to include in the new array object.
\r
2014 of(...items: number[]): Int8Array;
\r
2017 * Creates an array from an array-like or iterable object.
\r
2018 * @param arrayLike An array-like or iterable object to convert to an array.
\r
2020 from(arrayLike: ArrayLike<number>): Int8Array;
\r
2023 * Creates an array from an array-like or iterable object.
\r
2024 * @param arrayLike An array-like or iterable object to convert to an array.
\r
2025 * @param mapfn A mapping function to call on every element of the array.
\r
2026 * @param thisArg Value of 'this' used to invoke the mapfn.
\r
2028 from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array;
\r
2032 declare var Int8Array: Int8ArrayConstructor;
\r
2035 * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the
\r
2036 * requested number of bytes could not be allocated an exception is raised.
\r
2038 interface Uint8Array {
\r
2040 * The size in bytes of each element in the array.
\r
2042 readonly BYTES_PER_ELEMENT: number;
\r
2045 * The ArrayBuffer instance referenced by the array.
\r
2047 readonly buffer: ArrayBufferLike;
\r
2050 * The length in bytes of the array.
\r
2052 readonly byteLength: number;
\r
2055 * The offset in bytes of the array.
\r
2057 readonly byteOffset: number;
\r
2060 * Returns the this object after copying a section of the array identified by start and end
\r
2061 * to the same array starting at position target
\r
2062 * @param target If target is negative, it is treated as length+target where length is the
\r
2063 * length of the array.
\r
2064 * @param start If start is negative, it is treated as length+start. If end is negative, it
\r
2065 * is treated as length+end.
\r
2066 * @param end If not specified, length of the this object is used as its default value.
\r
2068 copyWithin(target: number, start: number, end?: number): this;
\r
2071 * Determines whether all the members of an array satisfy the specified test.
\r
2072 * @param predicate A function that accepts up to three arguments. The every method calls
\r
2073 * the predicate function for each element in the array until the predicate returns a value
\r
2074 * which is coercible to the Boolean value false, or until the end of the array.
\r
2075 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
2076 * If thisArg is omitted, undefined is used as the this value.
\r
2078 every(predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): boolean;
\r
2081 * Returns the this object after filling the section identified by start and end with value
\r
2082 * @param value value to fill array section with
\r
2083 * @param start index to start filling the array at. If start is negative, it is treated as
\r
2084 * length+start where length is the length of the array.
\r
2085 * @param end index to stop filling the array at. If end is negative, it is treated as
\r
2088 fill(value: number, start?: number, end?: number): this;
\r
2091 * Returns the elements of an array that meet the condition specified in a callback function.
\r
2092 * @param predicate A function that accepts up to three arguments. The filter method calls
\r
2093 * the predicate function one time for each element in the array.
\r
2094 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
2095 * If thisArg is omitted, undefined is used as the this value.
\r
2097 filter(predicate: (value: number, index: number, array: Uint8Array) => any, thisArg?: any): Uint8Array;
\r
2100 * Returns the value of the first element in the array where predicate is true, and undefined
\r
2102 * @param predicate find calls predicate once for each element of the array, in ascending
\r
2103 * order, until it finds one where predicate returns true. If such an element is found, find
\r
2104 * immediately returns that element value. Otherwise, find returns undefined.
\r
2105 * @param thisArg If provided, it will be used as the this value for each invocation of
\r
2106 * predicate. If it is not provided, undefined is used instead.
\r
2108 find(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number | undefined;
\r
2111 * Returns the index of the first element in the array where predicate is true, and -1
\r
2113 * @param predicate find calls predicate once for each element of the array, in ascending
\r
2114 * order, until it finds one where predicate returns true. If such an element is found,
\r
2115 * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
\r
2116 * @param thisArg If provided, it will be used as the this value for each invocation of
\r
2117 * predicate. If it is not provided, undefined is used instead.
\r
2119 findIndex(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number;
\r
2122 * Performs the specified action for each element in an array.
\r
2123 * @param callbackfn A function that accepts up to three arguments. forEach calls the
\r
2124 * callbackfn function one time for each element in the array.
\r
2125 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
\r
2126 * If thisArg is omitted, undefined is used as the this value.
\r
2128 forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void;
\r
2131 * Returns the index of the first occurrence of a value in an array.
\r
2132 * @param searchElement The value to locate in the array.
\r
2133 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
\r
2134 * search starts at index 0.
\r
2136 indexOf(searchElement: number, fromIndex?: number): number;
\r
2139 * Adds all the elements of an array separated by the specified separator string.
\r
2140 * @param separator A string used to separate one element of an array from the next in the
\r
2141 * resulting String. If omitted, the array elements are separated with a comma.
\r
2143 join(separator?: string): string;
\r
2146 * Returns the index of the last occurrence of a value in an array.
\r
2147 * @param searchElement The value to locate in the array.
\r
2148 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
\r
2149 * search starts at index 0.
\r
2151 lastIndexOf(searchElement: number, fromIndex?: number): number;
\r
2154 * The length of the array.
\r
2156 readonly length: number;
\r
2159 * Calls a defined callback function on each element of an array, and returns an array that
\r
2160 * contains the results.
\r
2161 * @param callbackfn A function that accepts up to three arguments. The map method calls the
\r
2162 * callbackfn function one time for each element in the array.
\r
2163 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
\r
2164 * If thisArg is omitted, undefined is used as the this value.
\r
2166 map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array;
\r
2169 * Calls the specified callback function for all the elements in an array. The return value of
\r
2170 * the callback function is the accumulated result, and is provided as an argument in the next
\r
2171 * call to the callback function.
\r
2172 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
\r
2173 * callbackfn function one time for each element in the array.
\r
2174 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
2175 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
2176 * instead of an array value.
\r
2178 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;
\r
2179 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;
\r
2182 * Calls the specified callback function for all the elements in an array. The return value of
\r
2183 * the callback function is the accumulated result, and is provided as an argument in the next
\r
2184 * call to the callback function.
\r
2185 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
\r
2186 * callbackfn function one time for each element in the array.
\r
2187 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
2188 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
2189 * instead of an array value.
\r
2191 reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;
\r
2194 * Calls the specified callback function for all the elements in an array, in descending order.
\r
2195 * The return value of the callback function is the accumulated result, and is provided as an
\r
2196 * argument in the next call to the callback function.
\r
2197 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
\r
2198 * the callbackfn function one time for each element in the array.
\r
2199 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
2200 * the accumulation. The first call to the callbackfn function provides this value as an
\r
2201 * argument instead of an array value.
\r
2203 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;
\r
2204 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;
\r
2207 * Calls the specified callback function for all the elements in an array, in descending order.
\r
2208 * The return value of the callback function is the accumulated result, and is provided as an
\r
2209 * argument in the next call to the callback function.
\r
2210 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
\r
2211 * the callbackfn function one time for each element in the array.
\r
2212 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
2213 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
2214 * instead of an array value.
\r
2216 reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;
\r
2219 * Reverses the elements in an Array.
\r
2221 reverse(): Uint8Array;
\r
2224 * Sets a value or an array of values.
\r
2225 * @param array A typed or untyped array of values to set.
\r
2226 * @param offset The index in the current array at which the values are to be written.
\r
2228 set(array: ArrayLike<number>, offset?: number): void;
\r
2231 * Returns a section of an array.
\r
2232 * @param start The beginning of the specified portion of the array.
\r
2233 * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
\r
2235 slice(start?: number, end?: number): Uint8Array;
\r
2238 * Determines whether the specified callback function returns true for any element of an array.
\r
2239 * @param predicate A function that accepts up to three arguments. The some method calls
\r
2240 * the predicate function for each element in the array until the predicate returns a value
\r
2241 * which is coercible to the Boolean value true, or until the end of the array.
\r
2242 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
2243 * If thisArg is omitted, undefined is used as the this value.
\r
2245 some(predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): boolean;
\r
2249 * @param compareFn Function used to determine the order of the elements. It is expected to return
\r
2250 * a negative value if first argument is less than second argument, zero if they're equal and a positive
\r
2251 * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
\r
2253 * [11,2,22,1].sort((a, b) => a - b)
\r
2256 sort(compareFn?: (a: number, b: number) => number): this;
\r
2259 * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements
\r
2260 * at begin, inclusive, up to end, exclusive.
\r
2261 * @param begin The index of the beginning of the array.
\r
2262 * @param end The index of the end of the array.
\r
2264 subarray(begin?: number, end?: number): Uint8Array;
\r
2267 * Converts a number to a string by using the current locale.
\r
2269 toLocaleString(): string;
\r
2272 * Returns a string representation of an array.
\r
2274 toString(): string;
\r
2276 /** Returns the primitive value of the specified object. */
\r
2277 valueOf(): Uint8Array;
\r
2279 [index: number]: number;
\r
2282 interface Uint8ArrayConstructor {
\r
2283 readonly prototype: Uint8Array;
\r
2284 new(length: number): Uint8Array;
\r
2285 new(array: ArrayLike<number> | ArrayBufferLike): Uint8Array;
\r
2286 new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8Array;
\r
2289 * The size in bytes of each element in the array.
\r
2291 readonly BYTES_PER_ELEMENT: number;
\r
2294 * Returns a new array from a set of elements.
\r
2295 * @param items A set of elements to include in the new array object.
\r
2297 of(...items: number[]): Uint8Array;
\r
2300 * Creates an array from an array-like or iterable object.
\r
2301 * @param arrayLike An array-like or iterable object to convert to an array.
\r
2303 from(arrayLike: ArrayLike<number>): Uint8Array;
\r
2306 * Creates an array from an array-like or iterable object.
\r
2307 * @param arrayLike An array-like or iterable object to convert to an array.
\r
2308 * @param mapfn A mapping function to call on every element of the array.
\r
2309 * @param thisArg Value of 'this' used to invoke the mapfn.
\r
2311 from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array;
\r
2314 declare var Uint8Array: Uint8ArrayConstructor;
\r
2317 * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.
\r
2318 * If the requested number of bytes could not be allocated an exception is raised.
\r
2320 interface Uint8ClampedArray {
\r
2322 * The size in bytes of each element in the array.
\r
2324 readonly BYTES_PER_ELEMENT: number;
\r
2327 * The ArrayBuffer instance referenced by the array.
\r
2329 readonly buffer: ArrayBufferLike;
\r
2332 * The length in bytes of the array.
\r
2334 readonly byteLength: number;
\r
2337 * The offset in bytes of the array.
\r
2339 readonly byteOffset: number;
\r
2342 * Returns the this object after copying a section of the array identified by start and end
\r
2343 * to the same array starting at position target
\r
2344 * @param target If target is negative, it is treated as length+target where length is the
\r
2345 * length of the array.
\r
2346 * @param start If start is negative, it is treated as length+start. If end is negative, it
\r
2347 * is treated as length+end.
\r
2348 * @param end If not specified, length of the this object is used as its default value.
\r
2350 copyWithin(target: number, start: number, end?: number): this;
\r
2353 * Determines whether all the members of an array satisfy the specified test.
\r
2354 * @param predicate A function that accepts up to three arguments. The every method calls
\r
2355 * the predicate function for each element in the array until the predicate returns a value
\r
2356 * which is coercible to the Boolean value false, or until the end of the array.
\r
2357 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
2358 * If thisArg is omitted, undefined is used as the this value.
\r
2360 every(predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): boolean;
\r
2363 * Returns the this object after filling the section identified by start and end with value
\r
2364 * @param value value to fill array section with
\r
2365 * @param start index to start filling the array at. If start is negative, it is treated as
\r
2366 * length+start where length is the length of the array.
\r
2367 * @param end index to stop filling the array at. If end is negative, it is treated as
\r
2370 fill(value: number, start?: number, end?: number): this;
\r
2373 * Returns the elements of an array that meet the condition specified in a callback function.
\r
2374 * @param predicate A function that accepts up to three arguments. The filter method calls
\r
2375 * the predicate function one time for each element in the array.
\r
2376 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
2377 * If thisArg is omitted, undefined is used as the this value.
\r
2379 filter(predicate: (value: number, index: number, array: Uint8ClampedArray) => any, thisArg?: any): Uint8ClampedArray;
\r
2382 * Returns the value of the first element in the array where predicate is true, and undefined
\r
2384 * @param predicate find calls predicate once for each element of the array, in ascending
\r
2385 * order, until it finds one where predicate returns true. If such an element is found, find
\r
2386 * immediately returns that element value. Otherwise, find returns undefined.
\r
2387 * @param thisArg If provided, it will be used as the this value for each invocation of
\r
2388 * predicate. If it is not provided, undefined is used instead.
\r
2390 find(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number | undefined;
\r
2393 * Returns the index of the first element in the array where predicate is true, and -1
\r
2395 * @param predicate find calls predicate once for each element of the array, in ascending
\r
2396 * order, until it finds one where predicate returns true. If such an element is found,
\r
2397 * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
\r
2398 * @param thisArg If provided, it will be used as the this value for each invocation of
\r
2399 * predicate. If it is not provided, undefined is used instead.
\r
2401 findIndex(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number;
\r
2404 * Performs the specified action for each element in an array.
\r
2405 * @param callbackfn A function that accepts up to three arguments. forEach calls the
\r
2406 * callbackfn function one time for each element in the array.
\r
2407 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
\r
2408 * If thisArg is omitted, undefined is used as the this value.
\r
2410 forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void;
\r
2413 * Returns the index of the first occurrence of a value in an array.
\r
2414 * @param searchElement The value to locate in the array.
\r
2415 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
\r
2416 * search starts at index 0.
\r
2418 indexOf(searchElement: number, fromIndex?: number): number;
\r
2421 * Adds all the elements of an array separated by the specified separator string.
\r
2422 * @param separator A string used to separate one element of an array from the next in the
\r
2423 * resulting String. If omitted, the array elements are separated with a comma.
\r
2425 join(separator?: string): string;
\r
2428 * Returns the index of the last occurrence of a value in an array.
\r
2429 * @param searchElement The value to locate in the array.
\r
2430 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
\r
2431 * search starts at index 0.
\r
2433 lastIndexOf(searchElement: number, fromIndex?: number): number;
\r
2436 * The length of the array.
\r
2438 readonly length: number;
\r
2441 * Calls a defined callback function on each element of an array, and returns an array that
\r
2442 * contains the results.
\r
2443 * @param callbackfn A function that accepts up to three arguments. The map method calls the
\r
2444 * callbackfn function one time for each element in the array.
\r
2445 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
\r
2446 * If thisArg is omitted, undefined is used as the this value.
\r
2448 map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray;
\r
2451 * Calls the specified callback function for all the elements in an array. The return value of
\r
2452 * the callback function is the accumulated result, and is provided as an argument in the next
\r
2453 * call to the callback function.
\r
2454 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
\r
2455 * callbackfn function one time for each element in the array.
\r
2456 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
2457 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
2458 * instead of an array value.
\r
2460 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;
\r
2461 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;
\r
2464 * Calls the specified callback function for all the elements in an array. The return value of
\r
2465 * the callback function is the accumulated result, and is provided as an argument in the next
\r
2466 * call to the callback function.
\r
2467 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
\r
2468 * callbackfn function one time for each element in the array.
\r
2469 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
2470 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
2471 * instead of an array value.
\r
2473 reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;
\r
2476 * Calls the specified callback function for all the elements in an array, in descending order.
\r
2477 * The return value of the callback function is the accumulated result, and is provided as an
\r
2478 * argument in the next call to the callback function.
\r
2479 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
\r
2480 * the callbackfn function one time for each element in the array.
\r
2481 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
2482 * the accumulation. The first call to the callbackfn function provides this value as an
\r
2483 * argument instead of an array value.
\r
2485 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;
\r
2486 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;
\r
2489 * Calls the specified callback function for all the elements in an array, in descending order.
\r
2490 * The return value of the callback function is the accumulated result, and is provided as an
\r
2491 * argument in the next call to the callback function.
\r
2492 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
\r
2493 * the callbackfn function one time for each element in the array.
\r
2494 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
2495 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
2496 * instead of an array value.
\r
2498 reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;
\r
2501 * Reverses the elements in an Array.
\r
2503 reverse(): Uint8ClampedArray;
\r
2506 * Sets a value or an array of values.
\r
2507 * @param array A typed or untyped array of values to set.
\r
2508 * @param offset The index in the current array at which the values are to be written.
\r
2510 set(array: ArrayLike<number>, offset?: number): void;
\r
2513 * Returns a section of an array.
\r
2514 * @param start The beginning of the specified portion of the array.
\r
2515 * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
\r
2517 slice(start?: number, end?: number): Uint8ClampedArray;
\r
2520 * Determines whether the specified callback function returns true for any element of an array.
\r
2521 * @param predicate A function that accepts up to three arguments. The some method calls
\r
2522 * the predicate function for each element in the array until the predicate returns a value
\r
2523 * which is coercible to the Boolean value true, or until the end of the array.
\r
2524 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
2525 * If thisArg is omitted, undefined is used as the this value.
\r
2527 some(predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): boolean;
\r
2531 * @param compareFn Function used to determine the order of the elements. It is expected to return
\r
2532 * a negative value if first argument is less than second argument, zero if they're equal and a positive
\r
2533 * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
\r
2535 * [11,2,22,1].sort((a, b) => a - b)
\r
2538 sort(compareFn?: (a: number, b: number) => number): this;
\r
2541 * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements
\r
2542 * at begin, inclusive, up to end, exclusive.
\r
2543 * @param begin The index of the beginning of the array.
\r
2544 * @param end The index of the end of the array.
\r
2546 subarray(begin?: number, end?: number): Uint8ClampedArray;
\r
2549 * Converts a number to a string by using the current locale.
\r
2551 toLocaleString(): string;
\r
2554 * Returns a string representation of an array.
\r
2556 toString(): string;
\r
2558 /** Returns the primitive value of the specified object. */
\r
2559 valueOf(): Uint8ClampedArray;
\r
2561 [index: number]: number;
\r
2564 interface Uint8ClampedArrayConstructor {
\r
2565 readonly prototype: Uint8ClampedArray;
\r
2566 new(length: number): Uint8ClampedArray;
\r
2567 new(array: ArrayLike<number> | ArrayBufferLike): Uint8ClampedArray;
\r
2568 new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8ClampedArray;
\r
2571 * The size in bytes of each element in the array.
\r
2573 readonly BYTES_PER_ELEMENT: number;
\r
2576 * Returns a new array from a set of elements.
\r
2577 * @param items A set of elements to include in the new array object.
\r
2579 of(...items: number[]): Uint8ClampedArray;
\r
2582 * Creates an array from an array-like or iterable object.
\r
2583 * @param arrayLike An array-like or iterable object to convert to an array.
\r
2585 from(arrayLike: ArrayLike<number>): Uint8ClampedArray;
\r
2588 * Creates an array from an array-like or iterable object.
\r
2589 * @param arrayLike An array-like or iterable object to convert to an array.
\r
2590 * @param mapfn A mapping function to call on every element of the array.
\r
2591 * @param thisArg Value of 'this' used to invoke the mapfn.
\r
2593 from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray;
\r
2595 declare var Uint8ClampedArray: Uint8ClampedArrayConstructor;
\r
2598 * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the
\r
2599 * requested number of bytes could not be allocated an exception is raised.
\r
2601 interface Int16Array {
\r
2603 * The size in bytes of each element in the array.
\r
2605 readonly BYTES_PER_ELEMENT: number;
\r
2608 * The ArrayBuffer instance referenced by the array.
\r
2610 readonly buffer: ArrayBufferLike;
\r
2613 * The length in bytes of the array.
\r
2615 readonly byteLength: number;
\r
2618 * The offset in bytes of the array.
\r
2620 readonly byteOffset: number;
\r
2623 * Returns the this object after copying a section of the array identified by start and end
\r
2624 * to the same array starting at position target
\r
2625 * @param target If target is negative, it is treated as length+target where length is the
\r
2626 * length of the array.
\r
2627 * @param start If start is negative, it is treated as length+start. If end is negative, it
\r
2628 * is treated as length+end.
\r
2629 * @param end If not specified, length of the this object is used as its default value.
\r
2631 copyWithin(target: number, start: number, end?: number): this;
\r
2634 * Determines whether all the members of an array satisfy the specified test.
\r
2635 * @param predicate A function that accepts up to three arguments. The every method calls
\r
2636 * the predicate function for each element in the array until the predicate returns a value
\r
2637 * which is coercible to the Boolean value false, or until the end of the array.
\r
2638 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
2639 * If thisArg is omitted, undefined is used as the this value.
\r
2641 every(predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): boolean;
\r
2644 * Returns the this object after filling the section identified by start and end with value
\r
2645 * @param value value to fill array section with
\r
2646 * @param start index to start filling the array at. If start is negative, it is treated as
\r
2647 * length+start where length is the length of the array.
\r
2648 * @param end index to stop filling the array at. If end is negative, it is treated as
\r
2651 fill(value: number, start?: number, end?: number): this;
\r
2654 * Returns the elements of an array that meet the condition specified in a callback function.
\r
2655 * @param predicate A function that accepts up to three arguments. The filter method calls
\r
2656 * the predicate function one time for each element in the array.
\r
2657 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
2658 * If thisArg is omitted, undefined is used as the this value.
\r
2660 filter(predicate: (value: number, index: number, array: Int16Array) => any, thisArg?: any): Int16Array;
\r
2663 * Returns the value of the first element in the array where predicate is true, and undefined
\r
2665 * @param predicate find calls predicate once for each element of the array, in ascending
\r
2666 * order, until it finds one where predicate returns true. If such an element is found, find
\r
2667 * immediately returns that element value. Otherwise, find returns undefined.
\r
2668 * @param thisArg If provided, it will be used as the this value for each invocation of
\r
2669 * predicate. If it is not provided, undefined is used instead.
\r
2671 find(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number | undefined;
\r
2674 * Returns the index of the first element in the array where predicate is true, and -1
\r
2676 * @param predicate find calls predicate once for each element of the array, in ascending
\r
2677 * order, until it finds one where predicate returns true. If such an element is found,
\r
2678 * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
\r
2679 * @param thisArg If provided, it will be used as the this value for each invocation of
\r
2680 * predicate. If it is not provided, undefined is used instead.
\r
2682 findIndex(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number;
\r
2685 * Performs the specified action for each element in an array.
\r
2686 * @param callbackfn A function that accepts up to three arguments. forEach calls the
\r
2687 * callbackfn function one time for each element in the array.
\r
2688 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
\r
2689 * If thisArg is omitted, undefined is used as the this value.
\r
2691 forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void;
\r
2693 * Returns the index of the first occurrence of a value in an array.
\r
2694 * @param searchElement The value to locate in the array.
\r
2695 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
\r
2696 * search starts at index 0.
\r
2698 indexOf(searchElement: number, fromIndex?: number): number;
\r
2701 * Adds all the elements of an array separated by the specified separator string.
\r
2702 * @param separator A string used to separate one element of an array from the next in the
\r
2703 * resulting String. If omitted, the array elements are separated with a comma.
\r
2705 join(separator?: string): string;
\r
2708 * Returns the index of the last occurrence of a value in an array.
\r
2709 * @param searchElement The value to locate in the array.
\r
2710 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
\r
2711 * search starts at index 0.
\r
2713 lastIndexOf(searchElement: number, fromIndex?: number): number;
\r
2716 * The length of the array.
\r
2718 readonly length: number;
\r
2721 * Calls a defined callback function on each element of an array, and returns an array that
\r
2722 * contains the results.
\r
2723 * @param callbackfn A function that accepts up to three arguments. The map method calls the
\r
2724 * callbackfn function one time for each element in the array.
\r
2725 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
\r
2726 * If thisArg is omitted, undefined is used as the this value.
\r
2728 map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array;
\r
2731 * Calls the specified callback function for all the elements in an array. The return value of
\r
2732 * the callback function is the accumulated result, and is provided as an argument in the next
\r
2733 * call to the callback function.
\r
2734 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
\r
2735 * callbackfn function one time for each element in the array.
\r
2736 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
2737 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
2738 * instead of an array value.
\r
2740 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;
\r
2741 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;
\r
2744 * Calls the specified callback function for all the elements in an array. The return value of
\r
2745 * the callback function is the accumulated result, and is provided as an argument in the next
\r
2746 * call to the callback function.
\r
2747 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
\r
2748 * callbackfn function one time for each element in the array.
\r
2749 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
2750 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
2751 * instead of an array value.
\r
2753 reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;
\r
2756 * Calls the specified callback function for all the elements in an array, in descending order.
\r
2757 * The return value of the callback function is the accumulated result, and is provided as an
\r
2758 * argument in the next call to the callback function.
\r
2759 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
\r
2760 * the callbackfn function one time for each element in the array.
\r
2761 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
2762 * the accumulation. The first call to the callbackfn function provides this value as an
\r
2763 * argument instead of an array value.
\r
2765 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;
\r
2766 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;
\r
2769 * Calls the specified callback function for all the elements in an array, in descending order.
\r
2770 * The return value of the callback function is the accumulated result, and is provided as an
\r
2771 * argument in the next call to the callback function.
\r
2772 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
\r
2773 * the callbackfn function one time for each element in the array.
\r
2774 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
2775 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
2776 * instead of an array value.
\r
2778 reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;
\r
2781 * Reverses the elements in an Array.
\r
2783 reverse(): Int16Array;
\r
2786 * Sets a value or an array of values.
\r
2787 * @param array A typed or untyped array of values to set.
\r
2788 * @param offset The index in the current array at which the values are to be written.
\r
2790 set(array: ArrayLike<number>, offset?: number): void;
\r
2793 * Returns a section of an array.
\r
2794 * @param start The beginning of the specified portion of the array.
\r
2795 * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
\r
2797 slice(start?: number, end?: number): Int16Array;
\r
2800 * Determines whether the specified callback function returns true for any element of an array.
\r
2801 * @param predicate A function that accepts up to three arguments. The some method calls
\r
2802 * the predicate function for each element in the array until the predicate returns a value
\r
2803 * which is coercible to the Boolean value true, or until the end of the array.
\r
2804 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
2805 * If thisArg is omitted, undefined is used as the this value.
\r
2807 some(predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): boolean;
\r
2811 * @param compareFn Function used to determine the order of the elements. It is expected to return
\r
2812 * a negative value if first argument is less than second argument, zero if they're equal and a positive
\r
2813 * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
\r
2815 * [11,2,22,1].sort((a, b) => a - b)
\r
2818 sort(compareFn?: (a: number, b: number) => number): this;
\r
2821 * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements
\r
2822 * at begin, inclusive, up to end, exclusive.
\r
2823 * @param begin The index of the beginning of the array.
\r
2824 * @param end The index of the end of the array.
\r
2826 subarray(begin?: number, end?: number): Int16Array;
\r
2829 * Converts a number to a string by using the current locale.
\r
2831 toLocaleString(): string;
\r
2834 * Returns a string representation of an array.
\r
2836 toString(): string;
\r
2838 /** Returns the primitive value of the specified object. */
\r
2839 valueOf(): Int16Array;
\r
2841 [index: number]: number;
\r
2844 interface Int16ArrayConstructor {
\r
2845 readonly prototype: Int16Array;
\r
2846 new(length: number): Int16Array;
\r
2847 new(array: ArrayLike<number> | ArrayBufferLike): Int16Array;
\r
2848 new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int16Array;
\r
2851 * The size in bytes of each element in the array.
\r
2853 readonly BYTES_PER_ELEMENT: number;
\r
2856 * Returns a new array from a set of elements.
\r
2857 * @param items A set of elements to include in the new array object.
\r
2859 of(...items: number[]): Int16Array;
\r
2862 * Creates an array from an array-like or iterable object.
\r
2863 * @param arrayLike An array-like or iterable object to convert to an array.
\r
2865 from(arrayLike: ArrayLike<number>): Int16Array;
\r
2868 * Creates an array from an array-like or iterable object.
\r
2869 * @param arrayLike An array-like or iterable object to convert to an array.
\r
2870 * @param mapfn A mapping function to call on every element of the array.
\r
2871 * @param thisArg Value of 'this' used to invoke the mapfn.
\r
2873 from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array;
\r
2877 declare var Int16Array: Int16ArrayConstructor;
\r
2880 * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the
\r
2881 * requested number of bytes could not be allocated an exception is raised.
\r
2883 interface Uint16Array {
\r
2885 * The size in bytes of each element in the array.
\r
2887 readonly BYTES_PER_ELEMENT: number;
\r
2890 * The ArrayBuffer instance referenced by the array.
\r
2892 readonly buffer: ArrayBufferLike;
\r
2895 * The length in bytes of the array.
\r
2897 readonly byteLength: number;
\r
2900 * The offset in bytes of the array.
\r
2902 readonly byteOffset: number;
\r
2905 * Returns the this object after copying a section of the array identified by start and end
\r
2906 * to the same array starting at position target
\r
2907 * @param target If target is negative, it is treated as length+target where length is the
\r
2908 * length of the array.
\r
2909 * @param start If start is negative, it is treated as length+start. If end is negative, it
\r
2910 * is treated as length+end.
\r
2911 * @param end If not specified, length of the this object is used as its default value.
\r
2913 copyWithin(target: number, start: number, end?: number): this;
\r
2916 * Determines whether all the members of an array satisfy the specified test.
\r
2917 * @param predicate A function that accepts up to three arguments. The every method calls
\r
2918 * the predicate function for each element in the array until the predicate returns a value
\r
2919 * which is coercible to the Boolean value false, or until the end of the array.
\r
2920 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
2921 * If thisArg is omitted, undefined is used as the this value.
\r
2923 every(predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): boolean;
\r
2926 * Returns the this object after filling the section identified by start and end with value
\r
2927 * @param value value to fill array section with
\r
2928 * @param start index to start filling the array at. If start is negative, it is treated as
\r
2929 * length+start where length is the length of the array.
\r
2930 * @param end index to stop filling the array at. If end is negative, it is treated as
\r
2933 fill(value: number, start?: number, end?: number): this;
\r
2936 * Returns the elements of an array that meet the condition specified in a callback function.
\r
2937 * @param predicate A function that accepts up to three arguments. The filter method calls
\r
2938 * the predicate function one time for each element in the array.
\r
2939 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
2940 * If thisArg is omitted, undefined is used as the this value.
\r
2942 filter(predicate: (value: number, index: number, array: Uint16Array) => any, thisArg?: any): Uint16Array;
\r
2945 * Returns the value of the first element in the array where predicate is true, and undefined
\r
2947 * @param predicate find calls predicate once for each element of the array, in ascending
\r
2948 * order, until it finds one where predicate returns true. If such an element is found, find
\r
2949 * immediately returns that element value. Otherwise, find returns undefined.
\r
2950 * @param thisArg If provided, it will be used as the this value for each invocation of
\r
2951 * predicate. If it is not provided, undefined is used instead.
\r
2953 find(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number | undefined;
\r
2956 * Returns the index of the first element in the array where predicate is true, and -1
\r
2958 * @param predicate find calls predicate once for each element of the array, in ascending
\r
2959 * order, until it finds one where predicate returns true. If such an element is found,
\r
2960 * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
\r
2961 * @param thisArg If provided, it will be used as the this value for each invocation of
\r
2962 * predicate. If it is not provided, undefined is used instead.
\r
2964 findIndex(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number;
\r
2967 * Performs the specified action for each element in an array.
\r
2968 * @param callbackfn A function that accepts up to three arguments. forEach calls the
\r
2969 * callbackfn function one time for each element in the array.
\r
2970 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
\r
2971 * If thisArg is omitted, undefined is used as the this value.
\r
2973 forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void;
\r
2976 * Returns the index of the first occurrence of a value in an array.
\r
2977 * @param searchElement The value to locate in the array.
\r
2978 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
\r
2979 * search starts at index 0.
\r
2981 indexOf(searchElement: number, fromIndex?: number): number;
\r
2984 * Adds all the elements of an array separated by the specified separator string.
\r
2985 * @param separator A string used to separate one element of an array from the next in the
\r
2986 * resulting String. If omitted, the array elements are separated with a comma.
\r
2988 join(separator?: string): string;
\r
2991 * Returns the index of the last occurrence of a value in an array.
\r
2992 * @param searchElement The value to locate in the array.
\r
2993 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
\r
2994 * search starts at index 0.
\r
2996 lastIndexOf(searchElement: number, fromIndex?: number): number;
\r
2999 * The length of the array.
\r
3001 readonly length: number;
\r
3004 * Calls a defined callback function on each element of an array, and returns an array that
\r
3005 * contains the results.
\r
3006 * @param callbackfn A function that accepts up to three arguments. The map method calls the
\r
3007 * callbackfn function one time for each element in the array.
\r
3008 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
\r
3009 * If thisArg is omitted, undefined is used as the this value.
\r
3011 map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array;
\r
3014 * Calls the specified callback function for all the elements in an array. The return value of
\r
3015 * the callback function is the accumulated result, and is provided as an argument in the next
\r
3016 * call to the callback function.
\r
3017 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
\r
3018 * callbackfn function one time for each element in the array.
\r
3019 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
3020 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
3021 * instead of an array value.
\r
3023 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;
\r
3024 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;
\r
3027 * Calls the specified callback function for all the elements in an array. The return value of
\r
3028 * the callback function is the accumulated result, and is provided as an argument in the next
\r
3029 * call to the callback function.
\r
3030 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
\r
3031 * callbackfn function one time for each element in the array.
\r
3032 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
3033 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
3034 * instead of an array value.
\r
3036 reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;
\r
3039 * Calls the specified callback function for all the elements in an array, in descending order.
\r
3040 * The return value of the callback function is the accumulated result, and is provided as an
\r
3041 * argument in the next call to the callback function.
\r
3042 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
\r
3043 * the callbackfn function one time for each element in the array.
\r
3044 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
3045 * the accumulation. The first call to the callbackfn function provides this value as an
\r
3046 * argument instead of an array value.
\r
3048 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;
\r
3049 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;
\r
3052 * Calls the specified callback function for all the elements in an array, in descending order.
\r
3053 * The return value of the callback function is the accumulated result, and is provided as an
\r
3054 * argument in the next call to the callback function.
\r
3055 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
\r
3056 * the callbackfn function one time for each element in the array.
\r
3057 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
3058 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
3059 * instead of an array value.
\r
3061 reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;
\r
3064 * Reverses the elements in an Array.
\r
3066 reverse(): Uint16Array;
\r
3069 * Sets a value or an array of values.
\r
3070 * @param array A typed or untyped array of values to set.
\r
3071 * @param offset The index in the current array at which the values are to be written.
\r
3073 set(array: ArrayLike<number>, offset?: number): void;
\r
3076 * Returns a section of an array.
\r
3077 * @param start The beginning of the specified portion of the array.
\r
3078 * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
\r
3080 slice(start?: number, end?: number): Uint16Array;
\r
3083 * Determines whether the specified callback function returns true for any element of an array.
\r
3084 * @param predicate A function that accepts up to three arguments. The some method calls
\r
3085 * the predicate function for each element in the array until the predicate returns a value
\r
3086 * which is coercible to the Boolean value true, or until the end of the array.
\r
3087 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
3088 * If thisArg is omitted, undefined is used as the this value.
\r
3090 some(predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): boolean;
\r
3094 * @param compareFn Function used to determine the order of the elements. It is expected to return
\r
3095 * a negative value if first argument is less than second argument, zero if they're equal and a positive
\r
3096 * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
\r
3098 * [11,2,22,1].sort((a, b) => a - b)
\r
3101 sort(compareFn?: (a: number, b: number) => number): this;
\r
3104 * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements
\r
3105 * at begin, inclusive, up to end, exclusive.
\r
3106 * @param begin The index of the beginning of the array.
\r
3107 * @param end The index of the end of the array.
\r
3109 subarray(begin?: number, end?: number): Uint16Array;
\r
3112 * Converts a number to a string by using the current locale.
\r
3114 toLocaleString(): string;
\r
3117 * Returns a string representation of an array.
\r
3119 toString(): string;
\r
3121 /** Returns the primitive value of the specified object. */
\r
3122 valueOf(): Uint16Array;
\r
3124 [index: number]: number;
\r
3127 interface Uint16ArrayConstructor {
\r
3128 readonly prototype: Uint16Array;
\r
3129 new(length: number): Uint16Array;
\r
3130 new(array: ArrayLike<number> | ArrayBufferLike): Uint16Array;
\r
3131 new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint16Array;
\r
3134 * The size in bytes of each element in the array.
\r
3136 readonly BYTES_PER_ELEMENT: number;
\r
3139 * Returns a new array from a set of elements.
\r
3140 * @param items A set of elements to include in the new array object.
\r
3142 of(...items: number[]): Uint16Array;
\r
3145 * Creates an array from an array-like or iterable object.
\r
3146 * @param arrayLike An array-like or iterable object to convert to an array.
\r
3148 from(arrayLike: ArrayLike<number>): Uint16Array;
\r
3151 * Creates an array from an array-like or iterable object.
\r
3152 * @param arrayLike An array-like or iterable object to convert to an array.
\r
3153 * @param mapfn A mapping function to call on every element of the array.
\r
3154 * @param thisArg Value of 'this' used to invoke the mapfn.
\r
3156 from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array;
\r
3160 declare var Uint16Array: Uint16ArrayConstructor;
\r
3162 * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the
\r
3163 * requested number of bytes could not be allocated an exception is raised.
\r
3165 interface Int32Array {
\r
3167 * The size in bytes of each element in the array.
\r
3169 readonly BYTES_PER_ELEMENT: number;
\r
3172 * The ArrayBuffer instance referenced by the array.
\r
3174 readonly buffer: ArrayBufferLike;
\r
3177 * The length in bytes of the array.
\r
3179 readonly byteLength: number;
\r
3182 * The offset in bytes of the array.
\r
3184 readonly byteOffset: number;
\r
3187 * Returns the this object after copying a section of the array identified by start and end
\r
3188 * to the same array starting at position target
\r
3189 * @param target If target is negative, it is treated as length+target where length is the
\r
3190 * length of the array.
\r
3191 * @param start If start is negative, it is treated as length+start. If end is negative, it
\r
3192 * is treated as length+end.
\r
3193 * @param end If not specified, length of the this object is used as its default value.
\r
3195 copyWithin(target: number, start: number, end?: number): this;
\r
3198 * Determines whether all the members of an array satisfy the specified test.
\r
3199 * @param predicate A function that accepts up to three arguments. The every method calls
\r
3200 * the predicate function for each element in the array until the predicate returns a value
\r
3201 * which is coercible to the Boolean value false, or until the end of the array.
\r
3202 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
3203 * If thisArg is omitted, undefined is used as the this value.
\r
3205 every(predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): boolean;
\r
3208 * Returns the this object after filling the section identified by start and end with value
\r
3209 * @param value value to fill array section with
\r
3210 * @param start index to start filling the array at. If start is negative, it is treated as
\r
3211 * length+start where length is the length of the array.
\r
3212 * @param end index to stop filling the array at. If end is negative, it is treated as
\r
3215 fill(value: number, start?: number, end?: number): this;
\r
3218 * Returns the elements of an array that meet the condition specified in a callback function.
\r
3219 * @param predicate A function that accepts up to three arguments. The filter method calls
\r
3220 * the predicate function one time for each element in the array.
\r
3221 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
3222 * If thisArg is omitted, undefined is used as the this value.
\r
3224 filter(predicate: (value: number, index: number, array: Int32Array) => any, thisArg?: any): Int32Array;
\r
3227 * Returns the value of the first element in the array where predicate is true, and undefined
\r
3229 * @param predicate find calls predicate once for each element of the array, in ascending
\r
3230 * order, until it finds one where predicate returns true. If such an element is found, find
\r
3231 * immediately returns that element value. Otherwise, find returns undefined.
\r
3232 * @param thisArg If provided, it will be used as the this value for each invocation of
\r
3233 * predicate. If it is not provided, undefined is used instead.
\r
3235 find(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number | undefined;
\r
3238 * Returns the index of the first element in the array where predicate is true, and -1
\r
3240 * @param predicate find calls predicate once for each element of the array, in ascending
\r
3241 * order, until it finds one where predicate returns true. If such an element is found,
\r
3242 * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
\r
3243 * @param thisArg If provided, it will be used as the this value for each invocation of
\r
3244 * predicate. If it is not provided, undefined is used instead.
\r
3246 findIndex(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number;
\r
3249 * Performs the specified action for each element in an array.
\r
3250 * @param callbackfn A function that accepts up to three arguments. forEach calls the
\r
3251 * callbackfn function one time for each element in the array.
\r
3252 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
\r
3253 * If thisArg is omitted, undefined is used as the this value.
\r
3255 forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void;
\r
3258 * Returns the index of the first occurrence of a value in an array.
\r
3259 * @param searchElement The value to locate in the array.
\r
3260 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
\r
3261 * search starts at index 0.
\r
3263 indexOf(searchElement: number, fromIndex?: number): number;
\r
3266 * Adds all the elements of an array separated by the specified separator string.
\r
3267 * @param separator A string used to separate one element of an array from the next in the
\r
3268 * resulting String. If omitted, the array elements are separated with a comma.
\r
3270 join(separator?: string): string;
\r
3273 * Returns the index of the last occurrence of a value in an array.
\r
3274 * @param searchElement The value to locate in the array.
\r
3275 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
\r
3276 * search starts at index 0.
\r
3278 lastIndexOf(searchElement: number, fromIndex?: number): number;
\r
3281 * The length of the array.
\r
3283 readonly length: number;
\r
3286 * Calls a defined callback function on each element of an array, and returns an array that
\r
3287 * contains the results.
\r
3288 * @param callbackfn A function that accepts up to three arguments. The map method calls the
\r
3289 * callbackfn function one time for each element in the array.
\r
3290 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
\r
3291 * If thisArg is omitted, undefined is used as the this value.
\r
3293 map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array;
\r
3296 * Calls the specified callback function for all the elements in an array. The return value of
\r
3297 * the callback function is the accumulated result, and is provided as an argument in the next
\r
3298 * call to the callback function.
\r
3299 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
\r
3300 * callbackfn function one time for each element in the array.
\r
3301 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
3302 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
3303 * instead of an array value.
\r
3305 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;
\r
3306 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;
\r
3309 * Calls the specified callback function for all the elements in an array. The return value of
\r
3310 * the callback function is the accumulated result, and is provided as an argument in the next
\r
3311 * call to the callback function.
\r
3312 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
\r
3313 * callbackfn function one time for each element in the array.
\r
3314 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
3315 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
3316 * instead of an array value.
\r
3318 reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;
\r
3321 * Calls the specified callback function for all the elements in an array, in descending order.
\r
3322 * The return value of the callback function is the accumulated result, and is provided as an
\r
3323 * argument in the next call to the callback function.
\r
3324 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
\r
3325 * the callbackfn function one time for each element in the array.
\r
3326 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
3327 * the accumulation. The first call to the callbackfn function provides this value as an
\r
3328 * argument instead of an array value.
\r
3330 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;
\r
3331 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;
\r
3334 * Calls the specified callback function for all the elements in an array, in descending order.
\r
3335 * The return value of the callback function is the accumulated result, and is provided as an
\r
3336 * argument in the next call to the callback function.
\r
3337 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
\r
3338 * the callbackfn function one time for each element in the array.
\r
3339 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
3340 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
3341 * instead of an array value.
\r
3343 reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;
\r
3346 * Reverses the elements in an Array.
\r
3348 reverse(): Int32Array;
\r
3351 * Sets a value or an array of values.
\r
3352 * @param array A typed or untyped array of values to set.
\r
3353 * @param offset The index in the current array at which the values are to be written.
\r
3355 set(array: ArrayLike<number>, offset?: number): void;
\r
3358 * Returns a section of an array.
\r
3359 * @param start The beginning of the specified portion of the array.
\r
3360 * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
\r
3362 slice(start?: number, end?: number): Int32Array;
\r
3365 * Determines whether the specified callback function returns true for any element of an array.
\r
3366 * @param predicate A function that accepts up to three arguments. The some method calls
\r
3367 * the predicate function for each element in the array until the predicate returns a value
\r
3368 * which is coercible to the Boolean value true, or until the end of the array.
\r
3369 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
3370 * If thisArg is omitted, undefined is used as the this value.
\r
3372 some(predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): boolean;
\r
3376 * @param compareFn Function used to determine the order of the elements. It is expected to return
\r
3377 * a negative value if first argument is less than second argument, zero if they're equal and a positive
\r
3378 * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
\r
3380 * [11,2,22,1].sort((a, b) => a - b)
\r
3383 sort(compareFn?: (a: number, b: number) => number): this;
\r
3386 * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements
\r
3387 * at begin, inclusive, up to end, exclusive.
\r
3388 * @param begin The index of the beginning of the array.
\r
3389 * @param end The index of the end of the array.
\r
3391 subarray(begin?: number, end?: number): Int32Array;
\r
3394 * Converts a number to a string by using the current locale.
\r
3396 toLocaleString(): string;
\r
3399 * Returns a string representation of an array.
\r
3401 toString(): string;
\r
3403 /** Returns the primitive value of the specified object. */
\r
3404 valueOf(): Int32Array;
\r
3406 [index: number]: number;
\r
3409 interface Int32ArrayConstructor {
\r
3410 readonly prototype: Int32Array;
\r
3411 new(length: number): Int32Array;
\r
3412 new(array: ArrayLike<number> | ArrayBufferLike): Int32Array;
\r
3413 new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int32Array;
\r
3416 * The size in bytes of each element in the array.
\r
3418 readonly BYTES_PER_ELEMENT: number;
\r
3421 * Returns a new array from a set of elements.
\r
3422 * @param items A set of elements to include in the new array object.
\r
3424 of(...items: number[]): Int32Array;
\r
3427 * Creates an array from an array-like or iterable object.
\r
3428 * @param arrayLike An array-like or iterable object to convert to an array.
\r
3430 from(arrayLike: ArrayLike<number>): Int32Array;
\r
3433 * Creates an array from an array-like or iterable object.
\r
3434 * @param arrayLike An array-like or iterable object to convert to an array.
\r
3435 * @param mapfn A mapping function to call on every element of the array.
\r
3436 * @param thisArg Value of 'this' used to invoke the mapfn.
\r
3438 from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array;
\r
3441 declare var Int32Array: Int32ArrayConstructor;
\r
3444 * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the
\r
3445 * requested number of bytes could not be allocated an exception is raised.
\r
3447 interface Uint32Array {
\r
3449 * The size in bytes of each element in the array.
\r
3451 readonly BYTES_PER_ELEMENT: number;
\r
3454 * The ArrayBuffer instance referenced by the array.
\r
3456 readonly buffer: ArrayBufferLike;
\r
3459 * The length in bytes of the array.
\r
3461 readonly byteLength: number;
\r
3464 * The offset in bytes of the array.
\r
3466 readonly byteOffset: number;
\r
3469 * Returns the this object after copying a section of the array identified by start and end
\r
3470 * to the same array starting at position target
\r
3471 * @param target If target is negative, it is treated as length+target where length is the
\r
3472 * length of the array.
\r
3473 * @param start If start is negative, it is treated as length+start. If end is negative, it
\r
3474 * is treated as length+end.
\r
3475 * @param end If not specified, length of the this object is used as its default value.
\r
3477 copyWithin(target: number, start: number, end?: number): this;
\r
3480 * Determines whether all the members of an array satisfy the specified test.
\r
3481 * @param predicate A function that accepts up to three arguments. The every method calls
\r
3482 * the predicate function for each element in the array until the predicate returns a value
\r
3483 * which is coercible to the Boolean value false, or until the end of the array.
\r
3484 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
3485 * If thisArg is omitted, undefined is used as the this value.
\r
3487 every(predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): boolean;
\r
3490 * Returns the this object after filling the section identified by start and end with value
\r
3491 * @param value value to fill array section with
\r
3492 * @param start index to start filling the array at. If start is negative, it is treated as
\r
3493 * length+start where length is the length of the array.
\r
3494 * @param end index to stop filling the array at. If end is negative, it is treated as
\r
3497 fill(value: number, start?: number, end?: number): this;
\r
3500 * Returns the elements of an array that meet the condition specified in a callback function.
\r
3501 * @param predicate A function that accepts up to three arguments. The filter method calls
\r
3502 * the predicate function one time for each element in the array.
\r
3503 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
3504 * If thisArg is omitted, undefined is used as the this value.
\r
3506 filter(predicate: (value: number, index: number, array: Uint32Array) => any, thisArg?: any): Uint32Array;
\r
3509 * Returns the value of the first element in the array where predicate is true, and undefined
\r
3511 * @param predicate find calls predicate once for each element of the array, in ascending
\r
3512 * order, until it finds one where predicate returns true. If such an element is found, find
\r
3513 * immediately returns that element value. Otherwise, find returns undefined.
\r
3514 * @param thisArg If provided, it will be used as the this value for each invocation of
\r
3515 * predicate. If it is not provided, undefined is used instead.
\r
3517 find(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number | undefined;
\r
3520 * Returns the index of the first element in the array where predicate is true, and -1
\r
3522 * @param predicate find calls predicate once for each element of the array, in ascending
\r
3523 * order, until it finds one where predicate returns true. If such an element is found,
\r
3524 * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
\r
3525 * @param thisArg If provided, it will be used as the this value for each invocation of
\r
3526 * predicate. If it is not provided, undefined is used instead.
\r
3528 findIndex(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number;
\r
3531 * Performs the specified action for each element in an array.
\r
3532 * @param callbackfn A function that accepts up to three arguments. forEach calls the
\r
3533 * callbackfn function one time for each element in the array.
\r
3534 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
\r
3535 * If thisArg is omitted, undefined is used as the this value.
\r
3537 forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void;
\r
3539 * Returns the index of the first occurrence of a value in an array.
\r
3540 * @param searchElement The value to locate in the array.
\r
3541 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
\r
3542 * search starts at index 0.
\r
3544 indexOf(searchElement: number, fromIndex?: number): number;
\r
3547 * Adds all the elements of an array separated by the specified separator string.
\r
3548 * @param separator A string used to separate one element of an array from the next in the
\r
3549 * resulting String. If omitted, the array elements are separated with a comma.
\r
3551 join(separator?: string): string;
\r
3554 * Returns the index of the last occurrence of a value in an array.
\r
3555 * @param searchElement The value to locate in the array.
\r
3556 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
\r
3557 * search starts at index 0.
\r
3559 lastIndexOf(searchElement: number, fromIndex?: number): number;
\r
3562 * The length of the array.
\r
3564 readonly length: number;
\r
3567 * Calls a defined callback function on each element of an array, and returns an array that
\r
3568 * contains the results.
\r
3569 * @param callbackfn A function that accepts up to three arguments. The map method calls the
\r
3570 * callbackfn function one time for each element in the array.
\r
3571 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
\r
3572 * If thisArg is omitted, undefined is used as the this value.
\r
3574 map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array;
\r
3577 * Calls the specified callback function for all the elements in an array. The return value of
\r
3578 * the callback function is the accumulated result, and is provided as an argument in the next
\r
3579 * call to the callback function.
\r
3580 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
\r
3581 * callbackfn function one time for each element in the array.
\r
3582 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
3583 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
3584 * instead of an array value.
\r
3586 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;
\r
3587 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;
\r
3590 * Calls the specified callback function for all the elements in an array. The return value of
\r
3591 * the callback function is the accumulated result, and is provided as an argument in the next
\r
3592 * call to the callback function.
\r
3593 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
\r
3594 * callbackfn function one time for each element in the array.
\r
3595 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
3596 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
3597 * instead of an array value.
\r
3599 reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;
\r
3602 * Calls the specified callback function for all the elements in an array, in descending order.
\r
3603 * The return value of the callback function is the accumulated result, and is provided as an
\r
3604 * argument in the next call to the callback function.
\r
3605 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
\r
3606 * the callbackfn function one time for each element in the array.
\r
3607 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
3608 * the accumulation. The first call to the callbackfn function provides this value as an
\r
3609 * argument instead of an array value.
\r
3611 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;
\r
3612 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;
\r
3615 * Calls the specified callback function for all the elements in an array, in descending order.
\r
3616 * The return value of the callback function is the accumulated result, and is provided as an
\r
3617 * argument in the next call to the callback function.
\r
3618 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
\r
3619 * the callbackfn function one time for each element in the array.
\r
3620 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
3621 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
3622 * instead of an array value.
\r
3624 reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;
\r
3627 * Reverses the elements in an Array.
\r
3629 reverse(): Uint32Array;
\r
3632 * Sets a value or an array of values.
\r
3633 * @param array A typed or untyped array of values to set.
\r
3634 * @param offset The index in the current array at which the values are to be written.
\r
3636 set(array: ArrayLike<number>, offset?: number): void;
\r
3639 * Returns a section of an array.
\r
3640 * @param start The beginning of the specified portion of the array.
\r
3641 * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
\r
3643 slice(start?: number, end?: number): Uint32Array;
\r
3646 * Determines whether the specified callback function returns true for any element of an array.
\r
3647 * @param predicate A function that accepts up to three arguments. The some method calls
\r
3648 * the predicate function for each element in the array until the predicate returns a value
\r
3649 * which is coercible to the Boolean value true, or until the end of the array.
\r
3650 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
3651 * If thisArg is omitted, undefined is used as the this value.
\r
3653 some(predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): boolean;
\r
3657 * @param compareFn Function used to determine the order of the elements. It is expected to return
\r
3658 * a negative value if first argument is less than second argument, zero if they're equal and a positive
\r
3659 * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
\r
3661 * [11,2,22,1].sort((a, b) => a - b)
\r
3664 sort(compareFn?: (a: number, b: number) => number): this;
\r
3667 * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements
\r
3668 * at begin, inclusive, up to end, exclusive.
\r
3669 * @param begin The index of the beginning of the array.
\r
3670 * @param end The index of the end of the array.
\r
3672 subarray(begin?: number, end?: number): Uint32Array;
\r
3675 * Converts a number to a string by using the current locale.
\r
3677 toLocaleString(): string;
\r
3680 * Returns a string representation of an array.
\r
3682 toString(): string;
\r
3684 /** Returns the primitive value of the specified object. */
\r
3685 valueOf(): Uint32Array;
\r
3687 [index: number]: number;
\r
3690 interface Uint32ArrayConstructor {
\r
3691 readonly prototype: Uint32Array;
\r
3692 new(length: number): Uint32Array;
\r
3693 new(array: ArrayLike<number> | ArrayBufferLike): Uint32Array;
\r
3694 new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint32Array;
\r
3697 * The size in bytes of each element in the array.
\r
3699 readonly BYTES_PER_ELEMENT: number;
\r
3702 * Returns a new array from a set of elements.
\r
3703 * @param items A set of elements to include in the new array object.
\r
3705 of(...items: number[]): Uint32Array;
\r
3708 * Creates an array from an array-like or iterable object.
\r
3709 * @param arrayLike An array-like or iterable object to convert to an array.
\r
3711 from(arrayLike: ArrayLike<number>): Uint32Array;
\r
3714 * Creates an array from an array-like or iterable object.
\r
3715 * @param arrayLike An array-like or iterable object to convert to an array.
\r
3716 * @param mapfn A mapping function to call on every element of the array.
\r
3717 * @param thisArg Value of 'this' used to invoke the mapfn.
\r
3719 from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array;
\r
3722 declare var Uint32Array: Uint32ArrayConstructor;
\r
3725 * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number
\r
3726 * of bytes could not be allocated an exception is raised.
\r
3728 interface Float32Array {
\r
3730 * The size in bytes of each element in the array.
\r
3732 readonly BYTES_PER_ELEMENT: number;
\r
3735 * The ArrayBuffer instance referenced by the array.
\r
3737 readonly buffer: ArrayBufferLike;
\r
3740 * The length in bytes of the array.
\r
3742 readonly byteLength: number;
\r
3745 * The offset in bytes of the array.
\r
3747 readonly byteOffset: number;
\r
3750 * Returns the this object after copying a section of the array identified by start and end
\r
3751 * to the same array starting at position target
\r
3752 * @param target If target is negative, it is treated as length+target where length is the
\r
3753 * length of the array.
\r
3754 * @param start If start is negative, it is treated as length+start. If end is negative, it
\r
3755 * is treated as length+end.
\r
3756 * @param end If not specified, length of the this object is used as its default value.
\r
3758 copyWithin(target: number, start: number, end?: number): this;
\r
3761 * Determines whether all the members of an array satisfy the specified test.
\r
3762 * @param predicate A function that accepts up to three arguments. The every method calls
\r
3763 * the predicate function for each element in the array until the predicate returns a value
\r
3764 * which is coercible to the Boolean value false, or until the end of the array.
\r
3765 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
3766 * If thisArg is omitted, undefined is used as the this value.
\r
3768 every(predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): boolean;
\r
3771 * Returns the this object after filling the section identified by start and end with value
\r
3772 * @param value value to fill array section with
\r
3773 * @param start index to start filling the array at. If start is negative, it is treated as
\r
3774 * length+start where length is the length of the array.
\r
3775 * @param end index to stop filling the array at. If end is negative, it is treated as
\r
3778 fill(value: number, start?: number, end?: number): this;
\r
3781 * Returns the elements of an array that meet the condition specified in a callback function.
\r
3782 * @param predicate A function that accepts up to three arguments. The filter method calls
\r
3783 * the predicate function one time for each element in the array.
\r
3784 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
3785 * If thisArg is omitted, undefined is used as the this value.
\r
3787 filter(predicate: (value: number, index: number, array: Float32Array) => any, thisArg?: any): Float32Array;
\r
3790 * Returns the value of the first element in the array where predicate is true, and undefined
\r
3792 * @param predicate find calls predicate once for each element of the array, in ascending
\r
3793 * order, until it finds one where predicate returns true. If such an element is found, find
\r
3794 * immediately returns that element value. Otherwise, find returns undefined.
\r
3795 * @param thisArg If provided, it will be used as the this value for each invocation of
\r
3796 * predicate. If it is not provided, undefined is used instead.
\r
3798 find(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number | undefined;
\r
3801 * Returns the index of the first element in the array where predicate is true, and -1
\r
3803 * @param predicate find calls predicate once for each element of the array, in ascending
\r
3804 * order, until it finds one where predicate returns true. If such an element is found,
\r
3805 * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
\r
3806 * @param thisArg If provided, it will be used as the this value for each invocation of
\r
3807 * predicate. If it is not provided, undefined is used instead.
\r
3809 findIndex(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number;
\r
3812 * Performs the specified action for each element in an array.
\r
3813 * @param callbackfn A function that accepts up to three arguments. forEach calls the
\r
3814 * callbackfn function one time for each element in the array.
\r
3815 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
\r
3816 * If thisArg is omitted, undefined is used as the this value.
\r
3818 forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void;
\r
3821 * Returns the index of the first occurrence of a value in an array.
\r
3822 * @param searchElement The value to locate in the array.
\r
3823 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
\r
3824 * search starts at index 0.
\r
3826 indexOf(searchElement: number, fromIndex?: number): number;
\r
3829 * Adds all the elements of an array separated by the specified separator string.
\r
3830 * @param separator A string used to separate one element of an array from the next in the
\r
3831 * resulting String. If omitted, the array elements are separated with a comma.
\r
3833 join(separator?: string): string;
\r
3836 * Returns the index of the last occurrence of a value in an array.
\r
3837 * @param searchElement The value to locate in the array.
\r
3838 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
\r
3839 * search starts at index 0.
\r
3841 lastIndexOf(searchElement: number, fromIndex?: number): number;
\r
3844 * The length of the array.
\r
3846 readonly length: number;
\r
3849 * Calls a defined callback function on each element of an array, and returns an array that
\r
3850 * contains the results.
\r
3851 * @param callbackfn A function that accepts up to three arguments. The map method calls the
\r
3852 * callbackfn function one time for each element in the array.
\r
3853 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
\r
3854 * If thisArg is omitted, undefined is used as the this value.
\r
3856 map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array;
\r
3859 * Calls the specified callback function for all the elements in an array. The return value of
\r
3860 * the callback function is the accumulated result, and is provided as an argument in the next
\r
3861 * call to the callback function.
\r
3862 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
\r
3863 * callbackfn function one time for each element in the array.
\r
3864 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
3865 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
3866 * instead of an array value.
\r
3868 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;
\r
3869 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;
\r
3872 * Calls the specified callback function for all the elements in an array. The return value of
\r
3873 * the callback function is the accumulated result, and is provided as an argument in the next
\r
3874 * call to the callback function.
\r
3875 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
\r
3876 * callbackfn function one time for each element in the array.
\r
3877 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
3878 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
3879 * instead of an array value.
\r
3881 reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;
\r
3884 * Calls the specified callback function for all the elements in an array, in descending order.
\r
3885 * The return value of the callback function is the accumulated result, and is provided as an
\r
3886 * argument in the next call to the callback function.
\r
3887 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
\r
3888 * the callbackfn function one time for each element in the array.
\r
3889 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
3890 * the accumulation. The first call to the callbackfn function provides this value as an
\r
3891 * argument instead of an array value.
\r
3893 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;
\r
3894 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;
\r
3897 * Calls the specified callback function for all the elements in an array, in descending order.
\r
3898 * The return value of the callback function is the accumulated result, and is provided as an
\r
3899 * argument in the next call to the callback function.
\r
3900 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
\r
3901 * the callbackfn function one time for each element in the array.
\r
3902 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
3903 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
3904 * instead of an array value.
\r
3906 reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;
\r
3909 * Reverses the elements in an Array.
\r
3911 reverse(): Float32Array;
\r
3914 * Sets a value or an array of values.
\r
3915 * @param array A typed or untyped array of values to set.
\r
3916 * @param offset The index in the current array at which the values are to be written.
\r
3918 set(array: ArrayLike<number>, offset?: number): void;
\r
3921 * Returns a section of an array.
\r
3922 * @param start The beginning of the specified portion of the array.
\r
3923 * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
\r
3925 slice(start?: number, end?: number): Float32Array;
\r
3928 * Determines whether the specified callback function returns true for any element of an array.
\r
3929 * @param predicate A function that accepts up to three arguments. The some method calls
\r
3930 * the predicate function for each element in the array until the predicate returns a value
\r
3931 * which is coercible to the Boolean value true, or until the end of the array.
\r
3932 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
3933 * If thisArg is omitted, undefined is used as the this value.
\r
3935 some(predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): boolean;
\r
3939 * @param compareFn Function used to determine the order of the elements. It is expected to return
\r
3940 * a negative value if first argument is less than second argument, zero if they're equal and a positive
\r
3941 * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
\r
3943 * [11,2,22,1].sort((a, b) => a - b)
\r
3946 sort(compareFn?: (a: number, b: number) => number): this;
\r
3949 * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements
\r
3950 * at begin, inclusive, up to end, exclusive.
\r
3951 * @param begin The index of the beginning of the array.
\r
3952 * @param end The index of the end of the array.
\r
3954 subarray(begin?: number, end?: number): Float32Array;
\r
3957 * Converts a number to a string by using the current locale.
\r
3959 toLocaleString(): string;
\r
3962 * Returns a string representation of an array.
\r
3964 toString(): string;
\r
3966 /** Returns the primitive value of the specified object. */
\r
3967 valueOf(): Float32Array;
\r
3969 [index: number]: number;
\r
3972 interface Float32ArrayConstructor {
\r
3973 readonly prototype: Float32Array;
\r
3974 new(length: number): Float32Array;
\r
3975 new(array: ArrayLike<number> | ArrayBufferLike): Float32Array;
\r
3976 new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Float32Array;
\r
3979 * The size in bytes of each element in the array.
\r
3981 readonly BYTES_PER_ELEMENT: number;
\r
3984 * Returns a new array from a set of elements.
\r
3985 * @param items A set of elements to include in the new array object.
\r
3987 of(...items: number[]): Float32Array;
\r
3990 * Creates an array from an array-like or iterable object.
\r
3991 * @param arrayLike An array-like or iterable object to convert to an array.
\r
3993 from(arrayLike: ArrayLike<number>): Float32Array;
\r
3996 * Creates an array from an array-like or iterable object.
\r
3997 * @param arrayLike An array-like or iterable object to convert to an array.
\r
3998 * @param mapfn A mapping function to call on every element of the array.
\r
3999 * @param thisArg Value of 'this' used to invoke the mapfn.
\r
4001 from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array;
\r
4005 declare var Float32Array: Float32ArrayConstructor;
\r
4008 * A typed array of 64-bit float values. The contents are initialized to 0. If the requested
\r
4009 * number of bytes could not be allocated an exception is raised.
\r
4011 interface Float64Array {
\r
4013 * The size in bytes of each element in the array.
\r
4015 readonly BYTES_PER_ELEMENT: number;
\r
4018 * The ArrayBuffer instance referenced by the array.
\r
4020 readonly buffer: ArrayBufferLike;
\r
4023 * The length in bytes of the array.
\r
4025 readonly byteLength: number;
\r
4028 * The offset in bytes of the array.
\r
4030 readonly byteOffset: number;
\r
4033 * Returns the this object after copying a section of the array identified by start and end
\r
4034 * to the same array starting at position target
\r
4035 * @param target If target is negative, it is treated as length+target where length is the
\r
4036 * length of the array.
\r
4037 * @param start If start is negative, it is treated as length+start. If end is negative, it
\r
4038 * is treated as length+end.
\r
4039 * @param end If not specified, length of the this object is used as its default value.
\r
4041 copyWithin(target: number, start: number, end?: number): this;
\r
4044 * Determines whether all the members of an array satisfy the specified test.
\r
4045 * @param predicate A function that accepts up to three arguments. The every method calls
\r
4046 * the predicate function for each element in the array until the predicate returns a value
\r
4047 * which is coercible to the Boolean value false, or until the end of the array.
\r
4048 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
4049 * If thisArg is omitted, undefined is used as the this value.
\r
4051 every(predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): boolean;
\r
4054 * Returns the this object after filling the section identified by start and end with value
\r
4055 * @param value value to fill array section with
\r
4056 * @param start index to start filling the array at. If start is negative, it is treated as
\r
4057 * length+start where length is the length of the array.
\r
4058 * @param end index to stop filling the array at. If end is negative, it is treated as
\r
4061 fill(value: number, start?: number, end?: number): this;
\r
4064 * Returns the elements of an array that meet the condition specified in a callback function.
\r
4065 * @param predicate A function that accepts up to three arguments. The filter method calls
\r
4066 * the predicate function one time for each element in the array.
\r
4067 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
4068 * If thisArg is omitted, undefined is used as the this value.
\r
4070 filter(predicate: (value: number, index: number, array: Float64Array) => any, thisArg?: any): Float64Array;
\r
4073 * Returns the value of the first element in the array where predicate is true, and undefined
\r
4075 * @param predicate find calls predicate once for each element of the array, in ascending
\r
4076 * order, until it finds one where predicate returns true. If such an element is found, find
\r
4077 * immediately returns that element value. Otherwise, find returns undefined.
\r
4078 * @param thisArg If provided, it will be used as the this value for each invocation of
\r
4079 * predicate. If it is not provided, undefined is used instead.
\r
4081 find(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number | undefined;
\r
4084 * Returns the index of the first element in the array where predicate is true, and -1
\r
4086 * @param predicate find calls predicate once for each element of the array, in ascending
\r
4087 * order, until it finds one where predicate returns true. If such an element is found,
\r
4088 * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
\r
4089 * @param thisArg If provided, it will be used as the this value for each invocation of
\r
4090 * predicate. If it is not provided, undefined is used instead.
\r
4092 findIndex(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number;
\r
4095 * Performs the specified action for each element in an array.
\r
4096 * @param callbackfn A function that accepts up to three arguments. forEach calls the
\r
4097 * callbackfn function one time for each element in the array.
\r
4098 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
\r
4099 * If thisArg is omitted, undefined is used as the this value.
\r
4101 forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void;
\r
4104 * Returns the index of the first occurrence of a value in an array.
\r
4105 * @param searchElement The value to locate in the array.
\r
4106 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
\r
4107 * search starts at index 0.
\r
4109 indexOf(searchElement: number, fromIndex?: number): number;
\r
4112 * Adds all the elements of an array separated by the specified separator string.
\r
4113 * @param separator A string used to separate one element of an array from the next in the
\r
4114 * resulting String. If omitted, the array elements are separated with a comma.
\r
4116 join(separator?: string): string;
\r
4119 * Returns the index of the last occurrence of a value in an array.
\r
4120 * @param searchElement The value to locate in the array.
\r
4121 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
\r
4122 * search starts at index 0.
\r
4124 lastIndexOf(searchElement: number, fromIndex?: number): number;
\r
4127 * The length of the array.
\r
4129 readonly length: number;
\r
4132 * Calls a defined callback function on each element of an array, and returns an array that
\r
4133 * contains the results.
\r
4134 * @param callbackfn A function that accepts up to three arguments. The map method calls the
\r
4135 * callbackfn function one time for each element in the array.
\r
4136 * @param thisArg An object to which the this keyword can refer in the callbackfn function.
\r
4137 * If thisArg is omitted, undefined is used as the this value.
\r
4139 map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array;
\r
4142 * Calls the specified callback function for all the elements in an array. The return value of
\r
4143 * the callback function is the accumulated result, and is provided as an argument in the next
\r
4144 * call to the callback function.
\r
4145 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
\r
4146 * callbackfn function one time for each element in the array.
\r
4147 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
4148 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
4149 * instead of an array value.
\r
4151 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;
\r
4152 reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;
\r
4155 * Calls the specified callback function for all the elements in an array. The return value of
\r
4156 * the callback function is the accumulated result, and is provided as an argument in the next
\r
4157 * call to the callback function.
\r
4158 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
\r
4159 * callbackfn function one time for each element in the array.
\r
4160 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
4161 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
4162 * instead of an array value.
\r
4164 reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;
\r
4167 * Calls the specified callback function for all the elements in an array, in descending order.
\r
4168 * The return value of the callback function is the accumulated result, and is provided as an
\r
4169 * argument in the next call to the callback function.
\r
4170 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
\r
4171 * the callbackfn function one time for each element in the array.
\r
4172 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
4173 * the accumulation. The first call to the callbackfn function provides this value as an
\r
4174 * argument instead of an array value.
\r
4176 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;
\r
4177 reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;
\r
4180 * Calls the specified callback function for all the elements in an array, in descending order.
\r
4181 * The return value of the callback function is the accumulated result, and is provided as an
\r
4182 * argument in the next call to the callback function.
\r
4183 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
\r
4184 * the callbackfn function one time for each element in the array.
\r
4185 * @param initialValue If initialValue is specified, it is used as the initial value to start
\r
4186 * the accumulation. The first call to the callbackfn function provides this value as an argument
\r
4187 * instead of an array value.
\r
4189 reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;
\r
4192 * Reverses the elements in an Array.
\r
4194 reverse(): Float64Array;
\r
4197 * Sets a value or an array of values.
\r
4198 * @param array A typed or untyped array of values to set.
\r
4199 * @param offset The index in the current array at which the values are to be written.
\r
4201 set(array: ArrayLike<number>, offset?: number): void;
\r
4204 * Returns a section of an array.
\r
4205 * @param start The beginning of the specified portion of the array.
\r
4206 * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
\r
4208 slice(start?: number, end?: number): Float64Array;
\r
4211 * Determines whether the specified callback function returns true for any element of an array.
\r
4212 * @param predicate A function that accepts up to three arguments. The some method calls
\r
4213 * the predicate function for each element in the array until the predicate returns a value
\r
4214 * which is coercible to the Boolean value true, or until the end of the array.
\r
4215 * @param thisArg An object to which the this keyword can refer in the predicate function.
\r
4216 * If thisArg is omitted, undefined is used as the this value.
\r
4218 some(predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): boolean;
\r
4222 * @param compareFn Function used to determine the order of the elements. It is expected to return
\r
4223 * a negative value if first argument is less than second argument, zero if they're equal and a positive
\r
4224 * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
\r
4226 * [11,2,22,1].sort((a, b) => a - b)
\r
4229 sort(compareFn?: (a: number, b: number) => number): this;
\r
4232 * at begin, inclusive, up to end, exclusive.
\r
4233 * @param begin The index of the beginning of the array.
\r
4234 * @param end The index of the end of the array.
\r
4236 subarray(begin?: number, end?: number): Float64Array;
\r
4238 toString(): string;
\r
4240 /** Returns the primitive value of the specified object. */
\r
4241 valueOf(): Float64Array;
\r
4243 [index: number]: number;
\r
4246 interface Float64ArrayConstructor {
\r
4247 readonly prototype: Float64Array;
\r
4248 new(length: number): Float64Array;
\r
4249 new(array: ArrayLike<number> | ArrayBufferLike): Float64Array;
\r
4250 new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Float64Array;
\r
4253 * The size in bytes of each element in the array.
\r
4255 readonly BYTES_PER_ELEMENT: number;
\r
4258 * Returns a new array from a set of elements.
\r
4259 * @param items A set of elements to include in the new array object.
\r
4261 of(...items: number[]): Float64Array;
\r
4264 * Creates an array from an array-like or iterable object.
\r
4265 * @param arrayLike An array-like or iterable object to convert to an array.
\r
4267 from(arrayLike: ArrayLike<number>): Float64Array;
\r
4270 * Creates an array from an array-like or iterable object.
\r
4271 * @param arrayLike An array-like or iterable object to convert to an array.
\r
4272 * @param mapfn A mapping function to call on every element of the array.
\r
4273 * @param thisArg Value of 'this' used to invoke the mapfn.
\r
4275 from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array;
\r
4278 declare var Float64Array: Float64ArrayConstructor;
\r
4280 /////////////////////////////
\r
4281 /// ECMAScript Internationalization API
\r
4282 /////////////////////////////
\r
4284 declare namespace Intl {
\r
4285 interface CollatorOptions {
\r
4287 localeMatcher?: string;
\r
4288 numeric?: boolean;
\r
4289 caseFirst?: string;
\r
4290 sensitivity?: string;
\r
4291 ignorePunctuation?: boolean;
\r
4294 interface ResolvedCollatorOptions {
\r
4297 sensitivity: string;
\r
4298 ignorePunctuation: boolean;
\r
4299 collation: string;
\r
4300 caseFirst: string;
\r
4304 interface Collator {
\r
4305 compare(x: string, y: string): number;
\r
4306 resolvedOptions(): ResolvedCollatorOptions;
\r
4309 new(locales?: string | string[], options?: CollatorOptions): Collator;
\r
4310 (locales?: string | string[], options?: CollatorOptions): Collator;
\r
4311 supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[];
\r
4314 interface NumberFormatOptions {
\r
4315 localeMatcher?: string;
\r
4317 currency?: string;
\r
4318 currencyDisplay?: string;
\r
4319 currencySign?: string;
\r
4320 useGrouping?: boolean;
\r
4321 minimumIntegerDigits?: number;
\r
4322 minimumFractionDigits?: number;
\r
4323 maximumFractionDigits?: number;
\r
4324 minimumSignificantDigits?: number;
\r
4325 maximumSignificantDigits?: number;
\r
4328 interface ResolvedNumberFormatOptions {
\r
4330 numberingSystem: string;
\r
4332 currency?: string;
\r
4333 currencyDisplay?: string;
\r
4334 minimumIntegerDigits: number;
\r
4335 minimumFractionDigits: number;
\r
4336 maximumFractionDigits: number;
\r
4337 minimumSignificantDigits?: number;
\r
4338 maximumSignificantDigits?: number;
\r
4339 useGrouping: boolean;
\r
4342 interface NumberFormat {
\r
4343 format(value: number): string;
\r
4344 resolvedOptions(): ResolvedNumberFormatOptions;
\r
4346 var NumberFormat: {
\r
4347 new(locales?: string | string[], options?: NumberFormatOptions): NumberFormat;
\r
4348 (locales?: string | string[], options?: NumberFormatOptions): NumberFormat;
\r
4349 supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[];
\r
4352 interface DateTimeFormatOptions {
\r
4353 localeMatcher?: "best fit" | "lookup";
\r
4354 weekday?: "long" | "short" | "narrow";
\r
4355 era?: "long" | "short" | "narrow";
\r
4356 year?: "numeric" | "2-digit";
\r
4357 month?: "numeric" | "2-digit" | "long" | "short" | "narrow";
\r
4358 day?: "numeric" | "2-digit";
\r
4359 hour?: "numeric" | "2-digit";
\r
4360 minute?: "numeric" | "2-digit";
\r
4361 second?: "numeric" | "2-digit";
\r
4362 timeZoneName?: "long" | "short";
\r
4363 formatMatcher?: "best fit" | "basic";
\r
4365 timeZone?: string;
\r
4368 interface ResolvedDateTimeFormatOptions {
\r
4371 numberingSystem: string;
\r
4382 timeZoneName?: string;
\r
4385 interface DateTimeFormat {
\r
4386 format(date?: Date | number): string;
\r
4387 resolvedOptions(): ResolvedDateTimeFormatOptions;
\r
4389 var DateTimeFormat: {
\r
4390 new(locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;
\r
4391 (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;
\r
4392 supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[];
\r
4396 interface String {
\r
4398 * Determines whether two strings are equivalent in the current or specified locale.
\r
4399 * @param that String to compare to target string
\r
4400 * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.
\r
4401 * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.
\r
4403 localeCompare(that: string, locales?: string | string[], options?: Intl.CollatorOptions): number;
\r
4406 interface Number {
\r
4408 * Converts a number to a string by using the current or specified locale.
\r
4409 * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
\r
4410 * @param options An object that contains one or more properties that specify comparison options.
\r
4412 toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string;
\r
4417 * Converts a date and time to a string by using the current or specified locale.
\r
4418 * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
\r
4419 * @param options An object that contains one or more properties that specify comparison options.
\r
4421 toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
\r
4423 * Converts a date to a string by using the current or specified locale.
\r
4424 * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
\r
4425 * @param options An object that contains one or more properties that specify comparison options.
\r
4427 toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
\r
4430 * Converts a time to a string by using the current or specified locale.
\r
4431 * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
\r
4432 * @param options An object that contains one or more properties that specify comparison options.
\r
4434 toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
\r