websocket.d.ts 726 B

12345678910111213141516171819202122232425262728293031323334
  1. import { Transport } from "../transport.js";
  2. export declare class WS extends Transport {
  3. private ws;
  4. /**
  5. * WebSocket transport constructor.
  6. *
  7. * @param {Object} opts - connection options
  8. * @protected
  9. */
  10. constructor(opts: any);
  11. get name(): string;
  12. doOpen(): this;
  13. /**
  14. * Adds event listeners to the socket
  15. *
  16. * @private
  17. */
  18. private addEventListeners;
  19. write(packets: any): void;
  20. doClose(): void;
  21. /**
  22. * Generates uri for connection.
  23. *
  24. * @private
  25. */
  26. private uri;
  27. /**
  28. * Feature detection for WebSocket.
  29. *
  30. * @return {Boolean} whether this transport is available.
  31. * @private
  32. */
  33. private check;
  34. }