@@ -39,7 +39,7 @@ export declare interface App {
39
39
export declare type Middleware = ( req : Request , res : Response , next : Middleware ) => void ;
40
40
export declare type ErrorHandlingMiddleware = ( error : Error , req : Request , res : Response , next : ErrorHandlingMiddleware ) => void ;
41
41
export declare type ErrorCallback = ( error ?: Error ) => void ;
42
- export declare type HandlerFunction = ( req : Request , res : Response ) => void | { } | Promise < { } > ;
42
+ export declare type HandlerFunction = ( req : Request , res : Response , next ?: NextFunction ) => void | { } | Promise < { } > ;
43
43
export declare type LoggerFunction = ( message : string ) => void ;
44
44
export declare type NextFunction = ( ) => void ;
45
45
export declare type TimestampFunction = ( ) => string ;
@@ -175,20 +175,32 @@ export declare class API {
175
175
app ( namespace : string , handler : HandlerFunction ) : App ;
176
176
app ( options : App ) : App ;
177
177
178
- get ( path : string , handler : HandlerFunction ) : void ;
179
- post ( path : string , handler : HandlerFunction ) : void ;
180
- put ( path : string , handler : HandlerFunction ) : void ;
181
- patch ( path : string , handler : HandlerFunction ) : void ;
182
- delete ( path : string , handler : HandlerFunction ) : void ;
183
- options ( path : string , handler : HandlerFunction ) : void ;
184
- head ( path : string , handler : HandlerFunction ) : void ;
185
- any ( path : string , handler : HandlerFunction ) : void ;
186
- METHOD ( method : METHODS , path : string , handler : HandlerFunction ) : void ;
187
-
188
-
189
- use ( paths : string [ ] , middleware : Middleware ) ;
190
- use ( middleware : Middleware ) ;
191
- use ( errorHandlingMiddleware : ErrorHandlingMiddleware ) ;
178
+ get ( path : string , ...handler : HandlerFunction [ ] ) : void ;
179
+ get ( ...handler : HandlerFunction [ ] ) : void ;
180
+ post ( path : string , ...handler : HandlerFunction [ ] ) : void ;
181
+ post ( ...handler : HandlerFunction [ ] ) : void ;
182
+ put ( path : string , ...handler : HandlerFunction [ ] ) : void ;
183
+ put ( ...handler : HandlerFunction [ ] ) : void ;
184
+ patch ( path : string , ...handler : HandlerFunction [ ] ) : void ;
185
+ patch ( ...handler : HandlerFunction [ ] ) : void ;
186
+ delete ( path : string , ...handler : HandlerFunction [ ] ) : void ;
187
+ delete ( ...handler : HandlerFunction [ ] ) : void ;
188
+ options ( path : string , ...handler : HandlerFunction [ ] ) : void ;
189
+ options ( ...handler : HandlerFunction [ ] ) : void ;
190
+ head ( path : string , ...handler : HandlerFunction [ ] ) : void ;
191
+ head ( ...handler : HandlerFunction [ ] ) : void ;
192
+ any ( path : string , ...handler : HandlerFunction [ ] ) : void ;
193
+ any ( ...handler : HandlerFunction [ ] ) : void ;
194
+ METHOD ( method : METHODS , path : string , ...handler : HandlerFunction [ ] ) : void ;
195
+ METHOD ( method : METHODS , ...handler : HandlerFunction [ ] ) : void ;
196
+
197
+
198
+
199
+
200
+ use ( path : string , ...middleware : Middleware [ ] ) ;
201
+ use ( paths : string [ ] , ...middleware : Middleware [ ] ) ;
202
+ use ( ...middleware : Middleware [ ] ) ;
203
+ use ( ...errorHandlingMiddleware : ErrorHandlingMiddleware [ ] ) ;
192
204
193
205
finally ( callback : FinallyFunction ) : void ;
194
206
0 commit comments