Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

transport.d.ts 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /// <reference types="node" />
  2. import { EventEmitter } from "events";
  3. import { IncomingMessage } from "http";
  4. import { Packet } from "engine.io-parser";
  5. export declare abstract class Transport extends EventEmitter {
  6. sid: string;
  7. writable: boolean;
  8. protocol: number;
  9. protected _readyState: string;
  10. protected discarded: boolean;
  11. protected parser: any;
  12. protected req: IncomingMessage & {
  13. cleanup: Function;
  14. };
  15. protected supportsBinary: boolean;
  16. get readyState(): string;
  17. set readyState(state: string);
  18. /**
  19. * Transport constructor.
  20. *
  21. * @param {http.IncomingMessage} request
  22. * @api public
  23. */
  24. constructor(req: any);
  25. /**
  26. * Flags the transport as discarded.
  27. *
  28. * @api private
  29. */
  30. discard(): void;
  31. /**
  32. * Called with an incoming HTTP request.
  33. *
  34. * @param {http.IncomingMessage} request
  35. * @api protected
  36. */
  37. protected onRequest(req: any): void;
  38. /**
  39. * Closes the transport.
  40. *
  41. * @api private
  42. */
  43. close(fn?: any): void;
  44. /**
  45. * Called with a transport error.
  46. *
  47. * @param {String} message error
  48. * @param {Object} error description
  49. * @api protected
  50. */
  51. protected onError(msg: string, desc?: any): void;
  52. /**
  53. * Called with parsed out a packets from the data stream.
  54. *
  55. * @param {Object} packet
  56. * @api protected
  57. */
  58. protected onPacket(packet: Packet): void;
  59. /**
  60. * Called with the encoded packet data.
  61. *
  62. * @param {String} data
  63. * @api protected
  64. */
  65. protected onData(data: any): void;
  66. /**
  67. * Called upon transport close.
  68. *
  69. * @api protected
  70. */
  71. protected onClose(): void;
  72. abstract get supportsFraming(): any;
  73. abstract get name(): any;
  74. abstract send(packets: any): any;
  75. abstract doClose(fn?: any): any;
  76. }