[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:
Artur Eshenbrener
2016-09-23 16:43:52 +04:00
committed by Masahiro Wakame
parent e971807506
commit 7007fddc5e

View File

@@ -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.
*