WebSocket.idl 1.0 KB

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