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