@@ -4,14 +4,15 @@ import { IncomingMessage } from "http";
44import { Server } from "./index" ;
55import { Socket } from "./socket" ;
66import { SocketId } from "socket.io-adapter" ;
7+ import { ParentNamespace } from "./parent-namespace" ;
78
89const debug = debugModule ( "socket.io:client" ) ;
910
1011export class Client {
1112 public readonly conn ;
1213
1314 private readonly id : string ;
14- private readonly server ;
15+ private readonly server : Server ;
1516 private readonly encoder : Encoder ;
1617 private readonly decoder : Decoder ;
1718 private sockets : Map < SocketId , Socket > = new Map ( ) ;
@@ -83,7 +84,7 @@ export class Client {
8384 return this . doConnect ( name , auth ) ;
8485 }
8586
86- this . server . _checkNamespace ( name , auth , dynamicNsp => {
87+ this . server . _checkNamespace ( name , auth , ( dynamicNsp : ParentNamespace ) => {
8788 if ( dynamicNsp ) {
8889 debug ( "dynamic namespace %s was created" , dynamicNsp . name ) ;
8990 this . doConnect ( name , auth ) ;
@@ -113,7 +114,7 @@ export class Client {
113114 }
114115 const nsp = this . server . of ( name ) ;
115116
116- const socket = nsp . add ( this , auth , ( ) => {
117+ const socket = nsp . _add ( this , auth , ( ) => {
117118 this . sockets . set ( socket . id , socket ) ;
118119 this . nsps . set ( nsp . name , socket ) ;
119120 } ) ;
0 commit comments