From 86d70c1d4075e27193db549b7ca3aa298717d8ed Mon Sep 17 00:00:00 2001 From: Serhii Sol Date: Wed, 28 Dec 2016 01:50:52 +0100 Subject: [PATCH] fix(express-serve-static-core): fix#10910 fixed application use argument does not match parameters (#13487) --- express-serve-static-core/index.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/express-serve-static-core/index.d.ts b/express-serve-static-core/index.d.ts index 932b8075b1..42f1a535f7 100644 --- a/express-serve-static-core/index.d.ts +++ b/express-serve-static-core/index.d.ts @@ -856,6 +856,10 @@ interface RequestParamHandler { (req: Request, res: Response, next: NextFunction, value: any, name: string): any; } +type ApplicaitonRequestHandler = IRouterHandler & IRouterMatcher & { + (...handlers: RequestHandlerParams[]): T; +}; + interface Application extends IRouter, Express.Application { /** * Express instance itself is a request handler, which could be invoked without @@ -1096,10 +1100,12 @@ interface Application extends IRouter, Express.Application { * Used to get all registered routes in Express Application */ _router: any; + + use: ApplicaitonRequestHandler; } interface Express extends Application { request: Request; response: Response; -} \ No newline at end of file +}