MessageEvent.idl 1.2 KB

12345678910111213141516171819202122232425262728
  1. #import <DOM/Event.idl>
  2. #import <HTML/MessagePort.idl>
  3. // FIXME: typedef (WindowProxy or MessagePort or ServiceWorker) MessageEventSource;
  4. typedef (WindowProxy or MessagePort) MessageEventSource;
  5. // https://html.spec.whatwg.org/multipage/comms.html#messageevent
  6. [Exposed=(Window,Worker)]
  7. interface MessageEvent : Event {
  8. constructor(DOMString type, optional MessageEventInit eventInitDict = {});
  9. readonly attribute any data;
  10. readonly attribute USVString origin;
  11. readonly attribute DOMString lastEventId;
  12. readonly attribute MessageEventSource? source;
  13. // FIXME: readonly attribute FrozenArray<MessagePort> ports;
  14. readonly attribute any ports;
  15. 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 = []);
  16. };
  17. dictionary MessageEventInit : EventInit {
  18. any data = null;
  19. USVString origin = "";
  20. DOMString lastEventId = "";
  21. MessageEventSource? source = null;
  22. sequence<MessagePort> ports = [];
  23. };