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