WebSocket.idl 993 B

1234567891011121314151617181920212223242526272829
  1. #import <DOM/EventTarget.idl>
  2. #import <DOM/EventHandler.idl>
  3. // https://websockets.spec.whatwg.org/#websocket
  4. [Exposed=(Window,Worker), UseNewAKString]
  5. interface WebSocket : EventTarget {
  6. constructor(USVString url, optional (DOMString or sequence<DOMString>) protocols);
  7. readonly attribute USVString url;
  8. const unsigned short CONNECTING = 0;
  9. const unsigned short OPEN = 1;
  10. const unsigned short CLOSING = 2;
  11. const unsigned short CLOSED = 3;
  12. readonly attribute unsigned short readyState;
  13. // readonly attribute unsigned long long bufferedAmount;
  14. attribute EventHandler onopen;
  15. attribute EventHandler onerror;
  16. attribute EventHandler onclose;
  17. readonly attribute DOMString extensions;
  18. readonly attribute DOMString protocol;
  19. undefined close(optional unsigned short code, optional USVString reason);
  20. attribute EventHandler onmessage;
  21. attribute DOMString binaryType;
  22. undefined send((BufferSource or Blob or USVString) data);
  23. };