From 080bd81147ed1244da025f2da12ae2f68462a1c3 Mon Sep 17 00:00:00 2001 From: Humberto Machado Date: Sat, 3 Sep 2016 20:24:23 -0300 Subject: [PATCH 1/3] Add _router definition in Application. Using to get all registred routes --- express-serve-static-core/express-serve-static-core.d.ts | 5 +++++ 1 file changed, 5 insertions(+) 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 93551ffece..e80ffa85a9 100644 --- a/express-serve-static-core/express-serve-static-core.d.ts +++ b/express-serve-static-core/express-serve-static-core.d.ts @@ -1046,6 +1046,11 @@ declare module "express-serve-static-core" { * simply by removing them from this object. */ routes: any; + + /** + * Using to all registered routes in Express Application + */ + _router: any; } interface Express extends Application { From c81e53488b9053b9d211b2a3bf381a9c6ed58ce1 Mon Sep 17 00:00:00 2001 From: Humberto Machado Date: Fri, 16 Sep 2016 08:41:30 -0300 Subject: [PATCH 2/3] Add stack property to Router. Used to list all configured routes in express Router instance --- express-serve-static-core/express-serve-static-core.d.ts | 4 ++++ 1 file changed, 4 insertions(+) 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 e80ffa85a9..f0cc9669ad 100644 --- a/express-serve-static-core/express-serve-static-core.d.ts +++ b/express-serve-static-core/express-serve-static-core.d.ts @@ -97,6 +97,10 @@ declare module "express-serve-static-core" { use: IRouterHandler & IRouterMatcher; route(prefix: PathParams): IRoute; + /** + * Stack of configured routes + */ + stack: any[]; } interface IRoute { From 2d08ea98c9e95f23754c5cd6f33598a444d7ef13 Mon Sep 17 00:00:00 2001 From: Humberto Machado Date: Fri, 16 Sep 2016 08:48:06 -0300 Subject: [PATCH 3/3] Fix comment --- express-serve-static-core/express-serve-static-core.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f0cc9669ad..624ed5ae5d 100644 --- a/express-serve-static-core/express-serve-static-core.d.ts +++ b/express-serve-static-core/express-serve-static-core.d.ts @@ -1052,7 +1052,7 @@ declare module "express-serve-static-core" { routes: any; /** - * Using to all registered routes in Express Application + * Used to get all registered routes in Express Application */ _router: any; }