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