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