Skip to content

Commit

Permalink
MessageEventTarget's events have type MessageEvent (#1881)
Browse files Browse the repository at this point in the history
The override did not get added when the new mixin was introduced to Worker and
MessagePort.
  • Loading branch information
sandersn authored Jan 17, 2025
1 parent a5c716b commit 394c066
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 44 deletions.
8 changes: 4 additions & 4 deletions baselines/audioworklet.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -678,15 +678,15 @@ declare var MessageEvent: {
};

interface MessageEventTargetEventMap {
"message": Event;
"messageerror": Event;
"message": MessageEvent;
"messageerror": MessageEvent;
}

interface MessageEventTarget {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/message_event) */
onmessage: ((this: MessageEventTarget, ev: Event) => any) | null;
onmessage: ((this: MessageEventTarget, ev: MessageEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/messageerror_event) */
onmessageerror: ((this: MessageEventTarget, ev: Event) => any) | null;
onmessageerror: ((this: MessageEventTarget, ev: MessageEvent) => any) | null;
addEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down
8 changes: 4 additions & 4 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16385,15 +16385,15 @@ declare var MessageEvent: {
};

interface MessageEventTargetEventMap {
"message": Event;
"messageerror": Event;
"message": MessageEvent;
"messageerror": MessageEvent;
}

interface MessageEventTarget {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/message_event) */
onmessage: ((this: MessageEventTarget, ev: Event) => any) | null;
onmessage: ((this: MessageEventTarget, ev: MessageEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/messageerror_event) */
onmessageerror: ((this: MessageEventTarget, ev: Event) => any) | null;
onmessageerror: ((this: MessageEventTarget, ev: MessageEvent) => any) | null;
addEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down
8 changes: 4 additions & 4 deletions baselines/serviceworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3755,15 +3755,15 @@ declare var MessageEvent: {
};

interface MessageEventTargetEventMap {
"message": Event;
"messageerror": Event;
"message": MessageEvent;
"messageerror": MessageEvent;
}

interface MessageEventTarget {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/message_event) */
onmessage: ((this: MessageEventTarget, ev: Event) => any) | null;
onmessage: ((this: MessageEventTarget, ev: MessageEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/messageerror_event) */
onmessageerror: ((this: MessageEventTarget, ev: Event) => any) | null;
onmessageerror: ((this: MessageEventTarget, ev: MessageEvent) => any) | null;
addEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down
8 changes: 4 additions & 4 deletions baselines/sharedworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3644,15 +3644,15 @@ declare var MessageEvent: {
};

interface MessageEventTargetEventMap {
"message": Event;
"messageerror": Event;
"message": MessageEvent;
"messageerror": MessageEvent;
}

interface MessageEventTarget {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/message_event) */
onmessage: ((this: MessageEventTarget, ev: Event) => any) | null;
onmessage: ((this: MessageEventTarget, ev: MessageEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/messageerror_event) */
onmessageerror: ((this: MessageEventTarget, ev: Event) => any) | null;
onmessageerror: ((this: MessageEventTarget, ev: MessageEvent) => any) | null;
addEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down
8 changes: 4 additions & 4 deletions baselines/ts5.5/audioworklet.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -678,15 +678,15 @@ declare var MessageEvent: {
};

interface MessageEventTargetEventMap {
"message": Event;
"messageerror": Event;
"message": MessageEvent;
"messageerror": MessageEvent;
}

interface MessageEventTarget {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/message_event) */
onmessage: ((this: MessageEventTarget, ev: Event) => any) | null;
onmessage: ((this: MessageEventTarget, ev: MessageEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/messageerror_event) */
onmessageerror: ((this: MessageEventTarget, ev: Event) => any) | null;
onmessageerror: ((this: MessageEventTarget, ev: MessageEvent) => any) | null;
addEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down
8 changes: 4 additions & 4 deletions baselines/ts5.5/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16365,15 +16365,15 @@ declare var MessageEvent: {
};

interface MessageEventTargetEventMap {
"message": Event;
"messageerror": Event;
"message": MessageEvent;
"messageerror": MessageEvent;
}

interface MessageEventTarget {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/message_event) */
onmessage: ((this: MessageEventTarget, ev: Event) => any) | null;
onmessage: ((this: MessageEventTarget, ev: MessageEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/messageerror_event) */
onmessageerror: ((this: MessageEventTarget, ev: Event) => any) | null;
onmessageerror: ((this: MessageEventTarget, ev: MessageEvent) => any) | null;
addEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down
8 changes: 4 additions & 4 deletions baselines/ts5.5/serviceworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3755,15 +3755,15 @@ declare var MessageEvent: {
};

interface MessageEventTargetEventMap {
"message": Event;
"messageerror": Event;
"message": MessageEvent;
"messageerror": MessageEvent;
}

interface MessageEventTarget {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/message_event) */
onmessage: ((this: MessageEventTarget, ev: Event) => any) | null;
onmessage: ((this: MessageEventTarget, ev: MessageEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/messageerror_event) */
onmessageerror: ((this: MessageEventTarget, ev: Event) => any) | null;
onmessageerror: ((this: MessageEventTarget, ev: MessageEvent) => any) | null;
addEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down
8 changes: 4 additions & 4 deletions baselines/ts5.5/sharedworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3644,15 +3644,15 @@ declare var MessageEvent: {
};

interface MessageEventTargetEventMap {
"message": Event;
"messageerror": Event;
"message": MessageEvent;
"messageerror": MessageEvent;
}

interface MessageEventTarget {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/message_event) */
onmessage: ((this: MessageEventTarget, ev: Event) => any) | null;
onmessage: ((this: MessageEventTarget, ev: MessageEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/messageerror_event) */
onmessageerror: ((this: MessageEventTarget, ev: Event) => any) | null;
onmessageerror: ((this: MessageEventTarget, ev: MessageEvent) => any) | null;
addEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down
12 changes: 6 additions & 6 deletions baselines/ts5.5/webworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4329,15 +4329,15 @@ declare var MessageEvent: {
};

interface MessageEventTargetEventMap {
"message": Event;
"messageerror": Event;
"message": MessageEvent;
"messageerror": MessageEvent;
}

interface MessageEventTarget {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/message_event) */
onmessage: ((this: MessageEventTarget, ev: Event) => any) | null;
onmessage: ((this: MessageEventTarget, ev: MessageEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/messageerror_event) */
onmessageerror: ((this: MessageEventTarget, ev: Event) => any) | null;
onmessageerror: ((this: MessageEventTarget, ev: MessageEvent) => any) | null;
addEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down Expand Up @@ -9732,9 +9732,9 @@ declare function cancelAnimationFrame(handle: number): void;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/requestAnimationFrame) */
declare function requestAnimationFrame(callback: FrameRequestCallback): number;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/message_event) */
declare var onmessage: ((this: DedicatedWorkerGlobalScope, ev: Event) => any) | null;
declare var onmessage: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/messageerror_event) */
declare var onmessageerror: ((this: DedicatedWorkerGlobalScope, ev: Event) => any) | null;
declare var onmessageerror: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null;
declare function addEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
declare function removeEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down
12 changes: 6 additions & 6 deletions baselines/webworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4329,15 +4329,15 @@ declare var MessageEvent: {
};

interface MessageEventTargetEventMap {
"message": Event;
"messageerror": Event;
"message": MessageEvent;
"messageerror": MessageEvent;
}

interface MessageEventTarget {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/message_event) */
onmessage: ((this: MessageEventTarget, ev: Event) => any) | null;
onmessage: ((this: MessageEventTarget, ev: MessageEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/messageerror_event) */
onmessageerror: ((this: MessageEventTarget, ev: Event) => any) | null;
onmessageerror: ((this: MessageEventTarget, ev: MessageEvent) => any) | null;
addEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof MessageEventTargetEventMap>(type: K, listener: (this: MessageEventTarget, ev: MessageEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down Expand Up @@ -9732,9 +9732,9 @@ declare function cancelAnimationFrame(handle: number): void;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/requestAnimationFrame) */
declare function requestAnimationFrame(callback: FrameRequestCallback): number;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/message_event) */
declare var onmessage: ((this: DedicatedWorkerGlobalScope, ev: Event) => any) | null;
declare var onmessage: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/messageerror_event) */
declare var onmessageerror: ((this: DedicatedWorkerGlobalScope, ev: Event) => any) | null;
declare var onmessageerror: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null;
declare function addEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
declare function removeEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down
14 changes: 14 additions & 0 deletions inputfiles/overridingTypes.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
{
"mixins": {
"mixin": {
"MessageEventTarget": {
"events": {
"event": [
{
"name": "message",
"type": "MessageEvent"
},
{
"name": "messageerror",
"type": "MessageEvent"
}
]
}
},
"ChildNode": {
"extends": "Node"
},
Expand Down

0 comments on commit 394c066

Please sign in to comment.