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