Skip to content

Commit f21f486

Browse files
committed
use MessageEventSource
1 parent dcb6f72 commit f21f486

File tree

5 files changed

+27
-6
lines changed

5 files changed

+27
-6
lines changed

baselines/dom.generated.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9465,7 +9465,7 @@ interface MessageEvent extends Event {
94659465
readonly data: any;
94669466
readonly origin: string;
94679467
readonly ports: ReadonlyArray<MessagePort>;
9468-
readonly source: Window | null;
9468+
readonly source: MessageEventSource;
94699469
initMessageEvent(type: string, bubbles: boolean, cancelable: boolean, data: any, origin: string, lastEventId: string, source: Window): void;
94709470
}
94719471

@@ -16574,6 +16574,7 @@ type RTCTransport = RTCDtlsTransport | RTCSrtpSdesTransport;
1657416574
type USVString = string;
1657516575
type payloadtype = number;
1657616576
type ClientTypes = "window" | "worker" | "sharedworker" | "all";
16577+
type MessageEventSource = Window | MessagePort | ServiceWorker;
1657716578
type AppendMode = "segments" | "sequence";
1657816579
type AudioContextLatencyCategory = "balanced" | "interactive" | "playback";
1657916580
type AudioContextState = "suspended" | "running" | "closed";

baselines/webworker.generated.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ interface MessageEvent extends Event {
959959
readonly data: any;
960960
readonly origin: string;
961961
readonly ports: ReadonlyArray<MessagePort>;
962-
readonly source: object | null;
962+
readonly source: MessageEventSource;
963963
initMessageEvent(type: string, bubbles: boolean, cancelable: boolean, data: any, origin: string, lastEventId: string, source: object): void;
964964
}
965965

@@ -1884,6 +1884,7 @@ type IDBKeyPath = string;
18841884
type USVString = string;
18851885
type payloadtype = number;
18861886
type ClientTypes = "window" | "worker" | "sharedworker" | "all";
1887+
type MessageEventSource = object | MessagePort | ServiceWorker;
18871888
type BinaryType = "blob" | "arraybuffer";
18881889
type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";
18891890
type IDBRequestReadyState = "pending" | "done";

inputfiles/addedTypes.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3001,6 +3001,20 @@
30013001
{
30023002
"new-type": "ClientTypes",
30033003
"override-type": "\"window\" | \"worker\" | \"sharedworker\" | \"all\""
3004+
},
3005+
{
3006+
"new-type": "MessageEventSource",
3007+
"type": [
3008+
{
3009+
"type": "Window"
3010+
},
3011+
{
3012+
"type": "MessagePort"
3013+
},
3014+
{
3015+
"type": "ServiceWorker"
3016+
}
3017+
]
30043018
}
30053019
]
30063020
}

inputfiles/knownWorkerTypes.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"ImageData",
5555
"MessageChannel",
5656
"MessageEvent",
57+
"MessageEventSource",
5758
"MessagePort",
5859
"NavigationPreloadManager",
5960
"NavigationPreloadState",

inputfiles/overridingTypes.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,10 +1031,14 @@
10311031
},
10321032
"MessageEvent": {
10331033
"name": "MessageEvent",
1034-
"constructor": {
1035-
"override-signatures": [
1036-
"new(type: string, eventInitDict?: MessageEventInit): MessageEvent"
1037-
]
1034+
"properties": {
1035+
"property": {
1036+
"source": {
1037+
"name": "source",
1038+
"nullable": 0,
1039+
"override-type": "MessageEventSource"
1040+
}
1041+
}
10381042
}
10391043
},
10401044
"File": {

0 commit comments

Comments
 (0)