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/// <reference lib="es2020.intl" /> 22 23interface BigIntToLocaleStringOptions { 24 /** 25 * The locale matching algorithm to use.The default is "best fit". For information about this option, see the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation Intl page}. 26 */ 27 localeMatcher?: string; 28 /** 29 * The formatting style to use , the default is "decimal". 30 */ 31 style?: string; 32 33 numberingSystem?: string; 34 /** 35 * The unit to use in unit formatting, Possible values are core unit identifiers, defined in UTS #35, Part 2, Section 6. A subset of units from the full list was selected for use in ECMAScript. Pairs of simple units can be concatenated with "-per-" to make a compound unit. There is no default value; if the style is "unit", the unit property must be provided. 36 */ 37 unit?: string; 38 39 /** 40 * The unit formatting style to use in unit formatting, the defaults is "short". 41 */ 42 unitDisplay?: string; 43 44 /** 45 * The currency to use in currency formatting. Possible values are the ISO 4217 currency codes, such as "USD" for the US dollar, "EUR" for the euro, or "CNY" for the Chinese RMB — see the Current currency & funds code list. There is no default value; if the style is "currency", the currency property must be provided. It is only used when [[Style]] has the value "currency". 46 */ 47 currency?: string; 48 49 /** 50 * How to display the currency in currency formatting. It is only used when [[Style]] has the value "currency". The default is "symbol". 51 * 52 * "symbol" to use a localized currency symbol such as €, 53 * 54 * "code" to use the ISO currency code, 55 * 56 * "name" to use a localized currency name such as "dollar" 57 */ 58 currencyDisplay?: string; 59 60 /** 61 * Whether to use grouping separators, such as thousands separators or thousand/lakh/crore separators. The default is true. 62 */ 63 useGrouping?: boolean; 64 65 /** 66 * The minimum number of integer digits to use. Possible values are from 1 to 21; the default is 1. 67 */ 68 minimumIntegerDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21; 69 70 /** 71 * The minimum number of fraction digits to use. Possible values are from 0 to 20; the default for plain number and percent formatting is 0; the default for currency formatting is the number of minor unit digits provided by the {@link http://www.currency-iso.org/en/home/tables/table-a1.html ISO 4217 currency codes list} (2 if the list doesn't provide that information). 72 */ 73 minimumFractionDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20; 74 75 /** 76 * The maximum number of fraction digits to use. Possible values are from 0 to 20; the default for plain number formatting is the larger of minimumFractionDigits and 3; the default for currency formatting is the larger of minimumFractionDigits and the number of minor unit digits provided by the {@link http://www.currency-iso.org/en/home/tables/table-a1.html ISO 4217 currency codes list} (2 if the list doesn't provide that information); the default for percent formatting is the larger of minimumFractionDigits and 0. 77 */ 78 maximumFractionDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20; 79 80 /** 81 * The minimum number of significant digits to use. Possible values are from 1 to 21; the default is 1. 82 */ 83 minimumSignificantDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21; 84 85 /** 86 * The maximum number of significant digits to use. Possible values are from 1 to 21; the default is 21. 87 */ 88 maximumSignificantDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21; 89 90 /** 91 * The formatting that should be displayed for the number, the defaults is "standard" 92 * 93 * "standard" plain number formatting 94 * 95 * "scientific" return the order-of-magnitude for formatted number. 96 * 97 * "engineering" return the exponent of ten when divisible by three 98 * 99 * "compact" string representing exponent, defaults is using the "short" form 100 */ 101 notation?: string; 102 103 /** 104 * used only when notation is "compact" 105 */ 106 compactDisplay?: string; 107} 108 109interface BigInt { 110 /** 111 * Returns a string representation of an object. 112 * @param radix Specifies a radix for converting numeric values to strings. 113 */ 114 toString(radix?: number): string; 115 116 /** Returns a string representation appropriate to the host environment's current locale. */ 117 toLocaleString(locales?: Intl.LocalesArgument, options?: BigIntToLocaleStringOptions): string; 118 119 /** Returns the primitive value of the specified object. */ 120 valueOf(): bigint; 121 122 readonly [Symbol.toStringTag]: "BigInt"; 123} 124 125interface BigIntConstructor { 126 (value: bigint | boolean | number | string): bigint; 127 readonly prototype: BigInt; 128 129 /** 130 * Interprets the low bits of a BigInt as a 2's-complement signed integer. 131 * All higher bits are discarded. 132 * @param bits The number of low bits to use 133 * @param int The BigInt whose bits to extract 134 */ 135 asIntN(bits: number, int: bigint): bigint; 136 /** 137 * Interprets the low bits of a BigInt as an unsigned integer. 138 * All higher bits are discarded. 139 * @param bits The number of low bits to use 140 * @param int The BigInt whose bits to extract 141 */ 142 asUintN(bits: number, int: bigint): bigint; 143} 144 145declare var BigInt: BigIntConstructor; 146 147/** 148 * A typed array of 64-bit signed integer values. The contents are initialized to 0. If the 149 * requested number of bytes could not be allocated, an exception is raised. 150 */ 151interface BigInt64Array { 152 /** The size in bytes of each element in the array. */ 153 readonly BYTES_PER_ELEMENT: number; 154 155 /** The ArrayBuffer instance referenced by the array. */ 156 readonly buffer: ArrayBufferLike; 157 158 /** The length in bytes of the array. */ 159 readonly byteLength: number; 160 161 /** The offset in bytes of the array. */ 162 readonly byteOffset: number; 163 164 /** 165 * Returns the this object after copying a section of the array identified by start and end 166 * to the same array starting at position target 167 * @param target If target is negative, it is treated as length+target where length is the 168 * length of the array. 169 * @param start If start is negative, it is treated as length+start. If end is negative, it 170 * is treated as length+end. 171 * @param end If not specified, length of the this object is used as its default value. 172 */ 173 copyWithin(target: number, start: number, end?: number): this; 174 175 /** Yields index, value pairs for every entry in the array. */ 176 entries(): IterableIterator<[number, bigint]>; 177 178 /** 179 * Determines whether all the members of an array satisfy the specified test. 180 * @param predicate A function that accepts up to three arguments. The every method calls 181 * the predicate function for each element in the array until the predicate returns false, 182 * or until the end of the array. 183 * @param thisArg An object to which the this keyword can refer in the predicate function. 184 * If thisArg is omitted, undefined is used as the this value. 185 */ 186 every(predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): boolean; 187 188 /** 189 * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array 190 * @param value value to fill array section with 191 * @param start index to start filling the array at. If start is negative, it is treated as 192 * length+start where length is the length of the array. 193 * @param end index to stop filling the array at. If end is negative, it is treated as 194 * length+end. 195 */ 196 fill(value: bigint, start?: number, end?: number): this; 197 198 /** 199 * Returns the elements of an array that meet the condition specified in a callback function. 200 * @param predicate A function that accepts up to three arguments. The filter method calls 201 * the predicate function one time for each element in the array. 202 * @param thisArg An object to which the this keyword can refer in the predicate function. 203 * If thisArg is omitted, undefined is used as the this value. 204 */ 205 filter(predicate: (value: bigint, index: number, array: BigInt64Array) => any, thisArg?: any): BigInt64Array; 206 207 /** 208 * Returns the value of the first element in the array where predicate is true, and undefined 209 * otherwise. 210 * @param predicate find calls predicate once for each element of the array, in ascending 211 * order, until it finds one where predicate returns true. If such an element is found, find 212 * immediately returns that element value. Otherwise, find returns undefined. 213 * @param thisArg If provided, it will be used as the this value for each invocation of 214 * predicate. If it is not provided, undefined is used instead. 215 */ 216 find(predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): bigint | undefined; 217 218 /** 219 * Returns the index of the first element in the array where predicate is true, and -1 220 * otherwise. 221 * @param predicate find calls predicate once for each element of the array, in ascending 222 * order, until it finds one where predicate returns true. If such an element is found, 223 * findIndex immediately returns that element index. Otherwise, findIndex returns -1. 224 * @param thisArg If provided, it will be used as the this value for each invocation of 225 * predicate. If it is not provided, undefined is used instead. 226 */ 227 findIndex(predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): number; 228 229 /** 230 * Performs the specified action for each element in an array. 231 * @param callbackfn A function that accepts up to three arguments. forEach calls the 232 * callbackfn function one time for each element in the array. 233 * @param thisArg An object to which the this keyword can refer in the callbackfn function. 234 * If thisArg is omitted, undefined is used as the this value. 235 */ 236 forEach(callbackfn: (value: bigint, index: number, array: BigInt64Array) => void, thisArg?: any): void; 237 238 /** 239 * Determines whether an array includes a certain element, returning true or false as appropriate. 240 * @param searchElement The element to search for. 241 * @param fromIndex The position in this array at which to begin searching for searchElement. 242 */ 243 includes(searchElement: bigint, fromIndex?: number): boolean; 244 245 /** 246 * Returns the index of the first occurrence of a value in an array. 247 * @param searchElement The value to locate in the array. 248 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the 249 * search starts at index 0. 250 */ 251 indexOf(searchElement: bigint, fromIndex?: number): number; 252 253 /** 254 * Adds all the elements of an array separated by the specified separator string. 255 * @param separator A string used to separate one element of an array from the next in the 256 * resulting String. If omitted, the array elements are separated with a comma. 257 */ 258 join(separator?: string): string; 259 260 /** Yields each index in the array. */ 261 keys(): IterableIterator<number>; 262 263 /** 264 * Returns the index of the last occurrence of a value in an array. 265 * @param searchElement The value to locate in the array. 266 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the 267 * search starts at index 0. 268 */ 269 lastIndexOf(searchElement: bigint, fromIndex?: number): number; 270 271 /** The length of the array. */ 272 readonly length: number; 273 274 /** 275 * Calls a defined callback function on each element of an array, and returns an array that 276 * contains the results. 277 * @param callbackfn A function that accepts up to three arguments. The map method calls the 278 * callbackfn function one time for each element in the array. 279 * @param thisArg An object to which the this keyword can refer in the callbackfn function. 280 * If thisArg is omitted, undefined is used as the this value. 281 */ 282 map(callbackfn: (value: bigint, index: number, array: BigInt64Array) => bigint, thisArg?: any): BigInt64Array; 283 284 /** 285 * Calls the specified callback function for all the elements in an array. The return value of 286 * the callback function is the accumulated result, and is provided as an argument in the next 287 * call to the callback function. 288 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the 289 * callbackfn function one time for each element in the array. 290 * @param initialValue If initialValue is specified, it is used as the initial value to start 291 * the accumulation. The first call to the callbackfn function provides this value as an argument 292 * instead of an array value. 293 */ 294 reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array) => bigint): bigint; 295 296 /** 297 * Calls the specified callback function for all the elements in an array. The return value of 298 * the callback function is the accumulated result, and is provided as an argument in the next 299 * call to the callback function. 300 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the 301 * callbackfn function one time for each element in the array. 302 * @param initialValue If initialValue is specified, it is used as the initial value to start 303 * the accumulation. The first call to the callbackfn function provides this value as an argument 304 * instead of an array value. 305 */ 306 reduce<U>(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigInt64Array) => U, initialValue: U): U; 307 308 /** 309 * Calls the specified callback function for all the elements in an array, in descending order. 310 * The return value of the callback function is the accumulated result, and is provided as an 311 * argument in the next call to the callback function. 312 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls 313 * the callbackfn function one time for each element in the array. 314 * @param initialValue If initialValue is specified, it is used as the initial value to start 315 * the accumulation. The first call to the callbackfn function provides this value as an 316 * argument instead of an array value. 317 */ 318 reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array) => bigint): bigint; 319 320 /** 321 * Calls the specified callback function for all the elements in an array, in descending order. 322 * The return value of the callback function is the accumulated result, and is provided as an 323 * argument in the next call to the callback function. 324 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls 325 * the callbackfn function one time for each element in the array. 326 * @param initialValue If initialValue is specified, it is used as the initial value to start 327 * the accumulation. The first call to the callbackfn function provides this value as an argument 328 * instead of an array value. 329 */ 330 reduceRight<U>(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigInt64Array) => U, initialValue: U): U; 331 332 /** Reverses the elements in the array. */ 333 reverse(): this; 334 335 /** 336 * Sets a value or an array of values. 337 * @param array A typed or untyped array of values to set. 338 * @param offset The index in the current array at which the values are to be written. 339 */ 340 set(array: ArrayLike<bigint>, offset?: number): void; 341 342 /** 343 * Returns a section of an array. 344 * @param start The beginning of the specified portion of the array. 345 * @param end The end of the specified portion of the array. 346 */ 347 slice(start?: number, end?: number): BigInt64Array; 348 349 /** 350 * Determines whether the specified callback function returns true for any element of an array. 351 * @param predicate A function that accepts up to three arguments. The some method calls the 352 * predicate function for each element in the array until the predicate returns true, or until 353 * the end of the array. 354 * @param thisArg An object to which the this keyword can refer in the predicate function. 355 * If thisArg is omitted, undefined is used as the this value. 356 */ 357 some(predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): boolean; 358 359 /** 360 * Sorts the array. 361 * @param compareFn The function used to determine the order of the elements. If omitted, the elements are sorted in ascending order. 362 */ 363 sort(compareFn?: (a: bigint, b: bigint) => number | bigint): this; 364 365 /** 366 * Gets a new BigInt64Array view of the ArrayBuffer store for this array, referencing the elements 367 * at begin, inclusive, up to end, exclusive. 368 * @param begin The index of the beginning of the array. 369 * @param end The index of the end of the array. 370 */ 371 subarray(begin?: number, end?: number): BigInt64Array; 372 373 /** Converts the array to a string by using the current locale. */ 374 toLocaleString(): string; 375 376 /** Returns a string representation of the array. */ 377 toString(): string; 378 379 /** Returns the primitive value of the specified object. */ 380 valueOf(): BigInt64Array; 381 382 /** Yields each value in the array. */ 383 values(): IterableIterator<bigint>; 384 385 [Symbol.iterator](): IterableIterator<bigint>; 386 387 readonly [Symbol.toStringTag]: "BigInt64Array"; 388 389 [index: number]: bigint; 390} 391 392interface BigInt64ArrayConstructor { 393 readonly prototype: BigInt64Array; 394 new(length?: number): BigInt64Array; 395 new(array: Iterable<bigint>): BigInt64Array; 396 new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigInt64Array; 397 398 /** The size in bytes of each element in the array. */ 399 readonly BYTES_PER_ELEMENT: number; 400 401 /** 402 * Returns a new array from a set of elements. 403 * @param items A set of elements to include in the new array object. 404 */ 405 of(...items: bigint[]): BigInt64Array; 406 407 /** 408 * Creates an array from an array-like or iterable object. 409 * @param arrayLike An array-like or iterable object to convert to an array. 410 * @param mapfn A mapping function to call on every element of the array. 411 * @param thisArg Value of 'this' used to invoke the mapfn. 412 */ 413 from(arrayLike: ArrayLike<bigint>): BigInt64Array; 414 from<U>(arrayLike: ArrayLike<U>, mapfn: (v: U, k: number) => bigint, thisArg?: any): BigInt64Array; 415} 416 417declare var BigInt64Array: BigInt64ArrayConstructor; 418 419/** 420 * A typed array of 64-bit unsigned integer values. The contents are initialized to 0. If the 421 * requested number of bytes could not be allocated, an exception is raised. 422 */ 423interface BigUint64Array { 424 /** The size in bytes of each element in the array. */ 425 readonly BYTES_PER_ELEMENT: number; 426 427 /** The ArrayBuffer instance referenced by the array. */ 428 readonly buffer: ArrayBufferLike; 429 430 /** The length in bytes of the array. */ 431 readonly byteLength: number; 432 433 /** The offset in bytes of the array. */ 434 readonly byteOffset: number; 435 436 /** 437 * Returns the this object after copying a section of the array identified by start and end 438 * to the same array starting at position target 439 * @param target If target is negative, it is treated as length+target where length is the 440 * length of the array. 441 * @param start If start is negative, it is treated as length+start. If end is negative, it 442 * is treated as length+end. 443 * @param end If not specified, length of the this object is used as its default value. 444 */ 445 copyWithin(target: number, start: number, end?: number): this; 446 447 /** Yields index, value pairs for every entry in the array. */ 448 entries(): IterableIterator<[number, bigint]>; 449 450 /** 451 * Determines whether all the members of an array satisfy the specified test. 452 * @param predicate A function that accepts up to three arguments. The every method calls 453 * the predicate function for each element in the array until the predicate returns false, 454 * or until the end of the array. 455 * @param thisArg An object to which the this keyword can refer in the predicate function. 456 * If thisArg is omitted, undefined is used as the this value. 457 */ 458 every(predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): boolean; 459 460 /** 461 * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array 462 * @param value value to fill array section with 463 * @param start index to start filling the array at. If start is negative, it is treated as 464 * length+start where length is the length of the array. 465 * @param end index to stop filling the array at. If end is negative, it is treated as 466 * length+end. 467 */ 468 fill(value: bigint, start?: number, end?: number): this; 469 470 /** 471 * Returns the elements of an array that meet the condition specified in a callback function. 472 * @param predicate A function that accepts up to three arguments. The filter method calls 473 * the predicate function one time for each element in the array. 474 * @param thisArg An object to which the this keyword can refer in the predicate function. 475 * If thisArg is omitted, undefined is used as the this value. 476 */ 477 filter(predicate: (value: bigint, index: number, array: BigUint64Array) => any, thisArg?: any): BigUint64Array; 478 479 /** 480 * Returns the value of the first element in the array where predicate is true, and undefined 481 * otherwise. 482 * @param predicate find calls predicate once for each element of the array, in ascending 483 * order, until it finds one where predicate returns true. If such an element is found, find 484 * immediately returns that element value. Otherwise, find returns undefined. 485 * @param thisArg If provided, it will be used as the this value for each invocation of 486 * predicate. If it is not provided, undefined is used instead. 487 */ 488 find(predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): bigint | undefined; 489 490 /** 491 * Returns the index of the first element in the array where predicate is true, and -1 492 * otherwise. 493 * @param predicate find calls predicate once for each element of the array, in ascending 494 * order, until it finds one where predicate returns true. If such an element is found, 495 * findIndex immediately returns that element index. Otherwise, findIndex returns -1. 496 * @param thisArg If provided, it will be used as the this value for each invocation of 497 * predicate. If it is not provided, undefined is used instead. 498 */ 499 findIndex(predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): number; 500 501 /** 502 * Performs the specified action for each element in an array. 503 * @param callbackfn A function that accepts up to three arguments. forEach calls the 504 * callbackfn function one time for each element in the array. 505 * @param thisArg An object to which the this keyword can refer in the callbackfn function. 506 * If thisArg is omitted, undefined is used as the this value. 507 */ 508 forEach(callbackfn: (value: bigint, index: number, array: BigUint64Array) => void, thisArg?: any): void; 509 510 /** 511 * Determines whether an array includes a certain element, returning true or false as appropriate. 512 * @param searchElement The element to search for. 513 * @param fromIndex The position in this array at which to begin searching for searchElement. 514 */ 515 includes(searchElement: bigint, fromIndex?: number): boolean; 516 517 /** 518 * Returns the index of the first occurrence of a value in an array. 519 * @param searchElement The value to locate in the array. 520 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the 521 * search starts at index 0. 522 */ 523 indexOf(searchElement: bigint, fromIndex?: number): number; 524 525 /** 526 * Adds all the elements of an array separated by the specified separator string. 527 * @param separator A string used to separate one element of an array from the next in the 528 * resulting String. If omitted, the array elements are separated with a comma. 529 */ 530 join(separator?: string): string; 531 532 /** Yields each index in the array. */ 533 keys(): IterableIterator<number>; 534 535 /** 536 * Returns the index of the last occurrence of a value in an array. 537 * @param searchElement The value to locate in the array. 538 * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the 539 * search starts at index 0. 540 */ 541 lastIndexOf(searchElement: bigint, fromIndex?: number): number; 542 543 /** The length of the array. */ 544 readonly length: number; 545 546 /** 547 * Calls a defined callback function on each element of an array, and returns an array that 548 * contains the results. 549 * @param callbackfn A function that accepts up to three arguments. The map method calls the 550 * callbackfn function one time for each element in the array. 551 * @param thisArg An object to which the this keyword can refer in the callbackfn function. 552 * If thisArg is omitted, undefined is used as the this value. 553 */ 554 map(callbackfn: (value: bigint, index: number, array: BigUint64Array) => bigint, thisArg?: any): BigUint64Array; 555 556 /** 557 * Calls the specified callback function for all the elements in an array. The return value of 558 * the callback function is the accumulated result, and is provided as an argument in the next 559 * call to the callback function. 560 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the 561 * callbackfn function one time for each element in the array. 562 * @param initialValue If initialValue is specified, it is used as the initial value to start 563 * the accumulation. The first call to the callbackfn function provides this value as an argument 564 * instead of an array value. 565 */ 566 reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array) => bigint): bigint; 567 568 /** 569 * Calls the specified callback function for all the elements in an array. The return value of 570 * the callback function is the accumulated result, and is provided as an argument in the next 571 * call to the callback function. 572 * @param callbackfn A function that accepts up to four arguments. The reduce method calls the 573 * callbackfn function one time for each element in the array. 574 * @param initialValue If initialValue is specified, it is used as the initial value to start 575 * the accumulation. The first call to the callbackfn function provides this value as an argument 576 * instead of an array value. 577 */ 578 reduce<U>(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigUint64Array) => U, initialValue: U): U; 579 580 /** 581 * Calls the specified callback function for all the elements in an array, in descending order. 582 * The return value of the callback function is the accumulated result, and is provided as an 583 * argument in the next call to the callback function. 584 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls 585 * the callbackfn function one time for each element in the array. 586 * @param initialValue If initialValue is specified, it is used as the initial value to start 587 * the accumulation. The first call to the callbackfn function provides this value as an 588 * argument instead of an array value. 589 */ 590 reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array) => bigint): bigint; 591 592 /** 593 * Calls the specified callback function for all the elements in an array, in descending order. 594 * The return value of the callback function is the accumulated result, and is provided as an 595 * argument in the next call to the callback function. 596 * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls 597 * the callbackfn function one time for each element in the array. 598 * @param initialValue If initialValue is specified, it is used as the initial value to start 599 * the accumulation. The first call to the callbackfn function provides this value as an argument 600 * instead of an array value. 601 */ 602 reduceRight<U>(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigUint64Array) => U, initialValue: U): U; 603 604 /** Reverses the elements in the array. */ 605 reverse(): this; 606 607 /** 608 * Sets a value or an array of values. 609 * @param array A typed or untyped array of values to set. 610 * @param offset The index in the current array at which the values are to be written. 611 */ 612 set(array: ArrayLike<bigint>, offset?: number): void; 613 614 /** 615 * Returns a section of an array. 616 * @param start The beginning of the specified portion of the array. 617 * @param end The end of the specified portion of the array. 618 */ 619 slice(start?: number, end?: number): BigUint64Array; 620 621 /** 622 * Determines whether the specified callback function returns true for any element of an array. 623 * @param predicate A function that accepts up to three arguments. The some method calls the 624 * predicate function for each element in the array until the predicate returns true, or until 625 * the end of the array. 626 * @param thisArg An object to which the this keyword can refer in the predicate function. 627 * If thisArg is omitted, undefined is used as the this value. 628 */ 629 some(predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): boolean; 630 631 /** 632 * Sorts the array. 633 * @param compareFn The function used to determine the order of the elements. If omitted, the elements are sorted in ascending order. 634 */ 635 sort(compareFn?: (a: bigint, b: bigint) => number | bigint): this; 636 637 /** 638 * Gets a new BigUint64Array view of the ArrayBuffer store for this array, referencing the elements 639 * at begin, inclusive, up to end, exclusive. 640 * @param begin The index of the beginning of the array. 641 * @param end The index of the end of the array. 642 */ 643 subarray(begin?: number, end?: number): BigUint64Array; 644 645 /** Converts the array to a string by using the current locale. */ 646 toLocaleString(): string; 647 648 /** Returns a string representation of the array. */ 649 toString(): string; 650 651 /** Returns the primitive value of the specified object. */ 652 valueOf(): BigUint64Array; 653 654 /** Yields each value in the array. */ 655 values(): IterableIterator<bigint>; 656 657 [Symbol.iterator](): IterableIterator<bigint>; 658 659 readonly [Symbol.toStringTag]: "BigUint64Array"; 660 661 [index: number]: bigint; 662} 663 664interface BigUint64ArrayConstructor { 665 readonly prototype: BigUint64Array; 666 new(length?: number): BigUint64Array; 667 new(array: Iterable<bigint>): BigUint64Array; 668 new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigUint64Array; 669 670 /** The size in bytes of each element in the array. */ 671 readonly BYTES_PER_ELEMENT: number; 672 673 /** 674 * Returns a new array from a set of elements. 675 * @param items A set of elements to include in the new array object. 676 */ 677 of(...items: bigint[]): BigUint64Array; 678 679 /** 680 * Creates an array from an array-like or iterable object. 681 * @param arrayLike An array-like or iterable object to convert to an array. 682 * @param mapfn A mapping function to call on every element of the array. 683 * @param thisArg Value of 'this' used to invoke the mapfn. 684 */ 685 from(arrayLike: ArrayLike<bigint>): BigUint64Array; 686 from<U>(arrayLike: ArrayLike<U>, mapfn: (v: U, k: number) => bigint, thisArg?: any): BigUint64Array; 687} 688 689declare var BigUint64Array: BigUint64ArrayConstructor; 690 691interface DataView { 692 /** 693 * Gets the BigInt64 value at the specified byte offset from the start of the view. There is 694 * no alignment constraint; multi-byte values may be fetched from any offset. 695 * @param byteOffset The place in the buffer at which the value should be retrieved. 696 * @param littleEndian If false or undefined, a big-endian value should be read. 697 */ 698 getBigInt64(byteOffset: number, littleEndian?: boolean): bigint; 699 700 /** 701 * Gets the BigUint64 value at the specified byte offset from the start of the view. There is 702 * no alignment constraint; multi-byte values may be fetched from any offset. 703 * @param byteOffset The place in the buffer at which the value should be retrieved. 704 * @param littleEndian If false or undefined, a big-endian value should be read. 705 */ 706 getBigUint64(byteOffset: number, littleEndian?: boolean): bigint; 707 708 /** 709 * Stores a BigInt64 value at the specified byte offset from the start of the view. 710 * @param byteOffset The place in the buffer at which the value should be set. 711 * @param value The value to set. 712 * @param littleEndian If false or undefined, a big-endian value should be written. 713 */ 714 setBigInt64(byteOffset: number, value: bigint, littleEndian?: boolean): void; 715 716 /** 717 * Stores a BigUint64 value at the specified byte offset from the start of the view. 718 * @param byteOffset The place in the buffer at which the value should be set. 719 * @param value The value to set. 720 * @param littleEndian If false or undefined, a big-endian value should be written. 721 */ 722 setBigUint64(byteOffset: number, value: bigint, littleEndian?: boolean): void; 723} 724 725declare namespace Intl{ 726 interface NumberFormat { 727 format(value: number | bigint): string; 728 resolvedOptions(): ResolvedNumberFormatOptions; 729 } 730} 731