typescript 5.6.0-dev.20240805 → 5.6.0-dev.20240807
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/lib/lib.dom.asynciterable.d.ts +14 -6
- package/lib/lib.dom.iterable.d.ts +93 -73
- package/lib/lib.es2015.generator.d.ts +1 -1
- package/lib/lib.es2015.iterable.d.ts +90 -64
- package/lib/lib.es2018.asyncgenerator.d.ts +1 -1
- package/lib/lib.es2018.asynciterable.d.ts +8 -2
- package/lib/lib.es2020.bigint.d.ts +8 -8
- package/lib/lib.es2020.string.d.ts +2 -2
- package/lib/lib.es2020.symbol.wellknown.d.ts +5 -1
- package/lib/lib.es2022.intl.d.ts +5 -1
- package/lib/lib.esnext.iterator.d.ts +16 -16
- package/lib/lib.webworker.asynciterable.d.ts +14 -6
- package/lib/lib.webworker.iterable.d.ts +46 -30
- package/lib/tsc.js +85 -26
- package/lib/typescript.d.ts +3 -2
- package/lib/typescript.js +88 -28
- package/package.json +2 -2
|
@@ -49,34 +49,48 @@ interface Iterable<T, TReturn = any, TNext = any> {
|
|
|
49
49
|
[Symbol.iterator](): Iterator<T, TReturn, TNext>;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Describes a user-defined {@link Iterator} that is also iterable.
|
|
54
|
+
*/
|
|
52
55
|
interface IterableIterator<T, TReturn = any, TNext = any> extends Iterator<T, TReturn, TNext> {
|
|
53
56
|
[Symbol.iterator](): IterableIterator<T, TReturn, TNext>;
|
|
54
57
|
}
|
|
55
58
|
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Describes an {@link Iterator} produced by the runtime that inherits from the intrinsic `Iterator.prototype`.
|
|
61
|
+
*/
|
|
62
|
+
interface IteratorObject<T, TReturn = unknown, TNext = unknown> extends Iterator<T, TReturn, TNext> {
|
|
63
|
+
[Symbol.iterator](): IteratorObject<T, TReturn, TNext>;
|
|
58
64
|
}
|
|
59
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Defines the `TReturn` type used for built-in iterators produced by `Array`, `Map`, `Set`, and others.
|
|
68
|
+
* This is `undefined` when `strictBuiltInIteratorReturn` is `true`; otherwise, this is `any`.
|
|
69
|
+
*/
|
|
60
70
|
type BuiltinIteratorReturn = intrinsic;
|
|
61
71
|
|
|
72
|
+
interface ArrayIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
|
|
73
|
+
[Symbol.iterator](): ArrayIterator<T>;
|
|
74
|
+
}
|
|
75
|
+
|
|
62
76
|
interface Array<T> {
|
|
63
77
|
/** Iterator */
|
|
64
|
-
[Symbol.iterator]():
|
|
78
|
+
[Symbol.iterator](): ArrayIterator<T>;
|
|
65
79
|
|
|
66
80
|
/**
|
|
67
81
|
* Returns an iterable of key, value pairs for every entry in the array
|
|
68
82
|
*/
|
|
69
|
-
entries():
|
|
83
|
+
entries(): ArrayIterator<[number, T]>;
|
|
70
84
|
|
|
71
85
|
/**
|
|
72
86
|
* Returns an iterable of keys in the array
|
|
73
87
|
*/
|
|
74
|
-
keys():
|
|
88
|
+
keys(): ArrayIterator<number>;
|
|
75
89
|
|
|
76
90
|
/**
|
|
77
91
|
* Returns an iterable of values in the array
|
|
78
92
|
*/
|
|
79
|
-
values():
|
|
93
|
+
values(): ArrayIterator<T>;
|
|
80
94
|
}
|
|
81
95
|
|
|
82
96
|
interface ArrayConstructor {
|
|
@@ -97,67 +111,71 @@ interface ArrayConstructor {
|
|
|
97
111
|
|
|
98
112
|
interface ReadonlyArray<T> {
|
|
99
113
|
/** Iterator of values in the array. */
|
|
100
|
-
[Symbol.iterator]():
|
|
114
|
+
[Symbol.iterator](): ArrayIterator<T>;
|
|
101
115
|
|
|
102
116
|
/**
|
|
103
117
|
* Returns an iterable of key, value pairs for every entry in the array
|
|
104
118
|
*/
|
|
105
|
-
entries():
|
|
119
|
+
entries(): ArrayIterator<[number, T]>;
|
|
106
120
|
|
|
107
121
|
/**
|
|
108
122
|
* Returns an iterable of keys in the array
|
|
109
123
|
*/
|
|
110
|
-
keys():
|
|
124
|
+
keys(): ArrayIterator<number>;
|
|
111
125
|
|
|
112
126
|
/**
|
|
113
127
|
* Returns an iterable of values in the array
|
|
114
128
|
*/
|
|
115
|
-
values():
|
|
129
|
+
values(): ArrayIterator<T>;
|
|
116
130
|
}
|
|
117
131
|
|
|
118
132
|
interface IArguments {
|
|
119
133
|
/** Iterator */
|
|
120
|
-
[Symbol.iterator]():
|
|
134
|
+
[Symbol.iterator](): ArrayIterator<any>;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
interface MapIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
|
|
138
|
+
[Symbol.iterator](): MapIterator<T>;
|
|
121
139
|
}
|
|
122
140
|
|
|
123
141
|
interface Map<K, V> {
|
|
124
142
|
/** Returns an iterable of entries in the map. */
|
|
125
|
-
[Symbol.iterator]():
|
|
143
|
+
[Symbol.iterator](): MapIterator<[K, V]>;
|
|
126
144
|
|
|
127
145
|
/**
|
|
128
146
|
* Returns an iterable of key, value pairs for every entry in the map.
|
|
129
147
|
*/
|
|
130
|
-
entries():
|
|
148
|
+
entries(): MapIterator<[K, V]>;
|
|
131
149
|
|
|
132
150
|
/**
|
|
133
151
|
* Returns an iterable of keys in the map
|
|
134
152
|
*/
|
|
135
|
-
keys():
|
|
153
|
+
keys(): MapIterator<K>;
|
|
136
154
|
|
|
137
155
|
/**
|
|
138
156
|
* Returns an iterable of values in the map
|
|
139
157
|
*/
|
|
140
|
-
values():
|
|
158
|
+
values(): MapIterator<V>;
|
|
141
159
|
}
|
|
142
160
|
|
|
143
161
|
interface ReadonlyMap<K, V> {
|
|
144
162
|
/** Returns an iterable of entries in the map. */
|
|
145
|
-
[Symbol.iterator]():
|
|
163
|
+
[Symbol.iterator](): MapIterator<[K, V]>;
|
|
146
164
|
|
|
147
165
|
/**
|
|
148
166
|
* Returns an iterable of key, value pairs for every entry in the map.
|
|
149
167
|
*/
|
|
150
|
-
entries():
|
|
168
|
+
entries(): MapIterator<[K, V]>;
|
|
151
169
|
|
|
152
170
|
/**
|
|
153
171
|
* Returns an iterable of keys in the map
|
|
154
172
|
*/
|
|
155
|
-
keys():
|
|
173
|
+
keys(): MapIterator<K>;
|
|
156
174
|
|
|
157
175
|
/**
|
|
158
176
|
* Returns an iterable of values in the map
|
|
159
177
|
*/
|
|
160
|
-
values():
|
|
178
|
+
values(): MapIterator<V>;
|
|
161
179
|
}
|
|
162
180
|
|
|
163
181
|
interface MapConstructor {
|
|
@@ -171,42 +189,46 @@ interface WeakMapConstructor {
|
|
|
171
189
|
new <K extends WeakKey, V>(iterable: Iterable<readonly [K, V]>): WeakMap<K, V>;
|
|
172
190
|
}
|
|
173
191
|
|
|
192
|
+
interface SetIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
|
|
193
|
+
[Symbol.iterator](): SetIterator<T>;
|
|
194
|
+
}
|
|
195
|
+
|
|
174
196
|
interface Set<T> {
|
|
175
197
|
/** Iterates over values in the set. */
|
|
176
|
-
[Symbol.iterator]():
|
|
198
|
+
[Symbol.iterator](): SetIterator<T>;
|
|
177
199
|
/**
|
|
178
200
|
* Returns an iterable of [v,v] pairs for every value `v` in the set.
|
|
179
201
|
*/
|
|
180
|
-
entries():
|
|
202
|
+
entries(): SetIterator<[T, T]>;
|
|
181
203
|
/**
|
|
182
204
|
* Despite its name, returns an iterable of the values in the set.
|
|
183
205
|
*/
|
|
184
|
-
keys():
|
|
206
|
+
keys(): SetIterator<T>;
|
|
185
207
|
|
|
186
208
|
/**
|
|
187
209
|
* Returns an iterable of values in the set.
|
|
188
210
|
*/
|
|
189
|
-
values():
|
|
211
|
+
values(): SetIterator<T>;
|
|
190
212
|
}
|
|
191
213
|
|
|
192
214
|
interface ReadonlySet<T> {
|
|
193
215
|
/** Iterates over values in the set. */
|
|
194
|
-
[Symbol.iterator]():
|
|
216
|
+
[Symbol.iterator](): SetIterator<T>;
|
|
195
217
|
|
|
196
218
|
/**
|
|
197
219
|
* Returns an iterable of [v,v] pairs for every value `v` in the set.
|
|
198
220
|
*/
|
|
199
|
-
entries():
|
|
221
|
+
entries(): SetIterator<[T, T]>;
|
|
200
222
|
|
|
201
223
|
/**
|
|
202
224
|
* Despite its name, returns an iterable of the values in the set.
|
|
203
225
|
*/
|
|
204
|
-
keys():
|
|
226
|
+
keys(): SetIterator<T>;
|
|
205
227
|
|
|
206
228
|
/**
|
|
207
229
|
* Returns an iterable of values in the set.
|
|
208
230
|
*/
|
|
209
|
-
values():
|
|
231
|
+
values(): SetIterator<T>;
|
|
210
232
|
}
|
|
211
233
|
|
|
212
234
|
interface SetConstructor {
|
|
@@ -239,25 +261,29 @@ interface PromiseConstructor {
|
|
|
239
261
|
race<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>;
|
|
240
262
|
}
|
|
241
263
|
|
|
264
|
+
interface StringIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
|
|
265
|
+
[Symbol.iterator](): StringIterator<T>;
|
|
266
|
+
}
|
|
267
|
+
|
|
242
268
|
interface String {
|
|
243
269
|
/** Iterator */
|
|
244
|
-
[Symbol.iterator]():
|
|
270
|
+
[Symbol.iterator](): StringIterator<string>;
|
|
245
271
|
}
|
|
246
272
|
|
|
247
273
|
interface Int8Array {
|
|
248
|
-
[Symbol.iterator]():
|
|
274
|
+
[Symbol.iterator](): ArrayIterator<number>;
|
|
249
275
|
/**
|
|
250
276
|
* Returns an array of key, value pairs for every entry in the array
|
|
251
277
|
*/
|
|
252
|
-
entries():
|
|
278
|
+
entries(): ArrayIterator<[number, number]>;
|
|
253
279
|
/**
|
|
254
280
|
* Returns an list of keys in the array
|
|
255
281
|
*/
|
|
256
|
-
keys():
|
|
282
|
+
keys(): ArrayIterator<number>;
|
|
257
283
|
/**
|
|
258
284
|
* Returns an list of values in the array
|
|
259
285
|
*/
|
|
260
|
-
values():
|
|
286
|
+
values(): ArrayIterator<number>;
|
|
261
287
|
}
|
|
262
288
|
|
|
263
289
|
interface Int8ArrayConstructor {
|
|
@@ -273,19 +299,19 @@ interface Int8ArrayConstructor {
|
|
|
273
299
|
}
|
|
274
300
|
|
|
275
301
|
interface Uint8Array {
|
|
276
|
-
[Symbol.iterator]():
|
|
302
|
+
[Symbol.iterator](): ArrayIterator<number>;
|
|
277
303
|
/**
|
|
278
304
|
* Returns an array of key, value pairs for every entry in the array
|
|
279
305
|
*/
|
|
280
|
-
entries():
|
|
306
|
+
entries(): ArrayIterator<[number, number]>;
|
|
281
307
|
/**
|
|
282
308
|
* Returns an list of keys in the array
|
|
283
309
|
*/
|
|
284
|
-
keys():
|
|
310
|
+
keys(): ArrayIterator<number>;
|
|
285
311
|
/**
|
|
286
312
|
* Returns an list of values in the array
|
|
287
313
|
*/
|
|
288
|
-
values():
|
|
314
|
+
values(): ArrayIterator<number>;
|
|
289
315
|
}
|
|
290
316
|
|
|
291
317
|
interface Uint8ArrayConstructor {
|
|
@@ -301,21 +327,21 @@ interface Uint8ArrayConstructor {
|
|
|
301
327
|
}
|
|
302
328
|
|
|
303
329
|
interface Uint8ClampedArray {
|
|
304
|
-
[Symbol.iterator]():
|
|
330
|
+
[Symbol.iterator](): ArrayIterator<number>;
|
|
305
331
|
/**
|
|
306
332
|
* Returns an array of key, value pairs for every entry in the array
|
|
307
333
|
*/
|
|
308
|
-
entries():
|
|
334
|
+
entries(): ArrayIterator<[number, number]>;
|
|
309
335
|
|
|
310
336
|
/**
|
|
311
337
|
* Returns an list of keys in the array
|
|
312
338
|
*/
|
|
313
|
-
keys():
|
|
339
|
+
keys(): ArrayIterator<number>;
|
|
314
340
|
|
|
315
341
|
/**
|
|
316
342
|
* Returns an list of values in the array
|
|
317
343
|
*/
|
|
318
|
-
values():
|
|
344
|
+
values(): ArrayIterator<number>;
|
|
319
345
|
}
|
|
320
346
|
|
|
321
347
|
interface Uint8ClampedArrayConstructor {
|
|
@@ -331,21 +357,21 @@ interface Uint8ClampedArrayConstructor {
|
|
|
331
357
|
}
|
|
332
358
|
|
|
333
359
|
interface Int16Array {
|
|
334
|
-
[Symbol.iterator]():
|
|
360
|
+
[Symbol.iterator](): ArrayIterator<number>;
|
|
335
361
|
/**
|
|
336
362
|
* Returns an array of key, value pairs for every entry in the array
|
|
337
363
|
*/
|
|
338
|
-
entries():
|
|
364
|
+
entries(): ArrayIterator<[number, number]>;
|
|
339
365
|
|
|
340
366
|
/**
|
|
341
367
|
* Returns an list of keys in the array
|
|
342
368
|
*/
|
|
343
|
-
keys():
|
|
369
|
+
keys(): ArrayIterator<number>;
|
|
344
370
|
|
|
345
371
|
/**
|
|
346
372
|
* Returns an list of values in the array
|
|
347
373
|
*/
|
|
348
|
-
values():
|
|
374
|
+
values(): ArrayIterator<number>;
|
|
349
375
|
}
|
|
350
376
|
|
|
351
377
|
interface Int16ArrayConstructor {
|
|
@@ -361,19 +387,19 @@ interface Int16ArrayConstructor {
|
|
|
361
387
|
}
|
|
362
388
|
|
|
363
389
|
interface Uint16Array {
|
|
364
|
-
[Symbol.iterator]():
|
|
390
|
+
[Symbol.iterator](): ArrayIterator<number>;
|
|
365
391
|
/**
|
|
366
392
|
* Returns an array of key, value pairs for every entry in the array
|
|
367
393
|
*/
|
|
368
|
-
entries():
|
|
394
|
+
entries(): ArrayIterator<[number, number]>;
|
|
369
395
|
/**
|
|
370
396
|
* Returns an list of keys in the array
|
|
371
397
|
*/
|
|
372
|
-
keys():
|
|
398
|
+
keys(): ArrayIterator<number>;
|
|
373
399
|
/**
|
|
374
400
|
* Returns an list of values in the array
|
|
375
401
|
*/
|
|
376
|
-
values():
|
|
402
|
+
values(): ArrayIterator<number>;
|
|
377
403
|
}
|
|
378
404
|
|
|
379
405
|
interface Uint16ArrayConstructor {
|
|
@@ -389,19 +415,19 @@ interface Uint16ArrayConstructor {
|
|
|
389
415
|
}
|
|
390
416
|
|
|
391
417
|
interface Int32Array {
|
|
392
|
-
[Symbol.iterator]():
|
|
418
|
+
[Symbol.iterator](): ArrayIterator<number>;
|
|
393
419
|
/**
|
|
394
420
|
* Returns an array of key, value pairs for every entry in the array
|
|
395
421
|
*/
|
|
396
|
-
entries():
|
|
422
|
+
entries(): ArrayIterator<[number, number]>;
|
|
397
423
|
/**
|
|
398
424
|
* Returns an list of keys in the array
|
|
399
425
|
*/
|
|
400
|
-
keys():
|
|
426
|
+
keys(): ArrayIterator<number>;
|
|
401
427
|
/**
|
|
402
428
|
* Returns an list of values in the array
|
|
403
429
|
*/
|
|
404
|
-
values():
|
|
430
|
+
values(): ArrayIterator<number>;
|
|
405
431
|
}
|
|
406
432
|
|
|
407
433
|
interface Int32ArrayConstructor {
|
|
@@ -417,19 +443,19 @@ interface Int32ArrayConstructor {
|
|
|
417
443
|
}
|
|
418
444
|
|
|
419
445
|
interface Uint32Array {
|
|
420
|
-
[Symbol.iterator]():
|
|
446
|
+
[Symbol.iterator](): ArrayIterator<number>;
|
|
421
447
|
/**
|
|
422
448
|
* Returns an array of key, value pairs for every entry in the array
|
|
423
449
|
*/
|
|
424
|
-
entries():
|
|
450
|
+
entries(): ArrayIterator<[number, number]>;
|
|
425
451
|
/**
|
|
426
452
|
* Returns an list of keys in the array
|
|
427
453
|
*/
|
|
428
|
-
keys():
|
|
454
|
+
keys(): ArrayIterator<number>;
|
|
429
455
|
/**
|
|
430
456
|
* Returns an list of values in the array
|
|
431
457
|
*/
|
|
432
|
-
values():
|
|
458
|
+
values(): ArrayIterator<number>;
|
|
433
459
|
}
|
|
434
460
|
|
|
435
461
|
interface Uint32ArrayConstructor {
|
|
@@ -445,19 +471,19 @@ interface Uint32ArrayConstructor {
|
|
|
445
471
|
}
|
|
446
472
|
|
|
447
473
|
interface Float32Array {
|
|
448
|
-
[Symbol.iterator]():
|
|
474
|
+
[Symbol.iterator](): ArrayIterator<number>;
|
|
449
475
|
/**
|
|
450
476
|
* Returns an array of key, value pairs for every entry in the array
|
|
451
477
|
*/
|
|
452
|
-
entries():
|
|
478
|
+
entries(): ArrayIterator<[number, number]>;
|
|
453
479
|
/**
|
|
454
480
|
* Returns an list of keys in the array
|
|
455
481
|
*/
|
|
456
|
-
keys():
|
|
482
|
+
keys(): ArrayIterator<number>;
|
|
457
483
|
/**
|
|
458
484
|
* Returns an list of values in the array
|
|
459
485
|
*/
|
|
460
|
-
values():
|
|
486
|
+
values(): ArrayIterator<number>;
|
|
461
487
|
}
|
|
462
488
|
|
|
463
489
|
interface Float32ArrayConstructor {
|
|
@@ -473,19 +499,19 @@ interface Float32ArrayConstructor {
|
|
|
473
499
|
}
|
|
474
500
|
|
|
475
501
|
interface Float64Array {
|
|
476
|
-
[Symbol.iterator]():
|
|
502
|
+
[Symbol.iterator](): ArrayIterator<number>;
|
|
477
503
|
/**
|
|
478
504
|
* Returns an array of key, value pairs for every entry in the array
|
|
479
505
|
*/
|
|
480
|
-
entries():
|
|
506
|
+
entries(): ArrayIterator<[number, number]>;
|
|
481
507
|
/**
|
|
482
508
|
* Returns an list of keys in the array
|
|
483
509
|
*/
|
|
484
|
-
keys():
|
|
510
|
+
keys(): ArrayIterator<number>;
|
|
485
511
|
/**
|
|
486
512
|
* Returns an list of values in the array
|
|
487
513
|
*/
|
|
488
|
-
values():
|
|
514
|
+
values(): ArrayIterator<number>;
|
|
489
515
|
}
|
|
490
516
|
|
|
491
517
|
interface Float64ArrayConstructor {
|
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
/// <reference lib="es2018.asynciterable" />
|
|
20
20
|
|
|
21
|
-
interface AsyncGenerator<T = unknown, TReturn = any, TNext = any> extends
|
|
21
|
+
interface AsyncGenerator<T = unknown, TReturn = any, TNext = any> extends AsyncIteratorObject<T, TReturn, TNext> {
|
|
22
22
|
// NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
|
|
23
23
|
next(...[value]: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;
|
|
24
24
|
return(value: TReturn | PromiseLike<TReturn>): Promise<IteratorResult<T, TReturn>>;
|
|
@@ -38,10 +38,16 @@ interface AsyncIterable<T, TReturn = any, TNext = any> {
|
|
|
38
38
|
[Symbol.asyncIterator](): AsyncIterator<T, TReturn, TNext>;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Describes a user-defined {@link AsyncIterator} that is also async iterable.
|
|
43
|
+
*/
|
|
41
44
|
interface AsyncIterableIterator<T, TReturn = any, TNext = any> extends AsyncIterator<T, TReturn, TNext> {
|
|
42
45
|
[Symbol.asyncIterator](): AsyncIterableIterator<T, TReturn, TNext>;
|
|
43
46
|
}
|
|
44
47
|
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Describes an {@link AsyncIterator} produced by the runtime that inherits from the intrinsic `AsyncIterator.prototype`.
|
|
50
|
+
*/
|
|
51
|
+
interface AsyncIteratorObject<T, TReturn = unknown, TNext = unknown> extends AsyncIterator<T, TReturn, TNext> {
|
|
52
|
+
[Symbol.asyncIterator](): AsyncIteratorObject<T, TReturn, TNext>;
|
|
47
53
|
}
|
|
@@ -171,7 +171,7 @@ interface BigInt64Array {
|
|
|
171
171
|
copyWithin(target: number, start: number, end?: number): this;
|
|
172
172
|
|
|
173
173
|
/** Yields index, value pairs for every entry in the array. */
|
|
174
|
-
entries():
|
|
174
|
+
entries(): ArrayIterator<[number, bigint]>;
|
|
175
175
|
|
|
176
176
|
/**
|
|
177
177
|
* Determines whether all the members of an array satisfy the specified test.
|
|
@@ -256,7 +256,7 @@ interface BigInt64Array {
|
|
|
256
256
|
join(separator?: string): string;
|
|
257
257
|
|
|
258
258
|
/** Yields each index in the array. */
|
|
259
|
-
keys():
|
|
259
|
+
keys(): ArrayIterator<number>;
|
|
260
260
|
|
|
261
261
|
/**
|
|
262
262
|
* Returns the index of the last occurrence of a value in an array.
|
|
@@ -378,9 +378,9 @@ interface BigInt64Array {
|
|
|
378
378
|
valueOf(): BigInt64Array;
|
|
379
379
|
|
|
380
380
|
/** Yields each value in the array. */
|
|
381
|
-
values():
|
|
381
|
+
values(): ArrayIterator<bigint>;
|
|
382
382
|
|
|
383
|
-
[Symbol.iterator]():
|
|
383
|
+
[Symbol.iterator](): ArrayIterator<bigint>;
|
|
384
384
|
|
|
385
385
|
readonly [Symbol.toStringTag]: "BigInt64Array";
|
|
386
386
|
|
|
@@ -443,7 +443,7 @@ interface BigUint64Array {
|
|
|
443
443
|
copyWithin(target: number, start: number, end?: number): this;
|
|
444
444
|
|
|
445
445
|
/** Yields index, value pairs for every entry in the array. */
|
|
446
|
-
entries():
|
|
446
|
+
entries(): ArrayIterator<[number, bigint]>;
|
|
447
447
|
|
|
448
448
|
/**
|
|
449
449
|
* Determines whether all the members of an array satisfy the specified test.
|
|
@@ -528,7 +528,7 @@ interface BigUint64Array {
|
|
|
528
528
|
join(separator?: string): string;
|
|
529
529
|
|
|
530
530
|
/** Yields each index in the array. */
|
|
531
|
-
keys():
|
|
531
|
+
keys(): ArrayIterator<number>;
|
|
532
532
|
|
|
533
533
|
/**
|
|
534
534
|
* Returns the index of the last occurrence of a value in an array.
|
|
@@ -650,9 +650,9 @@ interface BigUint64Array {
|
|
|
650
650
|
valueOf(): BigUint64Array;
|
|
651
651
|
|
|
652
652
|
/** Yields each value in the array. */
|
|
653
|
-
values():
|
|
653
|
+
values(): ArrayIterator<bigint>;
|
|
654
654
|
|
|
655
|
-
[Symbol.iterator]():
|
|
655
|
+
[Symbol.iterator](): ArrayIterator<bigint>;
|
|
656
656
|
|
|
657
657
|
readonly [Symbol.toStringTag]: "BigUint64Array";
|
|
658
658
|
|
|
@@ -16,7 +16,7 @@ and limitations under the License.
|
|
|
16
16
|
|
|
17
17
|
/// <reference no-default-lib="true"/>
|
|
18
18
|
|
|
19
|
-
/// <reference lib="
|
|
19
|
+
/// <reference lib="es2020.symbol.wellknown" />
|
|
20
20
|
|
|
21
21
|
interface String {
|
|
22
22
|
/**
|
|
@@ -24,7 +24,7 @@ interface String {
|
|
|
24
24
|
* containing the results of that search.
|
|
25
25
|
* @param regexp A variable name or string literal containing the regular expression pattern and flags.
|
|
26
26
|
*/
|
|
27
|
-
matchAll(regexp: RegExp):
|
|
27
|
+
matchAll(regexp: RegExp): RegExpStringIterator<RegExpExecArray>;
|
|
28
28
|
|
|
29
29
|
/** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */
|
|
30
30
|
toLocaleLowerCase(locales?: Intl.LocalesArgument): string;
|
|
@@ -27,11 +27,15 @@ interface SymbolConstructor {
|
|
|
27
27
|
readonly matchAll: unique symbol;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
interface RegExpStringIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
|
|
31
|
+
[Symbol.iterator](): RegExpStringIterator<T>;
|
|
32
|
+
}
|
|
33
|
+
|
|
30
34
|
interface RegExp {
|
|
31
35
|
/**
|
|
32
36
|
* Matches a string with this regular expression, and returns an iterable of matches
|
|
33
37
|
* containing the results of that search.
|
|
34
38
|
* @param string A string to search within.
|
|
35
39
|
*/
|
|
36
|
-
[Symbol.matchAll](str: string):
|
|
40
|
+
[Symbol.matchAll](str: string): RegExpStringIterator<RegExpMatchArray>;
|
|
37
41
|
}
|
package/lib/lib.es2022.intl.d.ts
CHANGED
|
@@ -46,6 +46,10 @@ declare namespace Intl {
|
|
|
46
46
|
granularity: "grapheme" | "word" | "sentence";
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
interface SegmentIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
|
|
50
|
+
[Symbol.iterator](): SegmentIterator<T>;
|
|
51
|
+
}
|
|
52
|
+
|
|
49
53
|
interface Segments {
|
|
50
54
|
/**
|
|
51
55
|
* Returns an object describing the segment in the original string that includes the code unit at a specified index.
|
|
@@ -55,7 +59,7 @@ declare namespace Intl {
|
|
|
55
59
|
containing(codeUnitIndex?: number): SegmentData;
|
|
56
60
|
|
|
57
61
|
/** Returns an iterator to iterate over the segments. */
|
|
58
|
-
[Symbol.iterator]():
|
|
62
|
+
[Symbol.iterator](): SegmentIterator<SegmentData>;
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
interface SegmentData {
|
|
@@ -25,59 +25,59 @@ and limitations under the License.
|
|
|
25
25
|
export {};
|
|
26
26
|
|
|
27
27
|
// Abstract type that allows us to mark `next` as `abstract`
|
|
28
|
-
declare abstract class Iterator<T> { // eslint-disable-line @typescript-eslint/no-unsafe-declaration-merging
|
|
29
|
-
abstract next(value?:
|
|
28
|
+
declare abstract class Iterator<T, TResult = undefined, TNext = unknown> { // eslint-disable-line @typescript-eslint/no-unsafe-declaration-merging
|
|
29
|
+
abstract next(value?: TNext): IteratorResult<T, TResult>;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
// Merge all members of `
|
|
33
|
-
interface Iterator<T> extends globalThis.
|
|
32
|
+
// Merge all members of `IteratorObject<T>` into `Iterator<T>`
|
|
33
|
+
interface Iterator<T, TResult, TNext> extends globalThis.IteratorObject<T, TResult, TNext> {}
|
|
34
34
|
|
|
35
35
|
// Capture the `Iterator` constructor in a type we can use in the `extends` clause of `IteratorConstructor`.
|
|
36
|
-
type
|
|
36
|
+
type IteratorObjectConstructor = typeof Iterator;
|
|
37
37
|
|
|
38
38
|
declare global {
|
|
39
|
-
// Global `
|
|
40
|
-
interface
|
|
39
|
+
// Global `IteratorObject<T, TReturn, TNext>` interface that can be augmented by polyfills
|
|
40
|
+
interface IteratorObject<T, TReturn, TNext> {
|
|
41
41
|
/**
|
|
42
42
|
* Returns this iterator.
|
|
43
43
|
*/
|
|
44
|
-
[Symbol.iterator]():
|
|
44
|
+
[Symbol.iterator](): IteratorObject<T, TReturn, TNext>;
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* Creates an iterator whose values are the result of applying the callback to the values from this iterator.
|
|
48
48
|
* @param callbackfn A function that accepts up to two arguments to be used to transform values from the underlying iterator.
|
|
49
49
|
*/
|
|
50
|
-
map<U>(callbackfn: (value: T, index: number) => U):
|
|
50
|
+
map<U>(callbackfn: (value: T, index: number) => U): IteratorObject<U, undefined, unknown>;
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* Creates an iterator whose values are those from this iterator for which the provided predicate returns true.
|
|
54
54
|
* @param predicate A function that accepts up to two arguments to be used to test values from the underlying iterator.
|
|
55
55
|
*/
|
|
56
|
-
filter<S extends T>(predicate: (value: T, index: number) => value is S):
|
|
56
|
+
filter<S extends T>(predicate: (value: T, index: number) => value is S): IteratorObject<S, undefined, unknown>;
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
59
|
* Creates an iterator whose values are those from this iterator for which the provided predicate returns true.
|
|
60
60
|
* @param predicate A function that accepts up to two arguments to be used to test values from the underlying iterator.
|
|
61
61
|
*/
|
|
62
|
-
filter(predicate: (value: T, index: number) => unknown):
|
|
62
|
+
filter(predicate: (value: T, index: number) => unknown): IteratorObject<T, undefined, unknown>;
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* Creates an iterator whose values are the values from this iterator, stopping once the provided limit is reached.
|
|
66
66
|
* @param limit The maximum number of values to yield.
|
|
67
67
|
*/
|
|
68
|
-
take(limit: number):
|
|
68
|
+
take(limit: number): IteratorObject<T, undefined, unknown>;
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
71
|
* Creates an iterator whose values are the values from this iterator after skipping the provided count.
|
|
72
72
|
* @param count The number of values to drop.
|
|
73
73
|
*/
|
|
74
|
-
drop(count: number):
|
|
74
|
+
drop(count: number): IteratorObject<T, undefined, unknown>;
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* Creates an iterator whose values are the result of applying the callback to the values from this iterator and then flattening the resulting iterators or iterables.
|
|
78
78
|
* @param callback A function that accepts up to two arguments to be used to transform values from the underlying iterator into new iterators or iterables to be flattened into the result.
|
|
79
79
|
*/
|
|
80
|
-
flatMap<U>(callback: (value: T, index: number) => Iterator<U, unknown, undefined> | Iterable<U, unknown, undefined>):
|
|
80
|
+
flatMap<U>(callback: (value: T, index: number) => Iterator<U, unknown, undefined> | Iterable<U, unknown, undefined>): IteratorObject<U, undefined, unknown>;
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
83
|
* Calls the specified callback function for all the elements in this iterator. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
|
|
@@ -135,13 +135,13 @@ declare global {
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
// Global `IteratorConstructor` interface that can be augmented by polyfills
|
|
138
|
-
interface IteratorConstructor extends
|
|
138
|
+
interface IteratorConstructor extends IteratorObjectConstructor {
|
|
139
139
|
/**
|
|
140
140
|
* Creates a native iterator from an iterator or iterable object.
|
|
141
141
|
* Returns its input if the input already inherits from the built-in Iterator class.
|
|
142
142
|
* @param value An iterator or iterable object to convert a native iterator.
|
|
143
143
|
*/
|
|
144
|
-
from<T>(value: Iterator<T, unknown, undefined> | Iterable<T, unknown, undefined>):
|
|
144
|
+
from<T>(value: Iterator<T, unknown, undefined> | Iterable<T, unknown, undefined>): IteratorObject<T, undefined, unknown>;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
var Iterator: IteratorConstructor;
|