Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
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.

client.d.ts 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /// <reference types="node" />
  2. import { Packet } from "socket.io-parser";
  3. import type { IncomingMessage } from "http";
  4. import type { Server } from "./index";
  5. import type { EventsMap } from "./typed-events";
  6. import type { Socket } from "./socket";
  7. interface WriteOptions {
  8. compress?: boolean;
  9. volatile?: boolean;
  10. preEncoded?: boolean;
  11. wsPreEncoded?: string;
  12. }
  13. export declare class Client<ListenEvents extends EventsMap, EmitEvents extends EventsMap, ServerSideEvents extends EventsMap> {
  14. readonly conn: any;
  15. private readonly id;
  16. private readonly server;
  17. private readonly encoder;
  18. private readonly decoder;
  19. private sockets;
  20. private nsps;
  21. private connectTimeout?;
  22. /**
  23. * Client constructor.
  24. *
  25. * @param server instance
  26. * @param conn
  27. * @package
  28. */
  29. constructor(server: Server<ListenEvents, EmitEvents, ServerSideEvents>, conn: any);
  30. /**
  31. * @return the reference to the request that originated the Engine.IO connection
  32. *
  33. * @public
  34. */
  35. get request(): IncomingMessage;
  36. /**
  37. * Sets up event listeners.
  38. *
  39. * @private
  40. */
  41. private setup;
  42. /**
  43. * Connects a client to a namespace.
  44. *
  45. * @param {String} name - the namespace
  46. * @param {Object} auth - the auth parameters
  47. * @private
  48. */
  49. private connect;
  50. /**
  51. * Connects a client to a namespace.
  52. *
  53. * @param name - the namespace
  54. * @param {Object} auth - the auth parameters
  55. *
  56. * @private
  57. */
  58. private doConnect;
  59. /**
  60. * Disconnects from all namespaces and closes transport.
  61. *
  62. * @private
  63. */
  64. _disconnect(): void;
  65. /**
  66. * Removes a socket. Called by each `Socket`.
  67. *
  68. * @private
  69. */
  70. _remove(socket: Socket<ListenEvents, EmitEvents, ServerSideEvents>): void;
  71. /**
  72. * Closes the underlying connection.
  73. *
  74. * @private
  75. */
  76. private close;
  77. /**
  78. * Writes a packet to the transport.
  79. *
  80. * @param {Object} packet object
  81. * @param {Object} opts
  82. * @private
  83. */
  84. _packet(packet: Packet | any[], opts?: WriteOptions): void;
  85. private writeToEngine;
  86. /**
  87. * Called with incoming transport data.
  88. *
  89. * @private
  90. */
  91. private ondata;
  92. /**
  93. * Called when parser fully decodes a packet.
  94. *
  95. * @private
  96. */
  97. private ondecoded;
  98. /**
  99. * Handles an error.
  100. *
  101. * @param {Object} err object
  102. * @private
  103. */
  104. private onerror;
  105. /**
  106. * Called upon transport close.
  107. *
  108. * @param reason
  109. * @private
  110. */
  111. private onclose;
  112. /**
  113. * Cleans up event listeners.
  114. * @private
  115. */
  116. private destroy;
  117. }
  118. export {};