Skip to content

Commit e356072

Browse files
authored
feat: support TypeScript 5.8 (#69)
* chore: upgrade TypeScript to 5.8.2 * chore: commit changes from TypeScript 5.8 * fix: apply better changes to Float16Array * docs: build diff * fix: fix ViewTransitionTypeSet
1 parent d856f09 commit e356072

25 files changed

+2679
-607
lines changed

TypeScript

Submodule TypeScript updated 1357 files

build/util/alias.ts

+27-10
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,37 @@ const es2020TypedBigIntArrays = ["BigInt64Array", "BigUint64Array"];
2727
export const alias = new Map([
2828
[
2929
"TypedNumberArray",
30-
es5TypedArrays.map((name) => ({
31-
file: "lib.es5.d.ts",
32-
replacement: new Map([["TypedNumberArray", name]]),
33-
})),
30+
es5TypedArrays
31+
.map((name) => ({
32+
file: "lib.es5.d.ts",
33+
replacement: new Map([["TypedNumberArray", name]]),
34+
}))
35+
.concat([
36+
{
37+
file: "lib.esnext.float16.d.ts",
38+
replacement: new Map([["TypedNumberArray", "Float16Array"]]),
39+
},
40+
]),
3441
],
3542
[
3643
"TypedNumberArrayConstructor",
37-
es5TypedArrays.map((name) => ({
38-
file: "lib.es5.d.ts",
39-
replacement: new Map([
40-
["TypedNumberArray", name],
41-
["TypedNumberArrayConstructor", `${name}Constructor`],
44+
es5TypedArrays
45+
.map((name) => ({
46+
file: "lib.es5.d.ts",
47+
replacement: new Map([
48+
["TypedNumberArray", name],
49+
["TypedNumberArrayConstructor", `${name}Constructor`],
50+
]),
51+
}))
52+
.concat([
53+
{
54+
file: "lib.esnext.float16.d.ts",
55+
replacement: new Map([
56+
["TypedNumberArray", "Float16Array"],
57+
["TypedNumberArrayConstructor", "Float16ArrayConstructor"],
58+
]),
59+
},
4260
]),
43-
})),
4461
],
4562
[
4663
"TypedNumberArrayConstructorIter",

docs/diff.md

+1
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ The following files are improved in better-typescript-lib:
2424
- [es2021.promise.d.ts](./diff/es2021.promise.d.ts.md)
2525
- [es2022.object.d.ts](./diff/es2022.object.d.ts.md)
2626
- [esnext.disposable.d.ts](./diff/esnext.disposable.d.ts.md)
27+
- [esnext.float16.d.ts](./diff/esnext.float16.d.ts.md)

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

+37-17
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-
@@ -3293,11 +3293,16 @@
8+
@@ -3356,11 +3356,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-
@@ -3726,9 +3731,9 @@
28+
@@ -3789,9 +3794,9 @@
2929
bytes(): Promise<Uint8Array>;
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-
@@ -6927,11 +6932,11 @@
39+
@@ -7044,11 +7049,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-
@@ -8375,9 +8380,9 @@
54+
@@ -8530,9 +8535,9 @@
5555
/**
5656
* Returns a reference to the first object with the specified value of the ID attribute.
5757
* @param elementId String that specifies the ID value.
@@ -62,7 +62,7 @@ Index: dom.generated.d.ts
6262
* Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
6363
*
6464
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/getElementsByClassName)
65-
@@ -8563,9 +8568,9 @@
65+
@@ -8719,9 +8724,9 @@
6666
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DocumentFragment)
6767
*/
6868
interface DocumentFragment extends Node, NonElementParentNode, ParentNode {
@@ -73,7 +73,7 @@ Index: dom.generated.d.ts
7373

7474
declare var DocumentFragment: {
7575
prototype: DocumentFragment;
76-
@@ -9378,11 +9383,11 @@
76+
@@ -9542,11 +9547,11 @@
7777
};
7878

7979
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventCounts) */
@@ -88,7 +88,7 @@ Index: dom.generated.d.ts
8888
}
8989

9090
declare var EventCounts: {
91-
@@ -9914,11 +9919,16 @@
91+
@@ -10078,11 +10083,16 @@
9292
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSet/check) */
9393
check(font: string, text?: string): boolean;
9494
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSet/load) */
@@ -108,7 +108,7 @@ Index: dom.generated.d.ts
108108
addEventListener<K extends keyof FontFaceSetEventMap>(
109109
type: K,
110110
listener: (this: FontFaceSet, ev: FontFaceSetEventMap[K]) => any,
111-
@@ -16210,15 +16220,16 @@
111+
@@ -16529,15 +16539,16 @@
112112
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Highlight/priority) */
113113
priority: number;
114114
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Highlight/type) */
@@ -128,7 +128,7 @@ Index: dom.generated.d.ts
128128
}
129129

130130
declare var Highlight: {
131-
@@ -16227,15 +16238,16 @@
131+
@@ -16546,15 +16557,16 @@
132132
};
133133

134134
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HighlightRegistry) */
@@ -148,7 +148,7 @@ Index: dom.generated.d.ts
148148
}
149149

150150
declare var HighlightRegistry: {
151-
@@ -17663,11 +17675,16 @@
151+
@@ -18046,11 +18058,16 @@
152152
*
153153
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MIDIInputMap)
154154
*/
@@ -168,7 +168,7 @@ Index: dom.generated.d.ts
168168
}
169169

170170
declare var MIDIInputMap: {
171-
@@ -17730,11 +17747,16 @@
171+
@@ -18113,11 +18130,16 @@
172172
*
173173
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MIDIOutputMap)
174174
*/
@@ -188,7 +188,7 @@ Index: dom.generated.d.ts
188188
}
189189

190190
declare var MIDIOutputMap: {
191-
@@ -19528,9 +19550,9 @@
191+
@@ -20007,9 +20029,9 @@
192192
new (): NodeList;
193193
};
194194

@@ -199,7 +199,7 @@ Index: dom.generated.d.ts
199199
* Performs the specified action for each node in an list.
200200
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.
201201
* @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.
202-
@@ -22073,11 +22095,11 @@
202+
@@ -22578,11 +22600,11 @@
203203
};
204204

205205
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/RTCStatsReport) */
@@ -214,14 +214,34 @@ Index: dom.generated.d.ts
214214
}
215215

216216
declare var RTCStatsReport: {
217-
@@ -34926,13 +34948,16 @@
217+
@@ -29203,15 +29225,11 @@
218+
new (): ViewTransition;
219+
};
220+
221+
interface ViewTransitionTypeSet {
222+
- forEach(
223+
- callbackfn: (
224+
- value: string,
225+
- key: string,
226+
- parent: ViewTransitionTypeSet,
227+
- ) => void,
228+
- thisArg?: any,
229+
+ forEach<This = undefined>(
230+
+ callbackfn: (this: This, value: string, key: string, parent: this) => void,
231+
+ thisArg?: This,
232+
): void;
233+
}
234+
235+
declare var ViewTransitionTypeSet: {
236+
@@ -35597,13 +35615,16 @@
218237
handler: TimerHandler,
219238
timeout?: number,
220239
...arguments: any[]
221240
): number;
222-
+
223-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/structuredClone) */
241+
-/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/structuredClone) */
224242
-declare function structuredClone<T = any>(
243+
+
244+
+/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/structuredClone) */
225245
+declare function structuredClone<
226246
+ const T extends BetterTypeScriptLibInternals.StructuredClone.Constraint<T>,
227247
+>(
@@ -233,7 +253,7 @@ Index: dom.generated.d.ts
233253
declare var sessionStorage: Storage;
234254
declare function addEventListener<K extends keyof WindowEventMap>(
235255
type: K,
236-
@@ -35607,4 +35632,125 @@
256+
@@ -36287,4 +36308,125 @@
237257
| "blob"
238258
| "document"
239259
| "json"

0 commit comments

Comments
 (0)