WebSocket.idl 1004 B

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