2023-11-06 17:11:58 -03:00
|
|
|
// FIXME: typedef (WindowProxy or MessagePort or ServiceWorker) MessageEventSource;
|
|
|
|
|
typedef (WindowProxy or MessagePort) MessageEventSource;
|
2021-10-01 12:39:03 -03:00
|
|
|
|
2022-10-07 19:45:09 -03:00
|
|
|
// https://html.spec.whatwg.org/multipage/comms.html#messageevent
|
2023-09-02 11:00:01 -03:00
|
|
|
[Exposed=(Window,Worker)]
|
2021-04-24 08:54:24 -03:00
|
|
|
interface MessageEvent : Event {
|
2021-10-01 12:39:03 -03:00
|
|
|
constructor(DOMString type, optional MessageEventInit eventInitDict = {});
|
2021-04-24 08:54:24 -03:00
|
|
|
|
2021-10-01 12:21:38 -03:00
|
|
|
readonly attribute any data;
|
2021-04-24 08:54:24 -03:00
|
|
|
readonly attribute USVString origin;
|
2021-10-01 12:30:30 -03:00
|
|
|
readonly attribute DOMString lastEventId;
|
2023-11-06 17:11:58 -03:00
|
|
|
readonly attribute MessageEventSource? source;
|
2025-04-25 11:13:26 -03:00
|
|
|
// FIXME: This should be FrozenArray<MessagePort>, but must also always return the same object.
|
2023-12-12 17:28:38 -03:00
|
|
|
readonly attribute any ports;
|
2024-07-09 15:43:51 -03:00
|
|
|
|
|
|
|
|
undefined initMessageEvent(DOMString type, optional boolean bubbles = false, optional boolean cancelable = false, optional any data = null, optional USVString origin = "", optional DOMString lastEventId = "", optional MessageEventSource? source = null, optional sequence<MessagePort> ports = []);
|
2021-04-24 08:54:24 -03:00
|
|
|
};
|
2021-10-01 12:39:03 -03:00
|
|
|
|
|
|
|
|
dictionary MessageEventInit : EventInit {
|
|
|
|
|
any data = null;
|
|
|
|
|
USVString origin = "";
|
|
|
|
|
DOMString lastEventId = "";
|
2023-11-06 17:11:58 -03:00
|
|
|
MessageEventSource? source = null;
|
2024-05-15 16:58:02 -03:00
|
|
|
sequence<MessagePort> ports = [];
|
2021-10-01 12:39:03 -03:00
|
|
|
};
|