Skip to content

Commit 48ac7ec

Browse files
authored
Merge branch 'microsoft:main' into legacy-enums
2 parents b37b0ac + c059d14 commit 48ac7ec

File tree

9 files changed

+49
-19
lines changed

9 files changed

+49
-19
lines changed

baselines/dom.generated.d.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6851,6 +6851,7 @@ interface CSSStyleProperties extends CSSStyleDeclaration {
68516851
textAlignLast: string;
68526852
/** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-anchor) */
68536853
textAnchor: string;
6854+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-autospace) */
68546855
textAutospace: string;
68556856
/** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-box) */
68566857
textBox: string;
@@ -11291,6 +11292,9 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, NonDocumentTyp
1129111292
*
1129211293
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/matches)
1129311294
*/
11295+
matches<K extends keyof HTMLElementTagNameMap>(selectors: K): this is HTMLElementTagNameMap[K];
11296+
matches<K extends keyof SVGElementTagNameMap>(selectors: K): this is SVGElementTagNameMap[K];
11297+
matches<K extends keyof MathMLElementTagNameMap>(selectors: K): this is MathMLElementTagNameMap[K];
1129411298
matches(selectors: string): boolean;
1129511299
/**
1129611300
* The **`releasePointerCapture()`** method of the Element interface releases (stops) _pointer capture_ that was previously set for a specific (PointerEvent) _pointer_.
@@ -14412,7 +14416,7 @@ interface HTMLFormElement extends HTMLElement {
1441214416
*/
1441314417
autocomplete: AutoFillBase;
1441414418
/**
14415-
* The HTMLFormElement property **`elements`** returns an HTMLFormControlsCollection listing all the form controls contained in the form element.
14419+
* The **`elements`** property of the HTMLFormElement interface returns an HTMLFormControlsCollection listing all the listed form controls associated with the form element.
1441614420
*
1441714421
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLFormElement/elements)
1441814422
*/
@@ -23816,6 +23820,7 @@ declare var PerformanceObserverEntryList: {
2381623820
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformancePaintTiming)
2381723821
*/
2381823822
interface PerformancePaintTiming extends PerformanceEntry {
23823+
toJSON(): any;
2381923824
}
2382023825

2382123826
declare var PerformancePaintTiming: {
@@ -24387,7 +24392,7 @@ interface PointerEvent extends MouseEvent {
2438724392
*/
2438824393
readonly persistentDeviceId: number;
2438924394
/**
24390-
* The **`pointerId`** read-only property of the PointerEvent interface is an identifier assigned to a given pointer event.
24395+
* The **`pointerId`** read-only property of the PointerEvent interface is an identifier assigned to the pointer that triggered the event.
2439124396
*
2439224397
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PointerEvent/pointerId)
2439324398
*/

baselines/ts5.5/dom.generated.d.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6844,6 +6844,7 @@ interface CSSStyleProperties extends CSSStyleDeclaration {
68446844
textAlignLast: string;
68456845
/** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-anchor) */
68466846
textAnchor: string;
6847+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-autospace) */
68476848
textAutospace: string;
68486849
/** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-box) */
68496850
textBox: string;
@@ -11281,6 +11282,9 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, NonDocumentTyp
1128111282
*
1128211283
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/matches)
1128311284
*/
11285+
matches<K extends keyof HTMLElementTagNameMap>(selectors: K): this is HTMLElementTagNameMap[K];
11286+
matches<K extends keyof SVGElementTagNameMap>(selectors: K): this is SVGElementTagNameMap[K];
11287+
matches<K extends keyof MathMLElementTagNameMap>(selectors: K): this is MathMLElementTagNameMap[K];
1128411288
matches(selectors: string): boolean;
1128511289
/**
1128611290
* The **`releasePointerCapture()`** method of the Element interface releases (stops) _pointer capture_ that was previously set for a specific (PointerEvent) _pointer_.
@@ -14399,7 +14403,7 @@ interface HTMLFormElement extends HTMLElement {
1439914403
*/
1440014404
autocomplete: AutoFillBase;
1440114405
/**
14402-
* The HTMLFormElement property **`elements`** returns an HTMLFormControlsCollection listing all the form controls contained in the form element.
14406+
* The **`elements`** property of the HTMLFormElement interface returns an HTMLFormControlsCollection listing all the listed form controls associated with the form element.
1440314407
*
1440414408
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLFormElement/elements)
1440514409
*/
@@ -23795,6 +23799,7 @@ declare var PerformanceObserverEntryList: {
2379523799
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformancePaintTiming)
2379623800
*/
2379723801
interface PerformancePaintTiming extends PerformanceEntry {
23802+
toJSON(): any;
2379823803
}
2379923804

2380023805
declare var PerformancePaintTiming: {
@@ -24366,7 +24371,7 @@ interface PointerEvent extends MouseEvent {
2436624371
*/
2436724372
readonly persistentDeviceId: number;
2436824373
/**
24369-
* The **`pointerId`** read-only property of the PointerEvent interface is an identifier assigned to a given pointer event.
24374+
* The **`pointerId`** read-only property of the PointerEvent interface is an identifier assigned to the pointer that triggered the event.
2437024375
*
2437124376
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PointerEvent/pointerId)
2437224377
*/

baselines/ts5.5/webworker.generated.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7440,7 +7440,7 @@ interface RTCRtpScriptTransformer extends EventTarget {
74407440
*
74417441
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/RTCRtpScriptTransformer/generateKeyFrame)
74427442
*/
7443-
generateKeyFrame(rid?: string): Promise<number>;
7443+
generateKeyFrame(rid?: string): Promise<void>;
74447444
/**
74457445
* The **`sendKeyFrameRequest()`** method of the RTCRtpScriptTransformer interface may be called by a WebRTC Encoded Transform that is processing incoming encoded video frames, in order to request a key frame from the sender.
74467446
*

baselines/ts5.6/dom.generated.d.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6851,6 +6851,7 @@ interface CSSStyleProperties extends CSSStyleDeclaration {
68516851
textAlignLast: string;
68526852
/** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-anchor) */
68536853
textAnchor: string;
6854+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-autospace) */
68546855
textAutospace: string;
68556856
/** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-box) */
68566857
textBox: string;
@@ -11291,6 +11292,9 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, NonDocumentTyp
1129111292
*
1129211293
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/matches)
1129311294
*/
11295+
matches<K extends keyof HTMLElementTagNameMap>(selectors: K): this is HTMLElementTagNameMap[K];
11296+
matches<K extends keyof SVGElementTagNameMap>(selectors: K): this is SVGElementTagNameMap[K];
11297+
matches<K extends keyof MathMLElementTagNameMap>(selectors: K): this is MathMLElementTagNameMap[K];
1129411298
matches(selectors: string): boolean;
1129511299
/**
1129611300
* The **`releasePointerCapture()`** method of the Element interface releases (stops) _pointer capture_ that was previously set for a specific (PointerEvent) _pointer_.
@@ -14412,7 +14416,7 @@ interface HTMLFormElement extends HTMLElement {
1441214416
*/
1441314417
autocomplete: AutoFillBase;
1441414418
/**
14415-
* The HTMLFormElement property **`elements`** returns an HTMLFormControlsCollection listing all the form controls contained in the form element.
14419+
* The **`elements`** property of the HTMLFormElement interface returns an HTMLFormControlsCollection listing all the listed form controls associated with the form element.
1441614420
*
1441714421
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLFormElement/elements)
1441814422
*/
@@ -23816,6 +23820,7 @@ declare var PerformanceObserverEntryList: {
2381623820
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformancePaintTiming)
2381723821
*/
2381823822
interface PerformancePaintTiming extends PerformanceEntry {
23823+
toJSON(): any;
2381923824
}
2382023825

2382123826
declare var PerformancePaintTiming: {
@@ -24387,7 +24392,7 @@ interface PointerEvent extends MouseEvent {
2438724392
*/
2438824393
readonly persistentDeviceId: number;
2438924394
/**
24390-
* The **`pointerId`** read-only property of the PointerEvent interface is an identifier assigned to a given pointer event.
24395+
* The **`pointerId`** read-only property of the PointerEvent interface is an identifier assigned to the pointer that triggered the event.
2439124396
*
2439224397
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PointerEvent/pointerId)
2439324398
*/

baselines/ts5.6/webworker.generated.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7440,7 +7440,7 @@ interface RTCRtpScriptTransformer extends EventTarget {
74407440
*
74417441
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/RTCRtpScriptTransformer/generateKeyFrame)
74427442
*/
7443-
generateKeyFrame(rid?: string): Promise<number>;
7443+
generateKeyFrame(rid?: string): Promise<void>;
74447444
/**
74457445
* The **`sendKeyFrameRequest()`** method of the RTCRtpScriptTransformer interface may be called by a WebRTC Encoded Transform that is processing incoming encoded video frames, in order to request a key frame from the sender.
74467446
*

baselines/webworker.generated.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7440,7 +7440,7 @@ interface RTCRtpScriptTransformer extends EventTarget {
74407440
*
74417441
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/RTCRtpScriptTransformer/generateKeyFrame)
74427442
*/
7443-
generateKeyFrame(rid?: string): Promise<number>;
7443+
generateKeyFrame(rid?: string): Promise<void>;
74447444
/**
74457445
* The **`sendKeyFrameRequest()`** method of the RTCRtpScriptTransformer interface may be called by a WebRTC Encoded Transform that is processing incoming encoded video frames, in order to request a key frame from the sender.
74467446
*

inputfiles/mdn

Submodule mdn updated 331 files

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/build/emitter.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,19 @@ export function emitWebIdl(
613613
}
614614
}
615615

616+
/// Emit overloads for the matches method
617+
function emitMatchesOverloads(m: Browser.Method) {
618+
if (matchParamMethodSignature(m, "matches", "boolean", "string")) {
619+
const paramName = m.signature[0].param![0].name;
620+
for (const mapName of tagNameMapNames) {
621+
printer.printLine(
622+
`matches<K extends keyof ${mapName}>(${paramName}: K): this is ${mapName}[K];`,
623+
);
624+
}
625+
printer.printLine(`matches(${paramName}: string): boolean;`);
626+
}
627+
}
628+
616629
/// Emit overloads for the querySelector method
617630
function emitQuerySelectorOverloads(m: Browser.Method) {
618631
if (
@@ -988,6 +1001,8 @@ export function emitWebIdl(
9881001
return emitCreateEventOverloads(m);
9891002
case "getElementsByTagName":
9901003
return emitGetElementsByTagNameOverloads(m);
1004+
case "matches":
1005+
return emitMatchesOverloads(m);
9911006
case "querySelector":
9921007
return emitQuerySelectorOverloads(m);
9931008
case "querySelectorAll":

0 commit comments

Comments
 (0)