mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
[express]: RequestHandler's 3rd argument fix (#11288)
* [express]: RequestHandler's 3rd argument fix It is hot optional. Btw, express instance itself is a request handler, which can be invoked without 3rd argument, so, as for now it has call signature with only 2 arguments: request and response. Fixes #11164 * Move 2-args call signature to Application interface
This commit is contained in:
committed by
Masahiro Wakame
parent
e971807506
commit
7007fddc5e
@@ -22,7 +22,7 @@ declare module "express-serve-static-core" {
|
||||
}
|
||||
|
||||
interface RequestHandler {
|
||||
(req: Request, res: Response, next?: NextFunction): any;
|
||||
(req: Request, res: Response, next: NextFunction): any;
|
||||
}
|
||||
|
||||
interface ErrorRequestHandler {
|
||||
@@ -822,6 +822,12 @@ declare module "express-serve-static-core" {
|
||||
}
|
||||
|
||||
interface Application extends IRouter, Express.Application {
|
||||
/**
|
||||
* Express instance itself is a request handler, which could be invoked without
|
||||
* third argument.
|
||||
*/
|
||||
(req: Request, res: Response): any;
|
||||
|
||||
/**
|
||||
* Initialize the server.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user