WebSocket.idl 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. #import <DOM/EventTarget.idl>
  2. #import <DOM/EventHandler.idl>
  3. interface WebSocket : EventTarget {
  4. // FIXME: A second "protocols" argument should be added once supported
  5. constructor(USVString url);
  6. readonly attribute USVString url;
  7. const unsigned short CONNECTING = 0;
  8. const unsigned short OPEN = 1;
  9. const unsigned short CLOSING = 2;
  10. const unsigned short CLOSED = 3;
  11. readonly attribute unsigned short readyState;
  12. // readonly attribute unsigned long long bufferedAmount;
  13. attribute EventHandler onopen;
  14. attribute EventHandler onerror;
  15. attribute EventHandler onclose;
  16. readonly attribute DOMString extensions;
  17. readonly attribute DOMString protocol;
  18. undefined close(optional unsigned short code, optional USVString reason);
  19. attribute EventHandler onmessage;
  20. attribute DOMString binaryType;
  21. undefined send(USVString data);
  22. // FIXME: Support other kinds of send() calls
  23. // undefined send(Blob data);
  24. // undefined send(ArrayBuffer data);
  25. // undefined send(ArrayBufferView data);
  26. };