Skip to content

Commit cc6ddca

Browse files
committed
fix dom iterable types
1 parent 3b0717e commit cc6ddca

File tree

4 files changed

+80
-12
lines changed

4 files changed

+80
-12
lines changed

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

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,47 @@ Index: dom.generated.d.ts
7171
addEventListener<K extends keyof FontFaceSetEventMap>(
7272
type: K,
7373
listener: (this: FontFaceSet, ev: FontFaceSetEventMap[K]) => any,
74-
@@ -17139,11 +17149,16 @@
74+
@@ -15711,15 +15721,16 @@
75+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Highlight/priority) */
76+
priority: number;
77+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Highlight/type) */
78+
type: HighlightType;
79+
- forEach(
80+
+ forEach<This = undefined>(
81+
callbackfn: (
82+
+ this: This,
83+
value: AbstractRange,
84+
key: AbstractRange,
85+
- parent: Highlight,
86+
+ parent: this,
87+
) => void,
88+
- thisArg?: any,
89+
+ thisArg?: This,
90+
): void;
91+
}
92+
93+
declare var Highlight: {
94+
@@ -15728,15 +15739,16 @@
95+
};
96+
97+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HighlightRegistry) */
98+
interface HighlightRegistry {
99+
- forEach(
100+
+ forEach<This = undefined>(
101+
callbackfn: (
102+
+ this: This,
103+
value: Highlight,
104+
key: string,
105+
- parent: HighlightRegistry,
106+
+ parent: this,
107+
) => void,
108+
- thisArg?: any,
109+
+ thisArg?: This,
110+
): void;
111+
}
112+
113+
declare var HighlightRegistry: {
114+
@@ -17139,11 +17151,16 @@
75115
*
76116
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MIDIInputMap)
77117
*/
@@ -91,7 +131,7 @@ Index: dom.generated.d.ts
91131
}
92132

93133
declare var MIDIInputMap: {
94-
@@ -17206,11 +17221,16 @@
134+
@@ -17206,11 +17223,16 @@
95135
*
96136
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MIDIOutputMap)
97137
*/
@@ -111,7 +151,7 @@ Index: dom.generated.d.ts
111151
}
112152

113153
declare var MIDIOutputMap: {
114-
@@ -21527,11 +21547,11 @@
154+
@@ -21527,11 +21549,11 @@
115155
};
116156

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

128168
declare var RTCStatsReport: {
129-
@@ -34291,13 +34311,16 @@
169+
@@ -34291,13 +34313,16 @@
130170
handler: TimerHandler,
131171
timeout?: number,
132172
...arguments: any[]
@@ -145,7 +185,7 @@ Index: dom.generated.d.ts
145185
declare var sessionStorage: Storage;
146186
declare function addEventListener<K extends keyof WindowEventMap>(
147187
type: K,
148-
@@ -34956,4 +34979,125 @@
188+
@@ -34956,4 +34981,125 @@
149189
| "blob"
150190
| "document"
151191
| "json"

generated/lib.dom.d.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15728,15 +15728,17 @@ interface Highlight {
1572815728
priority: number;
1572915729
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Highlight/type) */
1573015730
type: HighlightType;
15731-
forEach(
15731+
forEach<This = undefined>(
1573215732
callbackfn: (
15733+
this: This,
1573315734
value: AbstractRange,
1573415735
key: AbstractRange,
15735-
parent: Highlight,
15736+
parent: this,
1573615737
) => void,
15737-
thisArg?: any,
15738+
thisArg?: This,
1573815739
): void;
1573915740
}
15741+
// forEach(callbackfn: (value: AbstractRange, key: AbstractRange, parent: Highlight) => void, thisArg?: any): void;
1574015742

1574115743
declare var Highlight: {
1574215744
prototype: Highlight;
@@ -15745,15 +15747,17 @@ declare var Highlight: {
1574515747

1574615748
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HighlightRegistry) */
1574715749
interface HighlightRegistry {
15748-
forEach(
15750+
forEach<This = undefined>(
1574915751
callbackfn: (
15752+
this: This,
1575015753
value: Highlight,
1575115754
key: string,
15752-
parent: HighlightRegistry,
15755+
parent: this,
1575315756
) => void,
15754-
thisArg?: any,
15757+
thisArg?: This,
1575515758
): void;
1575615759
}
15760+
// forEach(callbackfn: (value: Highlight, key: string, parent: HighlightRegistry) => void, thisArg?: any): void;
1575715761

1575815762
declare var HighlightRegistry: {
1575915763
prototype: HighlightRegistry;

lib/lib.dom.d.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,30 @@ interface FontFaceSet extends EventTarget {
6767
): void;
6868
}
6969

70+
interface Highlight {
71+
forEach<This = undefined>(
72+
callbackfn: (
73+
this: This,
74+
value: AbstractRange,
75+
key: AbstractRange,
76+
parent: this,
77+
) => void,
78+
thisArg?: This,
79+
): void;
80+
}
81+
82+
interface HighlightRegistry {
83+
forEach<This = undefined>(
84+
callbackfn: (
85+
this: This,
86+
value: Highlight,
87+
key: string,
88+
parent: this,
89+
) => void,
90+
thisArg?: This,
91+
): void;
92+
}
93+
7094
declare namespace BetterTypeScriptLibInternals {
7195
export namespace StructuredClone {
7296
type Basics = [

tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@
3838
"overrides": {
3939
"@tsd/typescript": "~5.4.3"
4040
}
41-
}
41+
}

0 commit comments

Comments
 (0)