Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade TypeScript to 5.4 #39

Merged
merged 3 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TypeScript
Submodule TypeScript updated 3289 files
72 changes: 57 additions & 15 deletions docs/diff/dom.generated.d.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Index: dom.generated.d.ts
===================================================================
--- dom.generated.d.ts
+++ dom.generated.d.ts
@@ -2943,11 +2943,16 @@
@@ -2944,11 +2944,16 @@
};

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

declare var AudioParamMap: {
@@ -3364,9 +3369,9 @@
@@ -3369,9 +3374,9 @@
blob(): Promise<Blob>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */
formData(): Promise<FormData>;
Expand All @@ -36,7 +36,7 @@ Index: dom.generated.d.ts
text(): Promise<string>;
}

@@ -8828,11 +8833,11 @@
@@ -8872,11 +8877,11 @@
};

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

declare var EventCounts: {
@@ -9374,11 +9379,16 @@
@@ -9420,11 +9425,16 @@
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSet/check) */
check(font: string, text?: string): boolean;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSet/load) */
Expand All @@ -71,7 +71,47 @@ Index: dom.generated.d.ts
addEventListener<K extends keyof FontFaceSetEventMap>(
type: K,
listener: (this: FontFaceSet, ev: FontFaceSetEventMap[K]) => any,
@@ -17020,11 +17030,16 @@
@@ -15711,15 +15721,16 @@
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Highlight/priority) */
priority: number;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Highlight/type) */
type: HighlightType;
- forEach(
+ forEach<This = undefined>(
callbackfn: (
+ this: This,
value: AbstractRange,
key: AbstractRange,
- parent: Highlight,
+ parent: this,
) => void,
- thisArg?: any,
+ thisArg?: This,
): void;
}

declare var Highlight: {
@@ -15728,15 +15739,16 @@
};

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HighlightRegistry) */
interface HighlightRegistry {
- forEach(
+ forEach<This = undefined>(
callbackfn: (
+ this: This,
value: Highlight,
key: string,
- parent: HighlightRegistry,
+ parent: this,
) => void,
- thisArg?: any,
+ thisArg?: This,
): void;
}

declare var HighlightRegistry: {
@@ -17139,11 +17151,16 @@
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MIDIInputMap)
*/
Expand All @@ -91,7 +131,7 @@ Index: dom.generated.d.ts
}

declare var MIDIInputMap: {
@@ -17087,11 +17102,16 @@
@@ -17206,11 +17223,16 @@
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MIDIOutputMap)
*/
Expand All @@ -111,7 +151,7 @@ Index: dom.generated.d.ts
}

declare var MIDIOutputMap: {
@@ -21372,11 +21392,11 @@
@@ -21527,11 +21549,11 @@
};

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/RTCStatsReport) */
Expand All @@ -126,7 +166,7 @@ Index: dom.generated.d.ts
}

declare var RTCStatsReport: {
@@ -34051,13 +34071,20 @@
@@ -34291,13 +34313,16 @@
handler: TimerHandler,
timeout?: number,
...arguments: any[]
Expand All @@ -135,11 +175,7 @@ Index: dom.generated.d.ts
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/structuredClone) */
-declare function structuredClone<T = any>(
+declare function structuredClone<
+ const T extends BetterTypeScriptLibInternals.StructuredClone.NeverOrUnknown<
+ BetterTypeScriptLibInternals.StructuredClone.StructuredCloneOutput<
+ BetterTypeScriptLibInternals.StructuredClone.AvoidCyclicConstraint<T>
+ >
+ >,
+ const T extends BetterTypeScriptLibInternals.StructuredClone.Constraint<T>,
+>(
value: T,
options?: StructuredSerializeOptions,
Expand All @@ -149,7 +185,7 @@ Index: dom.generated.d.ts
declare var sessionStorage: Storage;
declare function addEventListener<K extends keyof WindowEventMap>(
type: K,
@@ -34712,4 +34739,119 @@
@@ -34956,4 +34981,125 @@
| "blob"
| "document"
| "json"
Expand Down Expand Up @@ -265,8 +301,14 @@ Index: dom.generated.d.ts
+
+ type AvoidCyclicConstraint<T> = [T] extends [infer R] ? R : never;
+
+ // 上限が不正にきつくなっているのを無視する
+ type NeverOrUnknown<T> = [T] extends [never] ? never : unknown;
+
+ export type Constraint<T> =
+ BetterTypeScriptLibInternals.StructuredClone.NeverOrUnknown<
+ BetterTypeScriptLibInternals.StructuredClone.StructuredCloneOutput<
+ BetterTypeScriptLibInternals.StructuredClone.AvoidCyclicConstraint<T>
+ >
+ >;
+ }
+}

Expand Down
Loading
Loading