@@ -50,6 +50,7 @@ export type HandleFunction =
5050 | NextHandleFunction
5151 | ErrorHandleFunction ;
5252export type ServerHandle = HandleFunction | http . Server ;
53+ type ListenCallback = ( ) => void ;
5354
5455type Middleware = HandleFunction | Server | http . Server ;
5556
@@ -63,13 +64,17 @@ interface Layer extends ServerStackItem {
6364}
6465
6566export interface Server extends EventEmitter {
66- ( req : http . IncomingMessage , res : http . ServerResponse , next ?: Function ) : void ;
67+ (
68+ req : http . IncomingMessage ,
69+ res : http . ServerResponse ,
70+ next ?: NextFunction ,
71+ ) : void ;
6772 route : string ;
6873 stack : ServerStackItem [ ] ;
6974 handle (
7075 req : http . IncomingMessage ,
7176 res : http . ServerResponse ,
72- next ?: Function ,
77+ next ?: NextFunction ,
7378 ) : void ;
7479 use ( fn : NextHandleFunction ) : Server ;
7580 use ( fn : HandleFunction ) : Server ;
@@ -81,12 +86,16 @@ export interface Server extends EventEmitter {
8186 port : number ,
8287 hostname ?: string ,
8388 backlog ?: number ,
84- callback ?: Function ,
89+ callback ?: ListenCallback ,
90+ ) : http . Server ;
91+ listen (
92+ port : number ,
93+ hostname ?: string ,
94+ callback ?: ListenCallback ,
8595 ) : http . Server ;
86- listen ( port : number , hostname ?: string , callback ?: Function ) : http . Server ;
87- listen ( path : string , callback ?: Function ) : http . Server ;
88- listen ( options : ListenOptions , callback ?: Function ) : http . Server ;
89- listen ( handle : unknown , listeningListener ?: Function ) : http . Server ;
96+ listen ( path : string , callback ?: ListenCallback ) : http . Server ;
97+ listen ( options : ListenOptions , callback ?: ListenCallback ) : http . Server ;
98+ listen ( handle : unknown , listeningListener ?: ListenCallback ) : http . Server ;
9099}
91100
92101/**
0 commit comments