Skip to content

Commit 5220515

Browse files
authored
feat: upgrade to TS 5.6 (#51)
* chore: upgrade TypeScript to 5.6.2 * fix: improve TS 5.6 types * docs: commit TS 5.6 diff * chore: update package-lock.json
1 parent 1c07b23 commit 5220515

37 files changed

+1152
-1308
lines changed

TypeScript

Submodule TypeScript updated 4293 files

docs/diff/dom.generated.d.ts.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Index: dom.generated.d.ts
55
===================================================================
66
--- dom.generated.d.ts
77
+++ dom.generated.d.ts
8-
@@ -2969,11 +2969,16 @@
8+
@@ -2972,11 +2972,16 @@
99
};
1010

1111
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParamMap) */
@@ -25,7 +25,7 @@ Index: dom.generated.d.ts
2525
}
2626

2727
declare var AudioParamMap: {
28-
@@ -3394,9 +3399,9 @@
28+
@@ -3401,9 +3406,9 @@
2929
blob(): Promise<Blob>;
3030
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */
3131
formData(): Promise<FormData>;
@@ -36,7 +36,7 @@ Index: dom.generated.d.ts
3636
text(): Promise<string>;
3737
}
3838

39-
@@ -6530,11 +6535,11 @@
39+
@@ -6551,11 +6556,11 @@
4040
};
4141

4242
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomStateSet) */
@@ -51,7 +51,7 @@ Index: dom.generated.d.ts
5151
}
5252

5353
declare var CustomStateSet: {
54-
@@ -8960,11 +8965,11 @@
54+
@@ -8926,11 +8931,11 @@
5555
};
5656

5757
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventCounts) */
@@ -66,7 +66,7 @@ Index: dom.generated.d.ts
6666
}
6767

6868
declare var EventCounts: {
69-
@@ -9508,11 +9513,16 @@
69+
@@ -9462,11 +9467,16 @@
7070
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSet/check) */
7171
check(font: string, text?: string): boolean;
7272
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSet/load) */
@@ -86,7 +86,7 @@ Index: dom.generated.d.ts
8686
addEventListener<K extends keyof FontFaceSetEventMap>(
8787
type: K,
8888
listener: (this: FontFaceSet, ev: FontFaceSetEventMap[K]) => any,
89-
@@ -15863,15 +15873,16 @@
89+
@@ -15358,15 +15368,16 @@
9090
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Highlight/priority) */
9191
priority: number;
9292
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Highlight/type) */
@@ -106,7 +106,7 @@ Index: dom.generated.d.ts
106106
}
107107

108108
declare var Highlight: {
109-
@@ -15880,15 +15891,16 @@
109+
@@ -15375,15 +15386,16 @@
110110
};
111111

112112
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HighlightRegistry) */
@@ -126,7 +126,7 @@ Index: dom.generated.d.ts
126126
}
127127

128128
declare var HighlightRegistry: {
129-
@@ -17314,11 +17326,16 @@
129+
@@ -16809,11 +16821,16 @@
130130
*
131131
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MIDIInputMap)
132132
*/
@@ -146,7 +146,7 @@ Index: dom.generated.d.ts
146146
}
147147

148148
declare var MIDIInputMap: {
149-
@@ -17381,11 +17398,16 @@
149+
@@ -16876,11 +16893,16 @@
150150
*
151151
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MIDIOutputMap)
152152
*/
@@ -166,7 +166,7 @@ Index: dom.generated.d.ts
166166
}
167167

168168
declare var MIDIOutputMap: {
169-
@@ -19260,9 +19282,9 @@
169+
@@ -18739,9 +18761,9 @@
170170
new (): NodeList;
171171
};
172172

@@ -177,7 +177,7 @@ Index: dom.generated.d.ts
177177
* Performs the specified action for each node in an list.
178178
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.
179179
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
180-
@@ -21702,11 +21724,11 @@
180+
@@ -21159,11 +21181,11 @@
181181
};
182182

183183
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/RTCStatsReport) */
@@ -192,7 +192,7 @@ Index: dom.generated.d.ts
192192
}
193193

194194
declare var RTCStatsReport: {
195-
@@ -34477,13 +34499,16 @@
195+
@@ -33973,13 +33995,16 @@
196196
handler: TimerHandler,
197197
timeout?: number,
198198
...arguments: any[]
@@ -211,7 +211,7 @@ Index: dom.generated.d.ts
211211
declare var sessionStorage: Storage;
212212
declare function addEventListener<K extends keyof WindowEventMap>(
213213
type: K,
214-
@@ -35141,4 +35166,125 @@
214+
@@ -34638,4 +34663,125 @@
215215
| "blob"
216216
| "document"
217217
| "json"

docs/diff/es2015.generator.d.ts.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ Index: es2015.generator.d.ts
88
@@ -1,7 +1,7 @@
99
/// <reference lib="es2015.iterable" />
1010

11-
-interface Generator<T = unknown, TReturn = any, TNext = unknown>
11+
-interface Generator<T = unknown, TReturn = any, TNext = any>
1212
+interface Generator<T = unknown, TReturn = unknown, TNext = unknown>
13-
extends Iterator<T, TReturn, TNext> {
13+
extends IteratorObject<T, TReturn, TNext> {
1414
// NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
15-
next(...args: [] | [TNext]): IteratorResult<T, TReturn>;
15+
next(...[value]: [] | [TNext]): IteratorResult<T, TReturn>;
1616
return(value: TReturn): IteratorResult<T, TReturn>;
1717

1818
```

docs/diff/es2015.iterable.d.ts.md

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,35 @@ Index: es2015.iterable.d.ts
55
===================================================================
66
--- es2015.iterable.d.ts
77
+++ es2015.iterable.d.ts
8-
@@ -20,10 +20,9 @@
8+
@@ -20,24 +20,23 @@
99

1010
type IteratorResult<T, TReturn = any> =
1111
| IteratorYieldResult<T>
1212
| IteratorReturnResult<TReturn>;
1313
-
14-
-interface Iterator<T, TReturn = any, TNext = undefined> {
14+
-interface Iterator<T, TReturn = any, TNext = any> {
1515
+interface Iterator<T, TReturn = unknown, TNext = undefined> {
1616
// NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
17-
next(...args: [] | [TNext]): IteratorResult<T, TReturn>;
17+
next(...[value]: [] | [TNext]): IteratorResult<T, TReturn>;
1818
return?(value?: TReturn): IteratorResult<T, TReturn>;
1919
throw?(e?: any): IteratorResult<T, TReturn>;
20-
@@ -32,9 +31,9 @@
21-
interface Iterable<T> {
22-
[Symbol.iterator](): Iterator<T>;
2320
}
2421

25-
-interface IterableIterator<T> extends Iterator<T> {
26-
+interface IterableIterator<T> extends Iterator<T, undefined, void> {
27-
[Symbol.iterator](): IterableIterator<T>;
22+
-interface Iterable<T, TReturn = any, TNext = any> {
23+
+interface Iterable<T, TReturn = unknown, TNext = undefined> {
24+
[Symbol.iterator](): Iterator<T, TReturn, TNext>;
2825
}
2926

30-
interface Array<T> {
31-
@@ -69,12 +68,12 @@
27+
/**
28+
* Describes a user-defined {@link Iterator} that is also iterable.
29+
*/
30+
-interface IterableIterator<T, TReturn = any, TNext = any>
31+
+interface IterableIterator<T, TReturn = undefined, TNext = void>
32+
extends Iterator<T, TReturn, TNext> {
33+
[Symbol.iterator](): IterableIterator<T, TReturn, TNext>;
34+
}
35+
36+
@@ -92,12 +91,12 @@
3237
* @param iterable An iterable object to convert to an array.
3338
* @param mapfn A mapping function to call on every element of the array.
3439
* @param thisArg Value of 'this' used to invoke the mapfn.
@@ -44,19 +49,19 @@ Index: es2015.iterable.d.ts
4449
}
4550

4651
interface ReadonlyArray<T> {
47-
@@ -98,9 +97,9 @@
52+
@@ -121,9 +120,9 @@
4853
}
4954

5055
interface IArguments {
5156
/** Iterator */
52-
- [Symbol.iterator](): IterableIterator<any>;
53-
+ [Symbol.iterator](): IterableIterator<unknown>;
57+
- [Symbol.iterator](): ArrayIterator<any>;
58+
+ [Symbol.iterator](): ArrayIterator<unknown>;
5459
}
5560

56-
interface Map<K, V> {
57-
/** Returns an iterable of entries in the map. */
58-
@@ -142,9 +141,8 @@
59-
values(): IterableIterator<V>;
61+
interface MapIterator<T>
62+
extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
63+
@@ -170,9 +169,8 @@
64+
values(): MapIterator<V>;
6065
}
6166

6267
interface MapConstructor {
@@ -65,7 +70,7 @@ Index: es2015.iterable.d.ts
6570
}
6671

6772
interface WeakMap<K extends WeakKey, V> {}
68-
@@ -211,17 +209,17 @@
73+
@@ -244,17 +242,17 @@
6974
* resolve, or rejected when any Promise is rejected.
7075
* @param values An iterable of Promises.
7176
* @returns A new Promise.
@@ -83,9 +88,9 @@ Index: es2015.iterable.d.ts
8388
+ race<T>(values: Iterable<T>): Promise<Awaited<T>>;
8489
}
8590

86-
interface String {
87-
/** Iterator */
88-
@@ -245,19 +243,23 @@
91+
interface StringIterator<T>
92+
extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
93+
@@ -283,19 +281,23 @@
8994
}
9095

9196
interface Int8ArrayConstructor {
@@ -116,7 +121,7 @@ Index: es2015.iterable.d.ts
116121
}
117122

118123
interface Uint8Array {
119-
@@ -277,19 +279,23 @@
124+
@@ -315,19 +317,23 @@
120125
}
121126

122127
interface Uint8ArrayConstructor {
@@ -147,7 +152,7 @@ Index: es2015.iterable.d.ts
147152
}
148153

149154
interface Uint8ClampedArray {
150-
@@ -311,19 +317,23 @@
155+
@@ -349,19 +355,23 @@
151156
}
152157

153158
interface Uint8ClampedArrayConstructor {
@@ -178,7 +183,7 @@ Index: es2015.iterable.d.ts
178183
}
179184

180185
interface Int16Array {
181-
@@ -345,19 +355,23 @@
186+
@@ -383,19 +393,23 @@
182187
}
183188

184189
interface Int16ArrayConstructor {
@@ -209,7 +214,7 @@ Index: es2015.iterable.d.ts
209214
}
210215

211216
interface Uint16Array {
212-
@@ -377,19 +391,23 @@
217+
@@ -415,19 +429,23 @@
213218
}
214219

215220
interface Uint16ArrayConstructor {
@@ -240,7 +245,7 @@ Index: es2015.iterable.d.ts
240245
}
241246

242247
interface Int32Array {
243-
@@ -409,19 +427,23 @@
248+
@@ -447,19 +465,23 @@
244249
}
245250

246251
interface Int32ArrayConstructor {
@@ -271,7 +276,7 @@ Index: es2015.iterable.d.ts
271276
}
272277

273278
interface Uint32Array {
274-
@@ -441,19 +463,23 @@
279+
@@ -479,19 +501,23 @@
275280
}
276281

277282
interface Uint32ArrayConstructor {
@@ -302,7 +307,7 @@ Index: es2015.iterable.d.ts
302307
}
303308

304309
interface Float32Array {
305-
@@ -473,19 +499,23 @@
310+
@@ -511,19 +537,23 @@
306311
}
307312

308313
interface Float32ArrayConstructor {
@@ -333,7 +338,7 @@ Index: es2015.iterable.d.ts
333338
}
334339

335340
interface Float64Array {
336-
@@ -505,17 +535,21 @@
341+
@@ -543,17 +573,21 @@
337342
}
338343

339344
interface Float64ArrayConstructor {

docs/diff/es2017.object.d.ts.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,43 +7,43 @@ Index: es2017.object.d.ts
77
+++ es2017.object.d.ts
88
@@ -2,34 +2,48 @@
99
/**
10-
* Returns an array of values of the enumerable properties of an object
10+
* Returns an array of values of the enumerable own properties of an object
1111
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
1212
*/
1313
- values<T>(o: { [s: string]: T } | ArrayLike<T>): T[];
1414
-
1515
+ values<T>(o: ArrayLike<T>): T[];
1616
/**
17-
* Returns an array of values of the enumerable properties of an object
17+
* Returns an array of values of the enumerable own properties of an object
1818
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
1919
*/
2020
- values(o: {}): any[];
2121
+ values<K extends PropertyKey, V>(
2222
+ o: Record<K, V>,
2323
+ ): (string extends K ? V : number extends K ? V : unknown)[];
2424
+ /**
25-
+ * Returns an array of values of the enumerable properties of an object
25+
+ * Returns an array of values of the enumerable own properties of an object
2626
+ * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
2727
+ */
2828
+ values(o: {}): unknown[];
2929

3030
/**
31-
* Returns an array of key/values of the enumerable properties of an object
31+
* Returns an array of key/values of the enumerable own properties of an object
3232
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
3333
*/
3434
- entries<T>(o: { [s: string]: T } | ArrayLike<T>): [string, T][];
3535
-
3636
+ entries<T>(o: ArrayLike<T>): [string, T][];
3737
/**
38-
* Returns an array of key/values of the enumerable properties of an object
38+
* Returns an array of key/values of the enumerable own properties of an object
3939
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
4040
*/
4141
- entries(o: {}): [string, any][];
4242
+ entries<K extends PropertyKey, V>(
4343
+ o: Record<K, V>,
4444
+ ): [string, string extends K ? V : number extends K ? V : unknown][];
4545
+ /**
46-
+ * Returns an array of key/values of the enumerable properties of an object
46+
+ * Returns an array of key/values of the enumerable own properties of an object
4747
+ * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
4848
+ */
4949
+ entries(o: {}): [string, unknown][];

docs/diff/es2018.asyncgenerator.d.ts.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ Index: es2018.asyncgenerator.d.ts
88
@@ -1,7 +1,5 @@
99
-/// <reference lib="es2018.asynciterable" />
1010
-
11-
-interface AsyncGenerator<T = unknown, TReturn = any, TNext = unknown>
11+
-interface AsyncGenerator<T = unknown, TReturn = any, TNext = any>
1212
+interface AsyncGenerator<T = unknown, TReturn = unknown, TNext = unknown>
13-
extends AsyncIterator<T, TReturn, TNext> {
13+
extends AsyncIteratorObject<T, TReturn, TNext> {
1414
// NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
15-
next(...args: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;
15+
next(...[value]: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;
1616
return(
1717

1818
```

0 commit comments

Comments
 (0)