@@ -37,6 +37,8 @@ type ParentNspNameMatchFn = (
3737 fn : ( err : Error | null , success : boolean ) => void
3838) => void ;
3939
40+ type AdapterConstructor = typeof Adapter | ( ( nsp : Namespace ) => Adapter ) ;
41+
4042interface EngineOptions {
4143 /**
4244 * how many ms without a pong packet to consider the connection closed
@@ -152,7 +154,7 @@ interface ServerOptions extends EngineAttachOptions {
152154 * the adapter to use
153155 * @default the in-memory adapter (https://github.com/socketio/socket.io-adapter)
154156 */
155- adapter : any ;
157+ adapter : AdapterConstructor ;
156158 /**
157159 * the parser to use
158160 * @default the default parser (https://github.com/socketio/socket.io-parser)
@@ -207,7 +209,7 @@ export class Server<
207209 ParentNspNameMatchFn ,
208210 ParentNamespace < ListenEvents , EmitEvents , ServerSideEvents >
209211 > = new Map ( ) ;
210- private _adapter ?: typeof Adapter ;
212+ private _adapter ?: AdapterConstructor ;
211213 private _serveClient : boolean ;
212214 private opts : Partial < EngineOptions > ;
213215 private eio ;
@@ -360,10 +362,11 @@ export class Server<
360362 * @return self when setting or value when getting
361363 * @public
362364 */
363- public adapter ( ) : typeof Adapter | undefined ;
364- public adapter ( v : typeof Adapter ) : this;
365- public adapter ( v ?: typeof Adapter ) : typeof Adapter | undefined | this;
366- public adapter ( v ?: typeof Adapter ) : typeof Adapter | undefined | this {
365+ public adapter ( ) : AdapterConstructor | undefined ;
366+ public adapter ( v : AdapterConstructor ) : this;
367+ public adapter (
368+ v ?: AdapterConstructor
369+ ) : AdapterConstructor | undefined | this {
367370 if ( ! arguments . length ) return this . _adapter ;
368371 this . _adapter = v ;
369372 for ( const nsp of this . _nsps . values ( ) ) {
0 commit comments