socket-io-2.d.ts 673 B

12345678910111213141516171819202122
  1. // NOTE: This is an implementation just for shutting up
  2. // tsc, this is really annoying (and maybe dangerous)
  3. // We don't have access to the 2.4.0 typings, hence we make do with this,
  4. // Check docs before you correct types again as you need
  5. type Options = {
  6. path: string
  7. auth: {
  8. token: string | undefined
  9. }
  10. }
  11. declare module "socket.io-client-v2" {
  12. export type Socket = unknown
  13. export default class ClientV2 {
  14. static Manager: { prototype: EventEmitter } | undefined
  15. constructor(url: string, opts?: Options)
  16. on(event: string, cb: (data: any) => void): void
  17. emit(event: string, data: any, cb: (data: any) => void): void
  18. close(): void
  19. }
  20. }