lib.es2020.bigint.d.ts 35 KB

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