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