websocket.d.ts 990 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { Transport } from "../transport";
  2. export declare class WebSocket extends Transport {
  3. protected perMessageDeflate: any;
  4. private socket;
  5. /**
  6. * WebSocket transport
  7. *
  8. * @param {http.IncomingMessage}
  9. * @api public
  10. */
  11. constructor(req: any);
  12. /**
  13. * Transport name
  14. *
  15. * @api public
  16. */
  17. get name(): string;
  18. /**
  19. * Advertise upgrade support.
  20. *
  21. * @api public
  22. */
  23. get handlesUpgrades(): boolean;
  24. /**
  25. * Advertise framing support.
  26. *
  27. * @api public
  28. */
  29. get supportsFraming(): boolean;
  30. /**
  31. * Writes a packet payload.
  32. *
  33. * @param {Array} packets
  34. * @api private
  35. */
  36. send(packets: any): void;
  37. /**
  38. * Whether the encoding of the WebSocket frame can be skipped.
  39. * @param packet
  40. * @private
  41. */
  42. private _canSendPreEncodedFrame;
  43. /**
  44. * Closes the transport.
  45. *
  46. * @api private
  47. */
  48. doClose(fn: any): void;
  49. }