diff --git a/express-serve-static-core/express-serve-static-core.d.ts b/express-serve-static-core/express-serve-static-core.d.ts index 624ed5ae5d..0371c2bb6a 100644 --- a/express-serve-static-core/express-serve-static-core.d.ts +++ b/express-serve-static-core/express-serve-static-core.d.ts @@ -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. *