strict-ts-lib-v6.0 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/README.md +28 -0
  2. package/libs/decorators/index.d.ts +360 -0
  3. package/libs/decorators/legacy/index.d.ts +17 -0
  4. package/libs/dom/asynciterable/index.d.ts +2 -0
  5. package/libs/dom/index.d.ts +53065 -0
  6. package/libs/dom/iterable/index.d.ts +2 -0
  7. package/libs/es2015/collection/index.d.ts +151 -0
  8. package/libs/es2015/core/index.d.ts +645 -0
  9. package/libs/es2015/generator/index.d.ts +63 -0
  10. package/libs/es2015/index.d.ts +10 -0
  11. package/libs/es2015/iterable/index.d.ts +658 -0
  12. package/libs/es2015/promise/index.d.ts +72 -0
  13. package/libs/es2015/proxy/index.d.ts +129 -0
  14. package/libs/es2015/reflect/index.d.ts +143 -0
  15. package/libs/es2015/symbol/index.d.ts +28 -0
  16. package/libs/es2015/symbol-wellknown/index.d.ts +329 -0
  17. package/libs/es2016/array-include/index.d.ts +113 -0
  18. package/libs/es2016/full/index.d.ts +5 -0
  19. package/libs/es2016/index.d.ts +3 -0
  20. package/libs/es2016/intl/index.d.ts +13 -0
  21. package/libs/es2017/arraybuffer/index.d.ts +3 -0
  22. package/libs/es2017/date/index.d.ts +21 -0
  23. package/libs/es2017/full/index.d.ts +5 -0
  24. package/libs/es2017/index.d.ts +8 -0
  25. package/libs/es2017/intl/index.d.ts +26 -0
  26. package/libs/es2017/object/index.d.ts +113 -0
  27. package/libs/es2017/sharedmemory/index.d.ts +246 -0
  28. package/libs/es2017/string/index.d.ts +27 -0
  29. package/libs/es2017/typedarrays/index.d.ts +35 -0
  30. package/libs/es2018/asyncgenerator/index.d.ts +67 -0
  31. package/libs/es2018/asynciterable/index.d.ts +47 -0
  32. package/libs/es2018/full/index.d.ts +6 -0
  33. package/libs/es2018/index.d.ts +6 -0
  34. package/libs/es2018/intl/index.d.ts +90 -0
  35. package/libs/es2018/promise/index.d.ts +12 -0
  36. package/libs/es2018/regexp/index.d.ts +19 -0
  37. package/libs/es2019/array/index.d.ts +92 -0
  38. package/libs/es2019/full/index.d.ts +6 -0
  39. package/libs/es2019/index.d.ts +6 -0
  40. package/libs/es2019/intl/index.d.ts +5 -0
  41. package/libs/es2019/object/index.d.ts +142 -0
  42. package/libs/es2019/string/index.d.ts +19 -0
  43. package/libs/es2019/symbol/index.d.ts +6 -0
  44. package/libs/es2020/bigint/index.d.ts +952 -0
  45. package/libs/es2020/date/index.d.ts +33 -0
  46. package/libs/es2020/full/index.d.ts +6 -0
  47. package/libs/es2020/index.d.ts +9 -0
  48. package/libs/es2020/intl/index.d.ts +492 -0
  49. package/libs/es2020/number/index.d.ts +13 -0
  50. package/libs/es2020/promise/index.d.ts +35 -0
  51. package/libs/es2020/sharedmemory/index.d.ts +144 -0
  52. package/libs/es2020/string/index.d.ts +30 -0
  53. package/libs/es2020/symbol-wellknown/index.d.ts +27 -0
  54. package/libs/es2021/full/index.d.ts +6 -0
  55. package/libs/es2021/index.d.ts +5 -0
  56. package/libs/es2021/intl/index.d.ts +159 -0
  57. package/libs/es2021/promise/index.d.ts +32 -0
  58. package/libs/es2021/string/index.d.ts +18 -0
  59. package/libs/es2021/weakref/index.d.ts +60 -0
  60. package/libs/es2022/array/index.d.ts +103 -0
  61. package/libs/es2022/error/index.d.ts +57 -0
  62. package/libs/es2022/full/index.d.ts +6 -0
  63. package/libs/es2022/index.d.ts +7 -0
  64. package/libs/es2022/intl/index.d.ts +142 -0
  65. package/libs/es2022/object/index.d.ts +40 -0
  66. package/libs/es2022/regexp/index.d.ts +23 -0
  67. package/libs/es2022/string/index.d.ts +7 -0
  68. package/libs/es2023/array/index.d.ts +913 -0
  69. package/libs/es2023/collection/index.d.ts +3 -0
  70. package/libs/es2023/full/index.d.ts +6 -0
  71. package/libs/es2023/index.d.ts +4 -0
  72. package/libs/es2023/intl/index.d.ts +112 -0
  73. package/libs/es2024/arraybuffer/index.d.ts +50 -0
  74. package/libs/es2024/collection/index.d.ts +11 -0
  75. package/libs/es2024/full/index.d.ts +6 -0
  76. package/libs/es2024/index.d.ts +8 -0
  77. package/libs/es2024/object/index.d.ts +11 -0
  78. package/libs/es2024/promise/index.d.ts +17 -0
  79. package/libs/es2024/regexp/index.d.ts +7 -0
  80. package/libs/es2024/sharedmemory/index.d.ts +67 -0
  81. package/libs/es2024/string/index.d.ts +11 -0
  82. package/libs/es2025/collection/index.d.ts +78 -0
  83. package/libs/es2025/float16/index.d.ts +503 -0
  84. package/libs/es2025/full/index.d.ts +6 -0
  85. package/libs/es2025/index.d.ts +7 -0
  86. package/libs/es2025/intl/index.d.ts +221 -0
  87. package/libs/es2025/iterator/index.d.ts +170 -0
  88. package/libs/es2025/promise/index.d.ts +19 -0
  89. package/libs/es2025/regexp/index.d.ts +14 -0
  90. package/libs/es5/index.d.ts +5844 -0
  91. package/libs/es6/index.d.ts +5 -0
  92. package/libs/esnext/array/index.d.ts +26 -0
  93. package/libs/esnext/collection/index.d.ts +31 -0
  94. package/libs/esnext/date/index.d.ts +5 -0
  95. package/libs/esnext/decorators/index.d.ts +10 -0
  96. package/libs/esnext/disposable/index.d.ts +173 -0
  97. package/libs/esnext/error/index.d.ts +6 -0
  98. package/libs/esnext/full/index.d.ts +6 -0
  99. package/libs/esnext/index.d.ts +11 -0
  100. package/libs/esnext/intl/index.d.ts +105 -0
  101. package/libs/esnext/sharedmemory/index.d.ts +7 -0
  102. package/libs/esnext/temporal/index.d.ts +684 -0
  103. package/libs/esnext/typedarrays/index.d.ts +78 -0
  104. package/libs/scripthost/index.d.ts +308 -0
  105. package/libs/webworker/asynciterable/index.d.ts +2 -0
  106. package/libs/webworker/importscripts/index.d.ts +5 -0
  107. package/libs/webworker/index.d.ts +18819 -0
  108. package/libs/webworker/iterable/index.d.ts +2 -0
  109. package/package.json +23 -0
@@ -0,0 +1,913 @@
1
+ interface Array<T> {
2
+ /**
3
+ * Returns the value of the last element in the array where predicate is true, and undefined
4
+ * otherwise.
5
+ * @param predicate findLast calls predicate once for each element of the array, in descending
6
+ * order, until it finds one where predicate returns true. If such an element is found, findLast
7
+ * immediately returns that element value. Otherwise, findLast returns undefined.
8
+ * @param thisArg If provided, it will be used as the this value for each invocation of
9
+ * predicate. If it is not provided, undefined is used instead.
10
+ */
11
+ findLast<S extends T>(
12
+ predicate: (value: T, index: number, array: readonly T[]) => value is S,
13
+ thisArg?: unknown,
14
+ ): S | undefined;
15
+ findLast(
16
+ predicate: (value: T, index: number, array: readonly T[]) => boolean,
17
+ thisArg?: unknown,
18
+ ): T | undefined;
19
+
20
+ /**
21
+ * Returns the index of the last element in the array where predicate is true, and -1
22
+ * otherwise.
23
+ * @param predicate findLastIndex calls predicate once for each element of the array, in descending
24
+ * order, until it finds one where predicate returns true. If such an element is found,
25
+ * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
26
+ * @param thisArg If provided, it will be used as the this value for each invocation of
27
+ * predicate. If it is not provided, undefined is used instead.
28
+ */
29
+ findLastIndex(
30
+ predicate: (value: T, index: number, array: readonly T[]) => boolean,
31
+ thisArg?: unknown,
32
+ ): number;
33
+
34
+ /**
35
+ * Returns a copy of an array with its elements reversed.
36
+ */
37
+ toReversed(): T[];
38
+
39
+ /**
40
+ * Returns a copy of an array with its elements sorted.
41
+ * @param compareFn Function used to determine the order of the elements. It is expected to return
42
+ * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
43
+ * value otherwise. If omitted, the elements are sorted in ascending, UTF-16 code unit order.
44
+ * ```ts
45
+ * [11, 2, 22, 1].toSorted((a, b) => a - b) // [1, 2, 11, 22]
46
+ * ```
47
+ */
48
+ toSorted(compareFn?: (a: T, b: T) => number): T[];
49
+
50
+ /**
51
+ * Copies an array and removes elements while, if necessary, inserting new elements in their place, returning the remaining elements.
52
+ * @param start The zero-based location in the array from which to start removing elements.
53
+ * @param deleteCount The number of elements to remove.
54
+ * @param items Elements to insert into the copied array in place of the deleted elements.
55
+ * @returns A copy of the original array with the remaining elements.
56
+ */
57
+ toSpliced(start: number, deleteCount: number, ...items: readonly T[]): T[];
58
+
59
+ /**
60
+ * Copies an array and removes elements while returning the remaining elements.
61
+ * @param start The zero-based location in the array from which to start removing elements.
62
+ * @param deleteCount The number of elements to remove.
63
+ * @returns A copy of the original array with the remaining elements.
64
+ */
65
+ toSpliced(start: number, deleteCount?: number): T[];
66
+
67
+ /**
68
+ * Copies an array, then overwrites the value at the provided index with the
69
+ * given value. If the index is negative, then it replaces from the end
70
+ * of the array.
71
+ * @param index The index of the value to overwrite. If the index is
72
+ * negative, then it replaces from the end of the array.
73
+ * @param value The value to write into the copied array.
74
+ * @returns The copied array with the updated value.
75
+ */
76
+ with(index: number, value: T): T[];
77
+ }
78
+
79
+ interface ReadonlyArray<T> {
80
+ /**
81
+ * Returns the value of the last element in the array where predicate is true, and undefined
82
+ * otherwise.
83
+ * @param predicate findLast calls predicate once for each element of the array, in descending
84
+ * order, until it finds one where predicate returns true. If such an element is found, findLast
85
+ * immediately returns that element value. Otherwise, findLast returns undefined.
86
+ * @param thisArg If provided, it will be used as the this value for each invocation of
87
+ * predicate. If it is not provided, undefined is used instead.
88
+ */
89
+ findLast<S extends T>(
90
+ predicate: (value: T, index: number, array: readonly T[]) => value is S,
91
+ thisArg?: unknown,
92
+ ): S | undefined;
93
+ findLast(
94
+ predicate: (value: T, index: number, array: readonly T[]) => boolean,
95
+ thisArg?: unknown,
96
+ ): T | undefined;
97
+
98
+ /**
99
+ * Returns the index of the last element in the array where predicate is true, and -1
100
+ * otherwise.
101
+ * @param predicate findLastIndex calls predicate once for each element of the array, in descending
102
+ * order, until it finds one where predicate returns true. If such an element is found,
103
+ * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
104
+ * @param thisArg If provided, it will be used as the this value for each invocation of
105
+ * predicate. If it is not provided, undefined is used instead.
106
+ */
107
+ findLastIndex(
108
+ predicate: (value: T, index: number, array: readonly T[]) => boolean,
109
+ thisArg?: unknown,
110
+ ): number;
111
+
112
+ /**
113
+ * Returns a copy of an array with its elements reversed.
114
+ */
115
+ toReversed(): T[];
116
+
117
+ /**
118
+ * Returns a copy of an array with its elements sorted.
119
+ * @param compareFn Function used to determine the order of the elements. It is expected to return
120
+ * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
121
+ * value otherwise. If omitted, the elements are sorted in ascending, UTF-16 code unit order.
122
+ * ```ts
123
+ * [11, 2, 22, 1].toSorted((a, b) => a - b) // [1, 2, 11, 22]
124
+ * ```
125
+ */
126
+ toSorted(compareFn?: (a: T, b: T) => number): T[];
127
+
128
+ /**
129
+ * Copies an array and removes elements while, if necessary, inserting new elements in their place, returning the remaining elements.
130
+ * @param start The zero-based location in the array from which to start removing elements.
131
+ * @param deleteCount The number of elements to remove.
132
+ * @param items Elements to insert into the copied array in place of the deleted elements.
133
+ * @returns A copy of the original array with the remaining elements.
134
+ */
135
+ toSpliced(start: number, deleteCount: number, ...items: readonly T[]): T[];
136
+
137
+ /**
138
+ * Copies an array and removes elements while returning the remaining elements.
139
+ * @param start The zero-based location in the array from which to start removing elements.
140
+ * @param deleteCount The number of elements to remove.
141
+ * @returns A copy of the original array with the remaining elements.
142
+ */
143
+ toSpliced(start: number, deleteCount?: number): T[];
144
+
145
+ /**
146
+ * Copies an array, then overwrites the value at the provided index with the
147
+ * given value. If the index is negative, then it replaces from the end
148
+ * of the array
149
+ * @param index The index of the value to overwrite. If the index is
150
+ * negative, then it replaces from the end of the array.
151
+ * @param value The value to write into the copied array.
152
+ * @returns The copied array with the updated value.
153
+ */
154
+ with(index: number, value: T): T[];
155
+ }
156
+
157
+ interface Int8Array<TArrayBuffer extends ArrayBufferLike> {
158
+ /**
159
+ * Returns the value of the last element in the array where predicate is true, and undefined
160
+ * otherwise.
161
+ * @param predicate findLast calls predicate once for each element of the array, in descending
162
+ * order, until it finds one where predicate returns true. If such an element is found, findLast
163
+ * immediately returns that element value. Otherwise, findLast returns undefined.
164
+ * @param thisArg If provided, it will be used as the this value for each invocation of
165
+ * predicate. If it is not provided, undefined is used instead.
166
+ */
167
+ findLast<S extends import('ts-type-forge').Int8>(
168
+ predicate: (
169
+ value: import('ts-type-forge').Int8,
170
+ index: number,
171
+ array: this,
172
+ ) => value is S,
173
+ thisArg?: unknown,
174
+ ): S | undefined;
175
+ findLast(
176
+ predicate: (
177
+ value: import('ts-type-forge').Int8,
178
+ index: number,
179
+ array: this,
180
+ ) => boolean,
181
+ thisArg?: unknown,
182
+ ): import('ts-type-forge').Int8 | undefined;
183
+
184
+ /**
185
+ * Returns the index of the last element in the array where predicate is true, and -1
186
+ * otherwise.
187
+ * @param predicate findLastIndex calls predicate once for each element of the array, in descending
188
+ * order, until it finds one where predicate returns true. If such an element is found,
189
+ * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
190
+ * @param thisArg If provided, it will be used as the this value for each invocation of
191
+ * predicate. If it is not provided, undefined is used instead.
192
+ */
193
+ findLastIndex(
194
+ predicate: (
195
+ value: import('ts-type-forge').Int8,
196
+ index: number,
197
+ array: this,
198
+ ) => boolean,
199
+ thisArg?: unknown,
200
+ ): number;
201
+
202
+ /**
203
+ * Returns a copy of an array with its elements reversed.
204
+ */
205
+ toReversed(): Int8Array<ArrayBuffer>;
206
+
207
+ /**
208
+ * Returns a copy of an array with its elements sorted.
209
+ * @param compareFn Function used to determine the order of the elements. It is expected to return
210
+ * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
211
+ * value otherwise. If omitted, the elements are sorted in ascending order.
212
+ * ```ts
213
+ * const myNums = Int8Array.from([11, 2, 22, 1]);
214
+ * myNums.toSorted((a, b) => a - b) // Int8Array(4) [1, 2, 11, 22]
215
+ * ```
216
+ */
217
+ toSorted(
218
+ compareFn?: (
219
+ a: import('ts-type-forge').Int8,
220
+ b: import('ts-type-forge').Int8,
221
+ ) => number,
222
+ ): Int8Array<ArrayBuffer>;
223
+
224
+ /**
225
+ * Copies an array, then overwrites the value at the provided index with the
226
+ * given value. If the index is negative, then it replaces from the end
227
+ * of the array.
228
+ * @param index The index of the value to overwrite. If the index is
229
+ * negative, then it replaces from the end of the array.
230
+ * @param value The value to write into the copied array.
231
+ * @returns The copied array with the updated value.
232
+ */
233
+ with(
234
+ index: number,
235
+ value: import('ts-type-forge').Int8,
236
+ ): Int8Array<ArrayBuffer>;
237
+ }
238
+
239
+ interface Uint8Array<TArrayBuffer extends ArrayBufferLike> {
240
+ /**
241
+ * Returns the value of the last element in the array where predicate is true, and undefined
242
+ * otherwise.
243
+ * @param predicate findLast calls predicate once for each element of the array, in descending
244
+ * order, until it finds one where predicate returns true. If such an element is found, findLast
245
+ * immediately returns that element value. Otherwise, findLast returns undefined.
246
+ * @param thisArg If provided, it will be used as the this value for each invocation of
247
+ * predicate. If it is not provided, undefined is used instead.
248
+ */
249
+ findLast<S extends import('ts-type-forge').Uint8>(
250
+ predicate: (
251
+ value: import('ts-type-forge').Uint8,
252
+ index: number,
253
+ array: this,
254
+ ) => value is S,
255
+ thisArg?: unknown,
256
+ ): S | undefined;
257
+ findLast(
258
+ predicate: (
259
+ value: import('ts-type-forge').Uint8,
260
+ index: number,
261
+ array: this,
262
+ ) => boolean,
263
+ thisArg?: unknown,
264
+ ): import('ts-type-forge').Uint8 | undefined;
265
+
266
+ /**
267
+ * Returns the index of the last element in the array where predicate is true, and -1
268
+ * otherwise.
269
+ * @param predicate findLastIndex calls predicate once for each element of the array, in descending
270
+ * order, until it finds one where predicate returns true. If such an element is found,
271
+ * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
272
+ * @param thisArg If provided, it will be used as the this value for each invocation of
273
+ * predicate. If it is not provided, undefined is used instead.
274
+ */
275
+ findLastIndex(
276
+ predicate: (
277
+ value: import('ts-type-forge').Uint8,
278
+ index: number,
279
+ array: this,
280
+ ) => boolean,
281
+ thisArg?: unknown,
282
+ ): number;
283
+
284
+ /**
285
+ * Returns a copy of an array with its elements reversed.
286
+ */
287
+ toReversed(): Uint8Array<ArrayBuffer>;
288
+
289
+ /**
290
+ * Returns a copy of an array with its elements sorted.
291
+ * @param compareFn Function used to determine the order of the elements. It is expected to return
292
+ * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
293
+ * value otherwise. If omitted, the elements are sorted in ascending order.
294
+ * ```ts
295
+ * const myNums = Uint8Array.from([11, 2, 22, 1]);
296
+ * myNums.toSorted((a, b) => a - b) // Uint8Array(4) [1, 2, 11, 22]
297
+ * ```
298
+ */
299
+ toSorted(
300
+ compareFn?: (
301
+ a: import('ts-type-forge').Uint8,
302
+ b: import('ts-type-forge').Uint8,
303
+ ) => number,
304
+ ): Uint8Array<ArrayBuffer>;
305
+
306
+ /**
307
+ * Copies an array, then overwrites the value at the provided index with the
308
+ * given value. If the index is negative, then it replaces from the end
309
+ * of the array.
310
+ * @param index The index of the value to overwrite. If the index is
311
+ * negative, then it replaces from the end of the array.
312
+ * @param value The value to write into the copied array.
313
+ * @returns The copied array with the updated value.
314
+ */
315
+ with(
316
+ index: number,
317
+ value: import('ts-type-forge').Uint8,
318
+ ): Uint8Array<ArrayBuffer>;
319
+ }
320
+
321
+ interface Uint8ClampedArray<TArrayBuffer extends ArrayBufferLike> {
322
+ /**
323
+ * Returns the value of the last element in the array where predicate is true, and undefined
324
+ * otherwise.
325
+ * @param predicate findLast calls predicate once for each element of the array, in descending
326
+ * order, until it finds one where predicate returns true. If such an element is found, findLast
327
+ * immediately returns that element value. Otherwise, findLast returns undefined.
328
+ * @param thisArg If provided, it will be used as the this value for each invocation of
329
+ * predicate. If it is not provided, undefined is used instead.
330
+ */
331
+ findLast<S extends import('ts-type-forge').Uint8>(
332
+ predicate: (
333
+ value: import('ts-type-forge').Uint8,
334
+ index: number,
335
+ array: this,
336
+ ) => value is S,
337
+ thisArg?: unknown,
338
+ ): S | undefined;
339
+ findLast(
340
+ predicate: (
341
+ value: import('ts-type-forge').Uint8,
342
+ index: number,
343
+ array: this,
344
+ ) => boolean,
345
+ thisArg?: unknown,
346
+ ): import('ts-type-forge').Uint8 | undefined;
347
+
348
+ /**
349
+ * Returns the index of the last element in the array where predicate is true, and -1
350
+ * otherwise.
351
+ * @param predicate findLastIndex calls predicate once for each element of the array, in descending
352
+ * order, until it finds one where predicate returns true. If such an element is found,
353
+ * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
354
+ * @param thisArg If provided, it will be used as the this value for each invocation of
355
+ * predicate. If it is not provided, undefined is used instead.
356
+ */
357
+ findLastIndex(
358
+ predicate: (
359
+ value: import('ts-type-forge').Uint8,
360
+ index: number,
361
+ array: this,
362
+ ) => boolean,
363
+ thisArg?: unknown,
364
+ ): number;
365
+
366
+ /**
367
+ * Returns a copy of an array with its elements reversed.
368
+ */
369
+ toReversed(): Uint8ClampedArray<ArrayBuffer>;
370
+
371
+ /**
372
+ * Returns a copy of an array with its elements sorted.
373
+ * @param compareFn Function used to determine the order of the elements. It is expected to return
374
+ * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
375
+ * value otherwise. If omitted, the elements are sorted in ascending order.
376
+ * ```ts
377
+ * const myNums = Uint8ClampedArray.from([11, 2, 22, 1]);
378
+ * myNums.toSorted((a, b) => a - b) // Uint8ClampedArray(4) [1, 2, 11, 22]
379
+ * ```
380
+ */
381
+ toSorted(
382
+ compareFn?: (
383
+ a: import('ts-type-forge').Uint8,
384
+ b: import('ts-type-forge').Uint8,
385
+ ) => number,
386
+ ): Uint8ClampedArray<ArrayBuffer>;
387
+
388
+ /**
389
+ * Copies an array, then overwrites the value at the provided index with the
390
+ * given value. If the index is negative, then it replaces from the end
391
+ * of the array.
392
+ * @param index The index of the value to overwrite. If the index is
393
+ * negative, then it replaces from the end of the array.
394
+ * @param value The value to write into the copied array.
395
+ * @returns The copied array with the updated value.
396
+ */
397
+ with(
398
+ index: number,
399
+ value: import('ts-type-forge').Uint8,
400
+ ): Uint8ClampedArray<ArrayBuffer>;
401
+ }
402
+
403
+ interface Int16Array<TArrayBuffer extends ArrayBufferLike> {
404
+ /**
405
+ * Returns the value of the last element in the array where predicate is true, and undefined
406
+ * otherwise.
407
+ * @param predicate findLast calls predicate once for each element of the array, in descending
408
+ * order, until it finds one where predicate returns true. If such an element is found, findLast
409
+ * immediately returns that element value. Otherwise, findLast returns undefined.
410
+ * @param thisArg If provided, it will be used as the this value for each invocation of
411
+ * predicate. If it is not provided, undefined is used instead.
412
+ */
413
+ findLast<S extends number>(
414
+ predicate: (value: number, index: number, array: this) => value is S,
415
+ thisArg?: unknown,
416
+ ): S | undefined;
417
+ findLast(
418
+ predicate: (value: number, index: number, array: this) => boolean,
419
+ thisArg?: unknown,
420
+ ): number | undefined;
421
+
422
+ /**
423
+ * Returns the index of the last element in the array where predicate is true, and -1
424
+ * otherwise.
425
+ * @param predicate findLastIndex calls predicate once for each element of the array, in descending
426
+ * order, until it finds one where predicate returns true. If such an element is found,
427
+ * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
428
+ * @param thisArg If provided, it will be used as the this value for each invocation of
429
+ * predicate. If it is not provided, undefined is used instead.
430
+ */
431
+ findLastIndex(
432
+ predicate: (value: number, index: number, array: this) => boolean,
433
+ thisArg?: unknown,
434
+ ): number;
435
+
436
+ /**
437
+ * Returns a copy of an array with its elements reversed.
438
+ */
439
+ toReversed(): Int16Array<ArrayBuffer>;
440
+
441
+ /**
442
+ * Returns a copy of an array with its elements sorted.
443
+ * @param compareFn Function used to determine the order of the elements. It is expected to return
444
+ * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
445
+ * value otherwise. If omitted, the elements are sorted in ascending order.
446
+ * ```ts
447
+ * const myNums = Int16Array.from([11, 2, -22, 1]);
448
+ * myNums.toSorted((a, b) => a - b) // Int16Array(4) [-22, 1, 2, 11]
449
+ * ```
450
+ */
451
+ toSorted(
452
+ compareFn?: (a: number, b: number) => number,
453
+ ): Int16Array<ArrayBuffer>;
454
+
455
+ /**
456
+ * Copies an array, then overwrites the value at the provided index with the
457
+ * given value. If the index is negative, then it replaces from the end
458
+ * of the array.
459
+ * @param index The index of the value to overwrite. If the index is
460
+ * negative, then it replaces from the end of the array.
461
+ * @param value The value to write into the copied array.
462
+ * @returns The copied array with the updated value.
463
+ */
464
+ with(index: number, value: number): Int16Array<ArrayBuffer>;
465
+ }
466
+
467
+ interface Uint16Array<TArrayBuffer extends ArrayBufferLike> {
468
+ /**
469
+ * Returns the value of the last element in the array where predicate is true, and undefined
470
+ * otherwise.
471
+ * @param predicate findLast calls predicate once for each element of the array, in descending
472
+ * order, until it finds one where predicate returns true. If such an element is found, findLast
473
+ * immediately returns that element value. Otherwise, findLast returns undefined.
474
+ * @param thisArg If provided, it will be used as the this value for each invocation of
475
+ * predicate. If it is not provided, undefined is used instead.
476
+ */
477
+ findLast<S extends number>(
478
+ predicate: (value: number, index: number, array: this) => value is S,
479
+ thisArg?: unknown,
480
+ ): S | undefined;
481
+ findLast(
482
+ predicate: (value: number, index: number, array: this) => boolean,
483
+ thisArg?: unknown,
484
+ ): number | undefined;
485
+
486
+ /**
487
+ * Returns the index of the last element in the array where predicate is true, and -1
488
+ * otherwise.
489
+ * @param predicate findLastIndex calls predicate once for each element of the array, in descending
490
+ * order, until it finds one where predicate returns true. If such an element is found,
491
+ * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
492
+ * @param thisArg If provided, it will be used as the this value for each invocation of
493
+ * predicate. If it is not provided, undefined is used instead.
494
+ */
495
+ findLastIndex(
496
+ predicate: (value: number, index: number, array: this) => boolean,
497
+ thisArg?: unknown,
498
+ ): number;
499
+
500
+ /**
501
+ * Returns a copy of an array with its elements reversed.
502
+ */
503
+ toReversed(): Uint16Array<ArrayBuffer>;
504
+
505
+ /**
506
+ * Returns a copy of an array with its elements sorted.
507
+ * @param compareFn Function used to determine the order of the elements. It is expected to return
508
+ * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
509
+ * value otherwise. If omitted, the elements are sorted in ascending order.
510
+ * ```ts
511
+ * const myNums = Uint16Array.from([11, 2, 22, 1]);
512
+ * myNums.toSorted((a, b) => a - b) // Uint16Array(4) [1, 2, 11, 22]
513
+ * ```
514
+ */
515
+ toSorted(
516
+ compareFn?: (a: number, b: number) => number,
517
+ ): Uint16Array<ArrayBuffer>;
518
+
519
+ /**
520
+ * Copies an array, then overwrites the value at the provided index with the
521
+ * given value. If the index is negative, then it replaces from the end
522
+ * of the array.
523
+ * @param index The index of the value to overwrite. If the index is
524
+ * negative, then it replaces from the end of the array.
525
+ * @param value The value to write into the copied array.
526
+ * @returns The copied array with the updated value.
527
+ */
528
+ with(index: number, value: number): Uint16Array<ArrayBuffer>;
529
+ }
530
+
531
+ interface Int32Array<TArrayBuffer extends ArrayBufferLike> {
532
+ /**
533
+ * Returns the value of the last element in the array where predicate is true, and undefined
534
+ * otherwise.
535
+ * @param predicate findLast calls predicate once for each element of the array, in descending
536
+ * order, until it finds one where predicate returns true. If such an element is found, findLast
537
+ * immediately returns that element value. Otherwise, findLast returns undefined.
538
+ * @param thisArg If provided, it will be used as the this value for each invocation of
539
+ * predicate. If it is not provided, undefined is used instead.
540
+ */
541
+ findLast<S extends number>(
542
+ predicate: (value: number, index: number, array: this) => value is S,
543
+ thisArg?: unknown,
544
+ ): S | undefined;
545
+ findLast(
546
+ predicate: (value: number, index: number, array: this) => boolean,
547
+ thisArg?: unknown,
548
+ ): number | undefined;
549
+
550
+ /**
551
+ * Returns the index of the last element in the array where predicate is true, and -1
552
+ * otherwise.
553
+ * @param predicate findLastIndex calls predicate once for each element of the array, in descending
554
+ * order, until it finds one where predicate returns true. If such an element is found,
555
+ * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
556
+ * @param thisArg If provided, it will be used as the this value for each invocation of
557
+ * predicate. If it is not provided, undefined is used instead.
558
+ */
559
+ findLastIndex(
560
+ predicate: (value: number, index: number, array: this) => boolean,
561
+ thisArg?: unknown,
562
+ ): number;
563
+
564
+ /**
565
+ * Returns a copy of an array with its elements reversed.
566
+ */
567
+ toReversed(): Int32Array<ArrayBuffer>;
568
+
569
+ /**
570
+ * Returns a copy of an array with its elements sorted.
571
+ * @param compareFn Function used to determine the order of the elements. It is expected to return
572
+ * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
573
+ * value otherwise. If omitted, the elements are sorted in ascending order.
574
+ * ```ts
575
+ * const myNums = Int32Array.from([11, 2, -22, 1]);
576
+ * myNums.toSorted((a, b) => a - b) // Int32Array(4) [-22, 1, 2, 11]
577
+ * ```
578
+ */
579
+ toSorted(
580
+ compareFn?: (a: number, b: number) => number,
581
+ ): Int32Array<ArrayBuffer>;
582
+
583
+ /**
584
+ * Copies an array, then overwrites the value at the provided index with the
585
+ * given value. If the index is negative, then it replaces from the end
586
+ * of the array.
587
+ * @param index The index of the value to overwrite. If the index is
588
+ * negative, then it replaces from the end of the array.
589
+ * @param value The value to write into the copied array.
590
+ * @returns The copied array with the updated value.
591
+ */
592
+ with(index: number, value: number): Int32Array<ArrayBuffer>;
593
+ }
594
+
595
+ interface Uint32Array<TArrayBuffer extends ArrayBufferLike> {
596
+ /**
597
+ * Returns the value of the last element in the array where predicate is true, and undefined
598
+ * otherwise.
599
+ * @param predicate findLast calls predicate once for each element of the array, in descending
600
+ * order, until it finds one where predicate returns true. If such an element is found, findLast
601
+ * immediately returns that element value. Otherwise, findLast returns undefined.
602
+ * @param thisArg If provided, it will be used as the this value for each invocation of
603
+ * predicate. If it is not provided, undefined is used instead.
604
+ */
605
+ findLast<S extends number>(
606
+ predicate: (value: number, index: number, array: this) => value is S,
607
+ thisArg?: unknown,
608
+ ): S | undefined;
609
+ findLast(
610
+ predicate: (value: number, index: number, array: this) => boolean,
611
+ thisArg?: unknown,
612
+ ): number | undefined;
613
+
614
+ /**
615
+ * Returns the index of the last element in the array where predicate is true, and -1
616
+ * otherwise.
617
+ * @param predicate findLastIndex calls predicate once for each element of the array, in descending
618
+ * order, until it finds one where predicate returns true. If such an element is found,
619
+ * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
620
+ * @param thisArg If provided, it will be used as the this value for each invocation of
621
+ * predicate. If it is not provided, undefined is used instead.
622
+ */
623
+ findLastIndex(
624
+ predicate: (value: number, index: number, array: this) => boolean,
625
+ thisArg?: unknown,
626
+ ): number;
627
+
628
+ /**
629
+ * Returns a copy of an array with its elements reversed.
630
+ */
631
+ toReversed(): Uint32Array<ArrayBuffer>;
632
+
633
+ /**
634
+ * Returns a copy of an array with its elements sorted.
635
+ * @param compareFn Function used to determine the order of the elements. It is expected to return
636
+ * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
637
+ * value otherwise. If omitted, the elements are sorted in ascending order.
638
+ * ```ts
639
+ * const myNums = Uint32Array.from([11, 2, 22, 1]);
640
+ * myNums.toSorted((a, b) => a - b) // Uint32Array(4) [1, 2, 11, 22]
641
+ * ```
642
+ */
643
+ toSorted(
644
+ compareFn?: (a: number, b: number) => number,
645
+ ): Uint32Array<ArrayBuffer>;
646
+
647
+ /**
648
+ * Copies an array, then overwrites the value at the provided index with the
649
+ * given value. If the index is negative, then it replaces from the end
650
+ * of the array.
651
+ * @param index The index of the value to overwrite. If the index is
652
+ * negative, then it replaces from the end of the array.
653
+ * @param value The value to write into the copied array.
654
+ * @returns The copied array with the updated value.
655
+ */
656
+ with(index: number, value: number): Uint32Array<ArrayBuffer>;
657
+ }
658
+
659
+ interface Float32Array<TArrayBuffer extends ArrayBufferLike> {
660
+ /**
661
+ * Returns the value of the last element in the array where predicate is true, and undefined
662
+ * otherwise.
663
+ * @param predicate findLast calls predicate once for each element of the array, in descending
664
+ * order, until it finds one where predicate returns true. If such an element is found, findLast
665
+ * immediately returns that element value. Otherwise, findLast returns undefined.
666
+ * @param thisArg If provided, it will be used as the this value for each invocation of
667
+ * predicate. If it is not provided, undefined is used instead.
668
+ */
669
+ findLast<S extends number>(
670
+ predicate: (value: number, index: number, array: this) => value is S,
671
+ thisArg?: unknown,
672
+ ): S | undefined;
673
+ findLast(
674
+ predicate: (value: number, index: number, array: this) => boolean,
675
+ thisArg?: unknown,
676
+ ): number | undefined;
677
+
678
+ /**
679
+ * Returns the index of the last element in the array where predicate is true, and -1
680
+ * otherwise.
681
+ * @param predicate findLastIndex calls predicate once for each element of the array, in descending
682
+ * order, until it finds one where predicate returns true. If such an element is found,
683
+ * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
684
+ * @param thisArg If provided, it will be used as the this value for each invocation of
685
+ * predicate. If it is not provided, undefined is used instead.
686
+ */
687
+ findLastIndex(
688
+ predicate: (value: number, index: number, array: this) => boolean,
689
+ thisArg?: unknown,
690
+ ): number;
691
+
692
+ /**
693
+ * Returns a copy of an array with its elements reversed.
694
+ */
695
+ toReversed(): Float32Array<ArrayBuffer>;
696
+
697
+ /**
698
+ * Returns a copy of an array with its elements sorted.
699
+ * @param compareFn Function used to determine the order of the elements. It is expected to return
700
+ * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
701
+ * value otherwise. If omitted, the elements are sorted in ascending order.
702
+ * ```ts
703
+ * const myNums = Float32Array.from([11.25, 2, -22.5, 1]);
704
+ * myNums.toSorted((a, b) => a - b) // Float32Array(4) [-22.5, 1, 2, 11.5]
705
+ * ```
706
+ */
707
+ toSorted(
708
+ compareFn?: (a: number, b: number) => number,
709
+ ): Float32Array<ArrayBuffer>;
710
+
711
+ /**
712
+ * Copies an array, then overwrites the value at the provided index with the
713
+ * given value. If the index is negative, then it replaces from the end
714
+ * of the array.
715
+ * @param index The index of the value to overwrite. If the index is
716
+ * negative, then it replaces from the end of the array.
717
+ * @param value The value to write into the copied array.
718
+ * @returns The copied array with the updated value.
719
+ */
720
+ with(index: number, value: number): Float32Array<ArrayBuffer>;
721
+ }
722
+
723
+ interface Float64Array<TArrayBuffer extends ArrayBufferLike> {
724
+ /**
725
+ * Returns the value of the last element in the array where predicate is true, and undefined
726
+ * otherwise.
727
+ * @param predicate findLast calls predicate once for each element of the array, in descending
728
+ * order, until it finds one where predicate returns true. If such an element is found, findLast
729
+ * immediately returns that element value. Otherwise, findLast returns undefined.
730
+ * @param thisArg If provided, it will be used as the this value for each invocation of
731
+ * predicate. If it is not provided, undefined is used instead.
732
+ */
733
+ findLast<S extends number>(
734
+ predicate: (value: number, index: number, array: this) => value is S,
735
+ thisArg?: unknown,
736
+ ): S | undefined;
737
+ findLast(
738
+ predicate: (value: number, index: number, array: this) => boolean,
739
+ thisArg?: unknown,
740
+ ): number | undefined;
741
+
742
+ /**
743
+ * Returns the index of the last element in the array where predicate is true, and -1
744
+ * otherwise.
745
+ * @param predicate findLastIndex calls predicate once for each element of the array, in descending
746
+ * order, until it finds one where predicate returns true. If such an element is found,
747
+ * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
748
+ * @param thisArg If provided, it will be used as the this value for each invocation of
749
+ * predicate. If it is not provided, undefined is used instead.
750
+ */
751
+ findLastIndex(
752
+ predicate: (value: number, index: number, array: this) => boolean,
753
+ thisArg?: unknown,
754
+ ): number;
755
+
756
+ /**
757
+ * Returns a copy of an array with its elements reversed.
758
+ */
759
+ toReversed(): Float64Array<ArrayBuffer>;
760
+
761
+ /**
762
+ * Returns a copy of an array with its elements sorted.
763
+ * @param compareFn Function used to determine the order of the elements. It is expected to return
764
+ * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
765
+ * value otherwise. If omitted, the elements are sorted in ascending order.
766
+ * ```ts
767
+ * const myNums = Float64Array.from([11.25, 2, -22.5, 1]);
768
+ * myNums.toSorted((a, b) => a - b) // Float64Array(4) [-22.5, 1, 2, 11.5]
769
+ * ```
770
+ */
771
+ toSorted(
772
+ compareFn?: (a: number, b: number) => number,
773
+ ): Float64Array<ArrayBuffer>;
774
+
775
+ /**
776
+ * Copies an array, then overwrites the value at the provided index with the
777
+ * given value. If the index is negative, then it replaces from the end
778
+ * of the array.
779
+ * @param index The index of the value to overwrite. If the index is
780
+ * negative, then it replaces from the end of the array.
781
+ * @param value The value to write into the copied array.
782
+ * @returns The copied array with the updated value.
783
+ */
784
+ with(index: number, value: number): Float64Array<ArrayBuffer>;
785
+ }
786
+
787
+ interface BigInt64Array<TArrayBuffer extends ArrayBufferLike> {
788
+ /**
789
+ * Returns the value of the last element in the array where predicate is true, and undefined
790
+ * otherwise.
791
+ * @param predicate findLast calls predicate once for each element of the array, in descending
792
+ * order, until it finds one where predicate returns true. If such an element is found, findLast
793
+ * immediately returns that element value. Otherwise, findLast returns undefined.
794
+ * @param thisArg If provided, it will be used as the this value for each invocation of
795
+ * predicate. If it is not provided, undefined is used instead.
796
+ */
797
+ findLast<S extends bigint>(
798
+ predicate: (value: bigint, index: number, array: this) => value is S,
799
+ thisArg?: unknown,
800
+ ): S | undefined;
801
+ findLast(
802
+ predicate: (value: bigint, index: number, array: this) => boolean,
803
+ thisArg?: unknown,
804
+ ): bigint | undefined;
805
+
806
+ /**
807
+ * Returns the index of the last element in the array where predicate is true, and -1
808
+ * otherwise.
809
+ * @param predicate findLastIndex calls predicate once for each element of the array, in descending
810
+ * order, until it finds one where predicate returns true. If such an element is found,
811
+ * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
812
+ * @param thisArg If provided, it will be used as the this value for each invocation of
813
+ * predicate. If it is not provided, undefined is used instead.
814
+ */
815
+ findLastIndex(
816
+ predicate: (value: bigint, index: number, array: this) => boolean,
817
+ thisArg?: unknown,
818
+ ): number;
819
+
820
+ /**
821
+ * Returns a copy of an array with its elements reversed.
822
+ */
823
+ toReversed(): BigInt64Array<ArrayBuffer>;
824
+
825
+ /**
826
+ * Returns a copy of an array with its elements sorted.
827
+ * @param compareFn Function used to determine the order of the elements. It is expected to return
828
+ * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
829
+ * value otherwise. If omitted, the elements are sorted in ascending order.
830
+ * ```ts
831
+ * const myNums = BigInt64Array.from([11n, 2n, -22n, 1n]);
832
+ * myNums.toSorted((a, b) => Number(a - b)) // BigInt64Array(4) [-22n, 1n, 2n, 11n]
833
+ * ```
834
+ */
835
+ toSorted(
836
+ compareFn?: (a: bigint, b: bigint) => number,
837
+ ): BigInt64Array<ArrayBuffer>;
838
+
839
+ /**
840
+ * Copies an array, then overwrites the value at the provided index with the
841
+ * given value. If the index is negative, then it replaces from the end
842
+ * of the array.
843
+ * @param index The index of the value to overwrite. If the index is
844
+ * negative, then it replaces from the end of the array.
845
+ * @param value The value to write into the copied array.
846
+ * @returns The copied array with the updated value.
847
+ */
848
+ with(index: number, value: bigint): BigInt64Array<ArrayBuffer>;
849
+ }
850
+
851
+ interface BigUint64Array<TArrayBuffer extends ArrayBufferLike> {
852
+ /**
853
+ * Returns the value of the last element in the array where predicate is true, and undefined
854
+ * otherwise.
855
+ * @param predicate findLast calls predicate once for each element of the array, in descending
856
+ * order, until it finds one where predicate returns true. If such an element is found, findLast
857
+ * immediately returns that element value. Otherwise, findLast returns undefined.
858
+ * @param thisArg If provided, it will be used as the this value for each invocation of
859
+ * predicate. If it is not provided, undefined is used instead.
860
+ */
861
+ findLast<S extends bigint>(
862
+ predicate: (value: bigint, index: number, array: this) => value is S,
863
+ thisArg?: unknown,
864
+ ): S | undefined;
865
+ findLast(
866
+ predicate: (value: bigint, index: number, array: this) => boolean,
867
+ thisArg?: unknown,
868
+ ): bigint | undefined;
869
+
870
+ /**
871
+ * Returns the index of the last element in the array where predicate is true, and -1
872
+ * otherwise.
873
+ * @param predicate findLastIndex calls predicate once for each element of the array, in descending
874
+ * order, until it finds one where predicate returns true. If such an element is found,
875
+ * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
876
+ * @param thisArg If provided, it will be used as the this value for each invocation of
877
+ * predicate. If it is not provided, undefined is used instead.
878
+ */
879
+ findLastIndex(
880
+ predicate: (value: bigint, index: number, array: this) => boolean,
881
+ thisArg?: unknown,
882
+ ): number;
883
+
884
+ /**
885
+ * Returns a copy of an array with its elements reversed.
886
+ */
887
+ toReversed(): BigUint64Array<ArrayBuffer>;
888
+
889
+ /**
890
+ * Returns a copy of an array with its elements sorted.
891
+ * @param compareFn Function used to determine the order of the elements. It is expected to return
892
+ * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
893
+ * value otherwise. If omitted, the elements are sorted in ascending order.
894
+ * ```ts
895
+ * const myNums = BigUint64Array.from([11n, 2n, 22n, 1n]);
896
+ * myNums.toSorted((a, b) => Number(a - b)) // BigUint64Array(4) [1n, 2n, 11n, 22n]
897
+ * ```
898
+ */
899
+ toSorted(
900
+ compareFn?: (a: bigint, b: bigint) => number,
901
+ ): BigUint64Array<ArrayBuffer>;
902
+
903
+ /**
904
+ * Copies an array, then overwrites the value at the provided index with the
905
+ * given value. If the index is negative, then it replaces from the end
906
+ * of the array.
907
+ * @param index The index of the value to overwrite. If the index is
908
+ * negative, then it replaces from the end of the array.
909
+ * @param value The value to write into the copied array.
910
+ * @returns The copied array with the updated value.
911
+ */
912
+ with(index: number, value: bigint): BigUint64Array<ArrayBuffer>;
913
+ }