fix(express-serve-static-core): fix#10910 fixed application use argument does not match parameters (#13487)

This commit is contained in:
Serhii Sol
2016-12-27 19:50:52 -05:00
committed by Andy
parent 80dad1d73d
commit 86d70c1d40
+7 -1
View File
@@ -856,6 +856,10 @@ interface RequestParamHandler {
(req: Request, res: Response, next: NextFunction, value: any, name: string): any;
}
type ApplicaitonRequestHandler<T> = IRouterHandler<T> & IRouterMatcher<T> & {
(...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<this>;
}
interface Express extends Application {
request: Request;
response: Response;
}
}