index.d.ts 972 B

1234567891011121314151617181920212223242526272829
  1. import { Manager, ManagerOptions } from "./manager.js";
  2. import { Socket, SocketOptions } from "./socket.js";
  3. /**
  4. * Looks up an existing `Manager` for multiplexing.
  5. * If the user summons:
  6. *
  7. * `io('http://localhost/a');`
  8. * `io('http://localhost/b');`
  9. *
  10. * We reuse the existing instance based on same scheme/port/host,
  11. * and we initialize sockets for each namespace.
  12. *
  13. * @public
  14. */
  15. declare function lookup(opts?: Partial<ManagerOptions & SocketOptions>): Socket;
  16. declare function lookup(uri: string, opts?: Partial<ManagerOptions & SocketOptions>): Socket;
  17. declare function lookup(uri: string | Partial<ManagerOptions & SocketOptions>, opts?: Partial<ManagerOptions & SocketOptions>): Socket;
  18. /**
  19. * Protocol version.
  20. *
  21. * @public
  22. */
  23. export { protocol } from "socket.io-parser";
  24. /**
  25. * Expose constructors for standalone build.
  26. *
  27. * @public
  28. */
  29. export { Manager, ManagerOptions, Socket, SocketOptions, lookup as io, lookup as connect, lookup as default, };