polling.d.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. import { Transport } from "../transport";
  2. export declare class Polling extends Transport {
  3. maxHttpBufferSize: number;
  4. httpCompression: any;
  5. private res;
  6. private dataReq;
  7. private dataRes;
  8. private shouldClose;
  9. private readonly closeTimeout;
  10. /**
  11. * HTTP polling constructor.
  12. *
  13. * @api public.
  14. */
  15. constructor(req: any);
  16. /**
  17. * Transport name
  18. *
  19. * @api public
  20. */
  21. get name(): string;
  22. get supportsFraming(): boolean;
  23. /**
  24. * Overrides onRequest.
  25. *
  26. * @param req
  27. *
  28. * @api private
  29. */
  30. onRequest(req: any): void;
  31. /**
  32. * The client sends a request awaiting for us to send data.
  33. *
  34. * @api private
  35. */
  36. onPollRequest(req: any, res: any): void;
  37. /**
  38. * The client sends a request with data.
  39. *
  40. * @api private
  41. */
  42. onDataRequest(req: any, res: any): void;
  43. /**
  44. * Cleanup request.
  45. *
  46. * @api private
  47. */
  48. private onDataRequestCleanup;
  49. /**
  50. * Processes the incoming data payload.
  51. *
  52. * @param {String} encoded payload
  53. * @api private
  54. */
  55. onData(data: any): void;
  56. /**
  57. * Overrides onClose.
  58. *
  59. * @api private
  60. */
  61. onClose(): void;
  62. /**
  63. * Writes a packet payload.
  64. *
  65. * @param {Object} packet
  66. * @api private
  67. */
  68. send(packets: any): void;
  69. /**
  70. * Writes data as response to poll request.
  71. *
  72. * @param {String} data
  73. * @param {Object} options
  74. * @api private
  75. */
  76. write(data: any, options: any): void;
  77. /**
  78. * Performs the write.
  79. *
  80. * @api private
  81. */
  82. doWrite(data: any, options: any, callback: any): void;
  83. /**
  84. * Compresses data.
  85. *
  86. * @api private
  87. */
  88. compress(data: any, encoding: any, callback: any): void;
  89. /**
  90. * Closes the transport.
  91. *
  92. * @api private
  93. */
  94. doClose(fn: any): void;
  95. /**
  96. * Returns headers for a response.
  97. *
  98. * @param req - request
  99. * @param {Object} extra headers
  100. * @api private
  101. */
  102. headers(req: any, headers: any): any;
  103. }