strict-ts-lib-v5.4 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.
- package/README.md +28 -0
- package/libs/decorators/index.d.ts +364 -0
- package/libs/decorators/legacy/index.d.ts +19 -0
- package/libs/dom/asynciterable/index.d.ts +14 -0
- package/libs/dom/index.d.ts +35333 -0
- package/libs/dom/iterable/index.d.ts +748 -0
- package/libs/es2015/collection/index.d.ts +148 -0
- package/libs/es2015/core/index.d.ts +574 -0
- package/libs/es2015/generator/index.d.ts +65 -0
- package/libs/es2015/index.d.ts +12 -0
- package/libs/es2015/iterable/index.d.ts +524 -0
- package/libs/es2015/promise/index.d.ts +74 -0
- package/libs/es2015/proxy/index.d.ts +131 -0
- package/libs/es2015/reflect/index.d.ts +145 -0
- package/libs/es2015/symbol/index.d.ts +30 -0
- package/libs/es2015/symbol-wellknown/index.d.ts +331 -0
- package/libs/es2016/array-include/index.d.ts +115 -0
- package/libs/es2016/full/index.d.ts +7 -0
- package/libs/es2016/index.d.ts +5 -0
- package/libs/es2016/intl/index.d.ts +15 -0
- package/libs/es2017/date/index.d.ts +23 -0
- package/libs/es2017/full/index.d.ts +7 -0
- package/libs/es2017/index.d.ts +9 -0
- package/libs/es2017/intl/index.d.ts +28 -0
- package/libs/es2017/object/index.d.ts +115 -0
- package/libs/es2017/sharedmemory/index.d.ts +244 -0
- package/libs/es2017/string/index.d.ts +29 -0
- package/libs/es2017/typedarrays/index.d.ts +37 -0
- package/libs/es2018/asyncgenerator/index.d.ts +69 -0
- package/libs/es2018/asynciterable/index.d.ts +31 -0
- package/libs/es2018/full/index.d.ts +8 -0
- package/libs/es2018/index.d.ts +8 -0
- package/libs/es2018/intl/index.d.ts +103 -0
- package/libs/es2018/promise/index.d.ts +14 -0
- package/libs/es2018/regexp/index.d.ts +21 -0
- package/libs/es2019/array/index.d.ts +94 -0
- package/libs/es2019/full/index.d.ts +8 -0
- package/libs/es2019/index.d.ts +8 -0
- package/libs/es2019/intl/index.d.ts +7 -0
- package/libs/es2019/object/index.d.ts +143 -0
- package/libs/es2019/string/index.d.ts +21 -0
- package/libs/es2019/symbol/index.d.ts +8 -0
- package/libs/es2020/bigint/index.d.ts +833 -0
- package/libs/es2020/date/index.d.ts +35 -0
- package/libs/es2020/full/index.d.ts +8 -0
- package/libs/es2020/index.d.ts +11 -0
- package/libs/es2020/intl/index.d.ts +473 -0
- package/libs/es2020/number/index.d.ts +15 -0
- package/libs/es2020/promise/index.d.ts +37 -0
- package/libs/es2020/sharedmemory/index.d.ts +119 -0
- package/libs/es2020/string/index.d.ts +30 -0
- package/libs/es2020/symbol-wellknown/index.d.ts +21 -0
- package/libs/es2021/full/index.d.ts +8 -0
- package/libs/es2021/index.d.ts +7 -0
- package/libs/es2021/intl/index.d.ts +161 -0
- package/libs/es2021/promise/index.d.ts +34 -0
- package/libs/es2021/string/index.d.ts +20 -0
- package/libs/es2021/weakref/index.d.ts +60 -0
- package/libs/es2022/array/index.d.ts +105 -0
- package/libs/es2022/error/index.d.ts +57 -0
- package/libs/es2022/full/index.d.ts +8 -0
- package/libs/es2022/index.d.ts +10 -0
- package/libs/es2022/intl/index.d.ts +112 -0
- package/libs/es2022/object/index.d.ts +41 -0
- package/libs/es2022/regexp/index.d.ts +23 -0
- package/libs/es2022/sharedmemory/index.d.ts +37 -0
- package/libs/es2022/string/index.d.ts +9 -0
- package/libs/es2023/array/index.d.ts +906 -0
- package/libs/es2023/collection/index.d.ts +5 -0
- package/libs/es2023/full/index.d.ts +8 -0
- package/libs/es2023/index.d.ts +5 -0
- package/libs/es5/index.d.ts +5738 -0
- package/libs/es6/index.d.ts +7 -0
- package/libs/esnext/collection/index.d.ts +13 -0
- package/libs/esnext/decorators/index.d.ts +12 -0
- package/libs/esnext/disposable/index.d.ts +169 -0
- package/libs/esnext/full/index.d.ts +8 -0
- package/libs/esnext/index.d.ts +9 -0
- package/libs/esnext/intl/index.d.ts +15 -0
- package/libs/esnext/object/index.d.ts +13 -0
- package/libs/esnext/promise/index.d.ts +19 -0
- package/libs/scripthost/index.d.ts +310 -0
- package/libs/webworker/asynciterable/index.d.ts +14 -0
- package/libs/webworker/importscripts/index.d.ts +7 -0
- package/libs/webworker/index.d.ts +11758 -0
- package/libs/webworker/iterable/index.d.ts +543 -0
- package/package.json +23 -0
|
@@ -0,0 +1,906 @@
|
|
|
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, ASCII character 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, ASCII character 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 {
|
|
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: Int8Array,
|
|
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: Int8Array,
|
|
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: Int8Array,
|
|
200
|
+
) => boolean,
|
|
201
|
+
thisArg?: unknown,
|
|
202
|
+
): number;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Returns a copy of an array with its elements reversed.
|
|
206
|
+
*/
|
|
207
|
+
toReversed(): Uint8Array;
|
|
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 = Uint8Array.from([11, 2, 22, 1]);
|
|
216
|
+
* myNums.toSorted((a, b) => a - b) // Uint8Array(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
|
+
): Uint8Array;
|
|
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(index: number, value: import('ts-type-forge').Int8): Uint8Array;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
interface Uint8Array {
|
|
239
|
+
/**
|
|
240
|
+
* Returns the value of the last element in the array where predicate is true, and undefined
|
|
241
|
+
* otherwise.
|
|
242
|
+
* @param predicate findLast calls predicate once for each element of the array, in descending
|
|
243
|
+
* order, until it finds one where predicate returns true. If such an element is found, findLast
|
|
244
|
+
* immediately returns that element value. Otherwise, findLast returns undefined.
|
|
245
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
246
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
247
|
+
*/
|
|
248
|
+
findLast<S extends import('ts-type-forge').Uint8>(
|
|
249
|
+
predicate: (
|
|
250
|
+
value: import('ts-type-forge').Uint8,
|
|
251
|
+
index: number,
|
|
252
|
+
array: Uint8Array,
|
|
253
|
+
) => value is S,
|
|
254
|
+
thisArg?: unknown,
|
|
255
|
+
): S | undefined;
|
|
256
|
+
findLast(
|
|
257
|
+
predicate: (
|
|
258
|
+
value: import('ts-type-forge').Uint8,
|
|
259
|
+
index: number,
|
|
260
|
+
array: Uint8Array,
|
|
261
|
+
) => boolean,
|
|
262
|
+
thisArg?: unknown,
|
|
263
|
+
): import('ts-type-forge').Uint8 | undefined;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Returns the index of the last element in the array where predicate is true, and -1
|
|
267
|
+
* otherwise.
|
|
268
|
+
* @param predicate findLastIndex calls predicate once for each element of the array, in descending
|
|
269
|
+
* order, until it finds one where predicate returns true. If such an element is found,
|
|
270
|
+
* findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
|
|
271
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
272
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
273
|
+
*/
|
|
274
|
+
findLastIndex(
|
|
275
|
+
predicate: (
|
|
276
|
+
value: import('ts-type-forge').Uint8,
|
|
277
|
+
index: number,
|
|
278
|
+
array: Uint8Array,
|
|
279
|
+
) => boolean,
|
|
280
|
+
thisArg?: unknown,
|
|
281
|
+
): number;
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Returns a copy of an array with its elements reversed.
|
|
285
|
+
*/
|
|
286
|
+
toReversed(): Uint8Array;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Returns a copy of an array with its elements sorted.
|
|
290
|
+
* @param compareFn Function used to determine the order of the elements. It is expected to return
|
|
291
|
+
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
|
|
292
|
+
* value otherwise. If omitted, the elements are sorted in ascending order.
|
|
293
|
+
* ```ts
|
|
294
|
+
* const myNums = Uint8Array.from([11, 2, 22, 1]);
|
|
295
|
+
* myNums.toSorted((a, b) => a - b) // Uint8Array(4) [1, 2, 11, 22]
|
|
296
|
+
* ```
|
|
297
|
+
*/
|
|
298
|
+
toSorted(
|
|
299
|
+
compareFn?: (
|
|
300
|
+
a: import('ts-type-forge').Uint8,
|
|
301
|
+
b: import('ts-type-forge').Uint8,
|
|
302
|
+
) => number,
|
|
303
|
+
): Uint8Array;
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Copies an array, then overwrites the value at the provided index with the
|
|
307
|
+
* given value. If the index is negative, then it replaces from the end
|
|
308
|
+
* of the array.
|
|
309
|
+
* @param index The index of the value to overwrite. If the index is
|
|
310
|
+
* negative, then it replaces from the end of the array.
|
|
311
|
+
* @param value The value to write into the copied array.
|
|
312
|
+
* @returns The copied array with the updated value.
|
|
313
|
+
*/
|
|
314
|
+
with(index: number, value: import('ts-type-forge').Uint8): Uint8Array;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
interface Uint8ClampedArray {
|
|
318
|
+
/**
|
|
319
|
+
* Returns the value of the last element in the array where predicate is true, and undefined
|
|
320
|
+
* otherwise.
|
|
321
|
+
* @param predicate findLast calls predicate once for each element of the array, in descending
|
|
322
|
+
* order, until it finds one where predicate returns true. If such an element is found, findLast
|
|
323
|
+
* immediately returns that element value. Otherwise, findLast returns undefined.
|
|
324
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
325
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
326
|
+
*/
|
|
327
|
+
findLast<S extends import('ts-type-forge').Uint8>(
|
|
328
|
+
predicate: (
|
|
329
|
+
value: import('ts-type-forge').Uint8,
|
|
330
|
+
index: number,
|
|
331
|
+
array: Uint8ClampedArray,
|
|
332
|
+
) => value is S,
|
|
333
|
+
thisArg?: unknown,
|
|
334
|
+
): S | undefined;
|
|
335
|
+
findLast(
|
|
336
|
+
predicate: (
|
|
337
|
+
value: import('ts-type-forge').Uint8,
|
|
338
|
+
index: number,
|
|
339
|
+
array: Uint8ClampedArray,
|
|
340
|
+
) => boolean,
|
|
341
|
+
thisArg?: unknown,
|
|
342
|
+
): import('ts-type-forge').Uint8 | undefined;
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Returns the index of the last element in the array where predicate is true, and -1
|
|
346
|
+
* otherwise.
|
|
347
|
+
* @param predicate findLastIndex calls predicate once for each element of the array, in descending
|
|
348
|
+
* order, until it finds one where predicate returns true. If such an element is found,
|
|
349
|
+
* findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
|
|
350
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
351
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
352
|
+
*/
|
|
353
|
+
findLastIndex(
|
|
354
|
+
predicate: (
|
|
355
|
+
value: import('ts-type-forge').Uint8,
|
|
356
|
+
index: number,
|
|
357
|
+
array: Uint8ClampedArray,
|
|
358
|
+
) => boolean,
|
|
359
|
+
thisArg?: unknown,
|
|
360
|
+
): number;
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Returns a copy of an array with its elements reversed.
|
|
364
|
+
*/
|
|
365
|
+
toReversed(): Uint8ClampedArray;
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Returns a copy of an array with its elements sorted.
|
|
369
|
+
* @param compareFn Function used to determine the order of the elements. It is expected to return
|
|
370
|
+
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
|
|
371
|
+
* value otherwise. If omitted, the elements are sorted in ascending order.
|
|
372
|
+
* ```ts
|
|
373
|
+
* const myNums = Uint8ClampedArray.from([11, 2, 22, 1]);
|
|
374
|
+
* myNums.toSorted((a, b) => a - b) // Uint8ClampedArray(4) [1, 2, 11, 22]
|
|
375
|
+
* ```
|
|
376
|
+
*/
|
|
377
|
+
toSorted(
|
|
378
|
+
compareFn?: (
|
|
379
|
+
a: import('ts-type-forge').Uint8,
|
|
380
|
+
b: import('ts-type-forge').Uint8,
|
|
381
|
+
) => number,
|
|
382
|
+
): Uint8ClampedArray;
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Copies an array, then overwrites the value at the provided index with the
|
|
386
|
+
* given value. If the index is negative, then it replaces from the end
|
|
387
|
+
* of the array.
|
|
388
|
+
* @param index The index of the value to overwrite. If the index is
|
|
389
|
+
* negative, then it replaces from the end of the array.
|
|
390
|
+
* @param value The value to write into the copied array.
|
|
391
|
+
* @returns The copied array with the updated value.
|
|
392
|
+
*/
|
|
393
|
+
with(index: number, value: import('ts-type-forge').Uint8): Uint8ClampedArray;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
interface Int16Array {
|
|
397
|
+
/**
|
|
398
|
+
* Returns the value of the last element in the array where predicate is true, and undefined
|
|
399
|
+
* otherwise.
|
|
400
|
+
* @param predicate findLast calls predicate once for each element of the array, in descending
|
|
401
|
+
* order, until it finds one where predicate returns true. If such an element is found, findLast
|
|
402
|
+
* immediately returns that element value. Otherwise, findLast returns undefined.
|
|
403
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
404
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
405
|
+
*/
|
|
406
|
+
findLast<S extends number>(
|
|
407
|
+
predicate: (value: number, index: number, array: Int16Array) => value is S,
|
|
408
|
+
thisArg?: unknown,
|
|
409
|
+
): S | undefined;
|
|
410
|
+
findLast(
|
|
411
|
+
predicate: (value: number, index: number, array: Int16Array) => boolean,
|
|
412
|
+
thisArg?: unknown,
|
|
413
|
+
): number | undefined;
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Returns the index of the last element in the array where predicate is true, and -1
|
|
417
|
+
* otherwise.
|
|
418
|
+
* @param predicate findLastIndex calls predicate once for each element of the array, in descending
|
|
419
|
+
* order, until it finds one where predicate returns true. If such an element is found,
|
|
420
|
+
* findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
|
|
421
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
422
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
423
|
+
*/
|
|
424
|
+
findLastIndex(
|
|
425
|
+
predicate: (value: number, index: number, array: Int16Array) => boolean,
|
|
426
|
+
thisArg?: unknown,
|
|
427
|
+
): number;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Returns a copy of an array with its elements reversed.
|
|
431
|
+
*/
|
|
432
|
+
toReversed(): Int16Array;
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Returns a copy of an array with its elements sorted.
|
|
436
|
+
* @param compareFn Function used to determine the order of the elements. It is expected to return
|
|
437
|
+
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
|
|
438
|
+
* value otherwise. If omitted, the elements are sorted in ascending order.
|
|
439
|
+
* ```ts
|
|
440
|
+
* const myNums = Int16Array.from([11, 2, -22, 1]);
|
|
441
|
+
* myNums.toSorted((a, b) => a - b) // Int16Array(4) [-22, 1, 2, 11]
|
|
442
|
+
* ```
|
|
443
|
+
*/
|
|
444
|
+
toSorted(compareFn?: (a: number, b: number) => number): Int16Array;
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Copies an array, then overwrites the value at the provided index with the
|
|
448
|
+
* given value. If the index is negative, then it replaces from the end
|
|
449
|
+
* of the array.
|
|
450
|
+
* @param index The index of the value to overwrite. If the index is
|
|
451
|
+
* negative, then it replaces from the end of the array.
|
|
452
|
+
* @param value The value to write into the copied array.
|
|
453
|
+
* @returns The copied array with the updated value.
|
|
454
|
+
*/
|
|
455
|
+
with(index: number, value: number): Int16Array;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
interface Uint16Array {
|
|
459
|
+
/**
|
|
460
|
+
* Returns the value of the last element in the array where predicate is true, and undefined
|
|
461
|
+
* otherwise.
|
|
462
|
+
* @param predicate findLast calls predicate once for each element of the array, in descending
|
|
463
|
+
* order, until it finds one where predicate returns true. If such an element is found, findLast
|
|
464
|
+
* immediately returns that element value. Otherwise, findLast returns undefined.
|
|
465
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
466
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
467
|
+
*/
|
|
468
|
+
findLast<S extends number>(
|
|
469
|
+
predicate: (value: number, index: number, array: Uint16Array) => value is S,
|
|
470
|
+
thisArg?: unknown,
|
|
471
|
+
): S | undefined;
|
|
472
|
+
findLast(
|
|
473
|
+
predicate: (value: number, index: number, array: Uint16Array) => boolean,
|
|
474
|
+
thisArg?: unknown,
|
|
475
|
+
): number | undefined;
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Returns the index of the last element in the array where predicate is true, and -1
|
|
479
|
+
* otherwise.
|
|
480
|
+
* @param predicate findLastIndex calls predicate once for each element of the array, in descending
|
|
481
|
+
* order, until it finds one where predicate returns true. If such an element is found,
|
|
482
|
+
* findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
|
|
483
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
484
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
485
|
+
*/
|
|
486
|
+
findLastIndex(
|
|
487
|
+
predicate: (value: number, index: number, array: Uint16Array) => boolean,
|
|
488
|
+
thisArg?: unknown,
|
|
489
|
+
): number;
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* Returns a copy of an array with its elements reversed.
|
|
493
|
+
*/
|
|
494
|
+
toReversed(): Uint16Array;
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Returns a copy of an array with its elements sorted.
|
|
498
|
+
* @param compareFn Function used to determine the order of the elements. It is expected to return
|
|
499
|
+
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
|
|
500
|
+
* value otherwise. If omitted, the elements are sorted in ascending order.
|
|
501
|
+
* ```ts
|
|
502
|
+
* const myNums = Uint16Array.from([11, 2, 22, 1]);
|
|
503
|
+
* myNums.toSorted((a, b) => a - b) // Uint16Array(4) [1, 2, 11, 22]
|
|
504
|
+
* ```
|
|
505
|
+
*/
|
|
506
|
+
toSorted(compareFn?: (a: number, b: number) => number): Uint16Array;
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* Copies an array, then overwrites the value at the provided index with the
|
|
510
|
+
* given value. If the index is negative, then it replaces from the end
|
|
511
|
+
* of the array.
|
|
512
|
+
* @param index The index of the value to overwrite. If the index is
|
|
513
|
+
* negative, then it replaces from the end of the array.
|
|
514
|
+
* @param value The value to write into the copied array.
|
|
515
|
+
* @returns The copied array with the updated value.
|
|
516
|
+
*/
|
|
517
|
+
with(index: number, value: number): Uint16Array;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
interface Int32Array {
|
|
521
|
+
/**
|
|
522
|
+
* Returns the value of the last element in the array where predicate is true, and undefined
|
|
523
|
+
* otherwise.
|
|
524
|
+
* @param predicate findLast calls predicate once for each element of the array, in descending
|
|
525
|
+
* order, until it finds one where predicate returns true. If such an element is found, findLast
|
|
526
|
+
* immediately returns that element value. Otherwise, findLast returns undefined.
|
|
527
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
528
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
529
|
+
*/
|
|
530
|
+
findLast<S extends number>(
|
|
531
|
+
predicate: (value: number, index: number, array: Int32Array) => value is S,
|
|
532
|
+
thisArg?: unknown,
|
|
533
|
+
): S | undefined;
|
|
534
|
+
findLast(
|
|
535
|
+
predicate: (value: number, index: number, array: Int32Array) => boolean,
|
|
536
|
+
thisArg?: unknown,
|
|
537
|
+
): number | undefined;
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Returns the index of the last element in the array where predicate is true, and -1
|
|
541
|
+
* otherwise.
|
|
542
|
+
* @param predicate findLastIndex calls predicate once for each element of the array, in descending
|
|
543
|
+
* order, until it finds one where predicate returns true. If such an element is found,
|
|
544
|
+
* findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
|
|
545
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
546
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
547
|
+
*/
|
|
548
|
+
findLastIndex(
|
|
549
|
+
predicate: (value: number, index: number, array: Int32Array) => boolean,
|
|
550
|
+
thisArg?: unknown,
|
|
551
|
+
): number;
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* Returns a copy of an array with its elements reversed.
|
|
555
|
+
*/
|
|
556
|
+
toReversed(): Int32Array;
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* Returns a copy of an array with its elements sorted.
|
|
560
|
+
* @param compareFn Function used to determine the order of the elements. It is expected to return
|
|
561
|
+
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
|
|
562
|
+
* value otherwise. If omitted, the elements are sorted in ascending order.
|
|
563
|
+
* ```ts
|
|
564
|
+
* const myNums = Int32Array.from([11, 2, -22, 1]);
|
|
565
|
+
* myNums.toSorted((a, b) => a - b) // Int32Array(4) [-22, 1, 2, 11]
|
|
566
|
+
* ```
|
|
567
|
+
*/
|
|
568
|
+
toSorted(compareFn?: (a: number, b: number) => number): Int32Array;
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* Copies an array, then overwrites the value at the provided index with the
|
|
572
|
+
* given value. If the index is negative, then it replaces from the end
|
|
573
|
+
* of the array.
|
|
574
|
+
* @param index The index of the value to overwrite. If the index is
|
|
575
|
+
* negative, then it replaces from the end of the array.
|
|
576
|
+
* @param value The value to write into the copied array.
|
|
577
|
+
* @returns The copied array with the updated value.
|
|
578
|
+
*/
|
|
579
|
+
with(index: number, value: number): Int32Array;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
interface Uint32Array {
|
|
583
|
+
/**
|
|
584
|
+
* Returns the value of the last element in the array where predicate is true, and undefined
|
|
585
|
+
* otherwise.
|
|
586
|
+
* @param predicate findLast calls predicate once for each element of the array, in descending
|
|
587
|
+
* order, until it finds one where predicate returns true. If such an element is found, findLast
|
|
588
|
+
* immediately returns that element value. Otherwise, findLast returns undefined.
|
|
589
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
590
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
591
|
+
*/
|
|
592
|
+
findLast<S extends number>(
|
|
593
|
+
predicate: (value: number, index: number, array: Uint32Array) => value is S,
|
|
594
|
+
thisArg?: unknown,
|
|
595
|
+
): S | undefined;
|
|
596
|
+
findLast(
|
|
597
|
+
predicate: (value: number, index: number, array: Uint32Array) => boolean,
|
|
598
|
+
thisArg?: unknown,
|
|
599
|
+
): number | undefined;
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Returns the index of the last element in the array where predicate is true, and -1
|
|
603
|
+
* otherwise.
|
|
604
|
+
* @param predicate findLastIndex calls predicate once for each element of the array, in descending
|
|
605
|
+
* order, until it finds one where predicate returns true. If such an element is found,
|
|
606
|
+
* findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
|
|
607
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
608
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
609
|
+
*/
|
|
610
|
+
findLastIndex(
|
|
611
|
+
predicate: (value: number, index: number, array: Uint32Array) => boolean,
|
|
612
|
+
thisArg?: unknown,
|
|
613
|
+
): number;
|
|
614
|
+
|
|
615
|
+
/**
|
|
616
|
+
* Returns a copy of an array with its elements reversed.
|
|
617
|
+
*/
|
|
618
|
+
toReversed(): Uint32Array;
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* Returns a copy of an array with its elements sorted.
|
|
622
|
+
* @param compareFn Function used to determine the order of the elements. It is expected to return
|
|
623
|
+
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
|
|
624
|
+
* value otherwise. If omitted, the elements are sorted in ascending order.
|
|
625
|
+
* ```ts
|
|
626
|
+
* const myNums = Uint32Array.from([11, 2, 22, 1]);
|
|
627
|
+
* myNums.toSorted((a, b) => a - b) // Uint32Array(4) [1, 2, 11, 22]
|
|
628
|
+
* ```
|
|
629
|
+
*/
|
|
630
|
+
toSorted(compareFn?: (a: number, b: number) => number): Uint32Array;
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Copies an array, then overwrites the value at the provided index with the
|
|
634
|
+
* given value. If the index is negative, then it replaces from the end
|
|
635
|
+
* of the array.
|
|
636
|
+
* @param index The index of the value to overwrite. If the index is
|
|
637
|
+
* negative, then it replaces from the end of the array.
|
|
638
|
+
* @param value The value to write into the copied array.
|
|
639
|
+
* @returns The copied array with the updated value.
|
|
640
|
+
*/
|
|
641
|
+
with(index: number, value: number): Uint32Array;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
interface Float32Array {
|
|
645
|
+
/**
|
|
646
|
+
* Returns the value of the last element in the array where predicate is true, and undefined
|
|
647
|
+
* otherwise.
|
|
648
|
+
* @param predicate findLast calls predicate once for each element of the array, in descending
|
|
649
|
+
* order, until it finds one where predicate returns true. If such an element is found, findLast
|
|
650
|
+
* immediately returns that element value. Otherwise, findLast returns undefined.
|
|
651
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
652
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
653
|
+
*/
|
|
654
|
+
findLast<S extends number>(
|
|
655
|
+
predicate: (
|
|
656
|
+
value: number,
|
|
657
|
+
index: number,
|
|
658
|
+
array: Float32Array,
|
|
659
|
+
) => value is S,
|
|
660
|
+
thisArg?: unknown,
|
|
661
|
+
): S | undefined;
|
|
662
|
+
findLast(
|
|
663
|
+
predicate: (value: number, index: number, array: Float32Array) => boolean,
|
|
664
|
+
thisArg?: unknown,
|
|
665
|
+
): number | undefined;
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* Returns the index of the last element in the array where predicate is true, and -1
|
|
669
|
+
* otherwise.
|
|
670
|
+
* @param predicate findLastIndex calls predicate once for each element of the array, in descending
|
|
671
|
+
* order, until it finds one where predicate returns true. If such an element is found,
|
|
672
|
+
* findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
|
|
673
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
674
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
675
|
+
*/
|
|
676
|
+
findLastIndex(
|
|
677
|
+
predicate: (value: number, index: number, array: Float32Array) => boolean,
|
|
678
|
+
thisArg?: unknown,
|
|
679
|
+
): number;
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* Returns a copy of an array with its elements reversed.
|
|
683
|
+
*/
|
|
684
|
+
toReversed(): Float32Array;
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* Returns a copy of an array with its elements sorted.
|
|
688
|
+
* @param compareFn Function used to determine the order of the elements. It is expected to return
|
|
689
|
+
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
|
|
690
|
+
* value otherwise. If omitted, the elements are sorted in ascending order.
|
|
691
|
+
* ```ts
|
|
692
|
+
* const myNums = Float32Array.from([11.25, 2, -22.5, 1]);
|
|
693
|
+
* myNums.toSorted((a, b) => a - b) // Float32Array(4) [-22.5, 1, 2, 11.5]
|
|
694
|
+
* ```
|
|
695
|
+
*/
|
|
696
|
+
toSorted(compareFn?: (a: number, b: number) => number): Float32Array;
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* Copies an array, then overwrites the value at the provided index with the
|
|
700
|
+
* given value. If the index is negative, then it replaces from the end
|
|
701
|
+
* of the array.
|
|
702
|
+
* @param index The index of the value to overwrite. If the index is
|
|
703
|
+
* negative, then it replaces from the end of the array.
|
|
704
|
+
* @param value The value to write into the copied array.
|
|
705
|
+
* @returns The copied array with the updated value.
|
|
706
|
+
*/
|
|
707
|
+
with(index: number, value: number): Float32Array;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
interface Float64Array {
|
|
711
|
+
/**
|
|
712
|
+
* Returns the value of the last element in the array where predicate is true, and undefined
|
|
713
|
+
* otherwise.
|
|
714
|
+
* @param predicate findLast calls predicate once for each element of the array, in descending
|
|
715
|
+
* order, until it finds one where predicate returns true. If such an element is found, findLast
|
|
716
|
+
* immediately returns that element value. Otherwise, findLast returns undefined.
|
|
717
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
718
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
719
|
+
*/
|
|
720
|
+
findLast<S extends number>(
|
|
721
|
+
predicate: (
|
|
722
|
+
value: number,
|
|
723
|
+
index: number,
|
|
724
|
+
array: Float64Array,
|
|
725
|
+
) => value is S,
|
|
726
|
+
thisArg?: unknown,
|
|
727
|
+
): S | undefined;
|
|
728
|
+
findLast(
|
|
729
|
+
predicate: (value: number, index: number, array: Float64Array) => boolean,
|
|
730
|
+
thisArg?: unknown,
|
|
731
|
+
): number | undefined;
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* Returns the index of the last element in the array where predicate is true, and -1
|
|
735
|
+
* otherwise.
|
|
736
|
+
* @param predicate findLastIndex calls predicate once for each element of the array, in descending
|
|
737
|
+
* order, until it finds one where predicate returns true. If such an element is found,
|
|
738
|
+
* findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
|
|
739
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
740
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
741
|
+
*/
|
|
742
|
+
findLastIndex(
|
|
743
|
+
predicate: (value: number, index: number, array: Float64Array) => boolean,
|
|
744
|
+
thisArg?: unknown,
|
|
745
|
+
): number;
|
|
746
|
+
|
|
747
|
+
/**
|
|
748
|
+
* Returns a copy of an array with its elements reversed.
|
|
749
|
+
*/
|
|
750
|
+
toReversed(): Float64Array;
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* Returns a copy of an array with its elements sorted.
|
|
754
|
+
* @param compareFn Function used to determine the order of the elements. It is expected to return
|
|
755
|
+
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
|
|
756
|
+
* value otherwise. If omitted, the elements are sorted in ascending order.
|
|
757
|
+
* ```ts
|
|
758
|
+
* const myNums = Float64Array.from([11.25, 2, -22.5, 1]);
|
|
759
|
+
* myNums.toSorted((a, b) => a - b) // Float64Array(4) [-22.5, 1, 2, 11.5]
|
|
760
|
+
* ```
|
|
761
|
+
*/
|
|
762
|
+
toSorted(compareFn?: (a: number, b: number) => number): Float64Array;
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* Copies an array, then overwrites the value at the provided index with the
|
|
766
|
+
* given value. If the index is negative, then it replaces from the end
|
|
767
|
+
* of the array.
|
|
768
|
+
* @param index The index of the value to overwrite. If the index is
|
|
769
|
+
* negative, then it replaces from the end of the array.
|
|
770
|
+
* @param value The value to write into the copied array.
|
|
771
|
+
* @returns The copied array with the updated value.
|
|
772
|
+
*/
|
|
773
|
+
with(index: number, value: number): Float64Array;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
interface BigInt64Array {
|
|
777
|
+
/**
|
|
778
|
+
* Returns the value of the last element in the array where predicate is true, and undefined
|
|
779
|
+
* otherwise.
|
|
780
|
+
* @param predicate findLast calls predicate once for each element of the array, in descending
|
|
781
|
+
* order, until it finds one where predicate returns true. If such an element is found, findLast
|
|
782
|
+
* immediately returns that element value. Otherwise, findLast returns undefined.
|
|
783
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
784
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
785
|
+
*/
|
|
786
|
+
findLast<S extends bigint>(
|
|
787
|
+
predicate: (
|
|
788
|
+
value: bigint,
|
|
789
|
+
index: number,
|
|
790
|
+
array: BigInt64Array,
|
|
791
|
+
) => value is S,
|
|
792
|
+
thisArg?: unknown,
|
|
793
|
+
): S | undefined;
|
|
794
|
+
findLast(
|
|
795
|
+
predicate: (value: bigint, index: number, array: BigInt64Array) => boolean,
|
|
796
|
+
thisArg?: unknown,
|
|
797
|
+
): bigint | undefined;
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* Returns the index of the last element in the array where predicate is true, and -1
|
|
801
|
+
* otherwise.
|
|
802
|
+
* @param predicate findLastIndex calls predicate once for each element of the array, in descending
|
|
803
|
+
* order, until it finds one where predicate returns true. If such an element is found,
|
|
804
|
+
* findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
|
|
805
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
806
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
807
|
+
*/
|
|
808
|
+
findLastIndex(
|
|
809
|
+
predicate: (value: bigint, index: number, array: BigInt64Array) => boolean,
|
|
810
|
+
thisArg?: unknown,
|
|
811
|
+
): number;
|
|
812
|
+
|
|
813
|
+
/**
|
|
814
|
+
* Returns a copy of an array with its elements reversed.
|
|
815
|
+
*/
|
|
816
|
+
toReversed(): BigInt64Array;
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* Returns a copy of an array with its elements sorted.
|
|
820
|
+
* @param compareFn Function used to determine the order of the elements. It is expected to return
|
|
821
|
+
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
|
|
822
|
+
* value otherwise. If omitted, the elements are sorted in ascending order.
|
|
823
|
+
* ```ts
|
|
824
|
+
* const myNums = BigInt64Array.from([11n, 2n, -22n, 1n]);
|
|
825
|
+
* myNums.toSorted((a, b) => Number(a - b)) // BigInt64Array(4) [-22n, 1n, 2n, 11n]
|
|
826
|
+
* ```
|
|
827
|
+
*/
|
|
828
|
+
toSorted(compareFn?: (a: bigint, b: bigint) => number): BigInt64Array;
|
|
829
|
+
|
|
830
|
+
/**
|
|
831
|
+
* Copies an array, then overwrites the value at the provided index with the
|
|
832
|
+
* given value. If the index is negative, then it replaces from the end
|
|
833
|
+
* of the array.
|
|
834
|
+
* @param index The index of the value to overwrite. If the index is
|
|
835
|
+
* negative, then it replaces from the end of the array.
|
|
836
|
+
* @param value The value to write into the copied array.
|
|
837
|
+
* @returns The copied array with the updated value.
|
|
838
|
+
*/
|
|
839
|
+
with(index: number, value: bigint): BigInt64Array;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
interface BigUint64Array {
|
|
843
|
+
/**
|
|
844
|
+
* Returns the value of the last element in the array where predicate is true, and undefined
|
|
845
|
+
* otherwise.
|
|
846
|
+
* @param predicate findLast calls predicate once for each element of the array, in descending
|
|
847
|
+
* order, until it finds one where predicate returns true. If such an element is found, findLast
|
|
848
|
+
* immediately returns that element value. Otherwise, findLast returns undefined.
|
|
849
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
850
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
851
|
+
*/
|
|
852
|
+
findLast<S extends bigint>(
|
|
853
|
+
predicate: (
|
|
854
|
+
value: bigint,
|
|
855
|
+
index: number,
|
|
856
|
+
array: BigUint64Array,
|
|
857
|
+
) => value is S,
|
|
858
|
+
thisArg?: unknown,
|
|
859
|
+
): S | undefined;
|
|
860
|
+
findLast(
|
|
861
|
+
predicate: (value: bigint, index: number, array: BigUint64Array) => boolean,
|
|
862
|
+
thisArg?: unknown,
|
|
863
|
+
): bigint | undefined;
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* Returns the index of the last element in the array where predicate is true, and -1
|
|
867
|
+
* otherwise.
|
|
868
|
+
* @param predicate findLastIndex calls predicate once for each element of the array, in descending
|
|
869
|
+
* order, until it finds one where predicate returns true. If such an element is found,
|
|
870
|
+
* findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
|
|
871
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
872
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
873
|
+
*/
|
|
874
|
+
findLastIndex(
|
|
875
|
+
predicate: (value: bigint, index: number, array: BigUint64Array) => boolean,
|
|
876
|
+
thisArg?: unknown,
|
|
877
|
+
): number;
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* Returns a copy of an array with its elements reversed.
|
|
881
|
+
*/
|
|
882
|
+
toReversed(): BigUint64Array;
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* Returns a copy of an array with its elements sorted.
|
|
886
|
+
* @param compareFn Function used to determine the order of the elements. It is expected to return
|
|
887
|
+
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
|
|
888
|
+
* value otherwise. If omitted, the elements are sorted in ascending order.
|
|
889
|
+
* ```ts
|
|
890
|
+
* const myNums = BigUint64Array.from([11n, 2n, 22n, 1n]);
|
|
891
|
+
* myNums.toSorted((a, b) => Number(a - b)) // BigUint64Array(4) [1n, 2n, 11n, 22n]
|
|
892
|
+
* ```
|
|
893
|
+
*/
|
|
894
|
+
toSorted(compareFn?: (a: bigint, b: bigint) => number): BigUint64Array;
|
|
895
|
+
|
|
896
|
+
/**
|
|
897
|
+
* Copies an array, then overwrites the value at the provided index with the
|
|
898
|
+
* given value. If the index is negative, then it replaces from the end
|
|
899
|
+
* of the array.
|
|
900
|
+
* @param index The index of the value to overwrite. If the index is
|
|
901
|
+
* negative, then it replaces from the end of the array.
|
|
902
|
+
* @param value The value to write into the copied array.
|
|
903
|
+
* @returns The copied array with the updated value.
|
|
904
|
+
*/
|
|
905
|
+
with(index: number, value: bigint): BigUint64Array;
|
|
906
|
+
}
|