From 6c53d6db838df0f93e9d270fd30a4db2023c3df4 Mon Sep 17 00:00:00 2001 From: George Valotasios Date: Fri, 13 Dec 2013 11:21:17 +0100 Subject: [PATCH] Redifine IRouter method signatures with in the Application interface to return an Application object --- express/express.d.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/express/express.d.ts b/express/express.d.ts index dc5ddc730..69601df9e 100644 --- a/express/express.d.ts +++ b/express/express.d.ts @@ -1135,6 +1135,32 @@ declare module "express" { * simply by removing them from this object. */ routes: any; + + + /** + * IRouter definition + */ + param(name: string, fn: Function): Application; + + param(name: any[], fn: Function): Application; + + all(path: string, fn?: (req: Request, res: Response, next: Function) => any): Application; + + get(name: string, ...handlers: RequestFunction[]): Application; + + get(name: RegExp, ...handlers: RequestFunction[]): Application; + + post(name: string, ...handlers: RequestFunction[]): Application; + + post(name: RegExp, ...handlers: RequestFunction[]): Application; + + put(name: string, ...handlers: RequestFunction[]): Application; + + put(name: RegExp, ...handlers: RequestFunction[]): Application; + + del(name: string, ...handlers: RequestFunction[]): Application; + + del(name: RegExp, ...handlers: RequestFunction[]): Application; } interface Express extends Application { @@ -1797,6 +1823,7 @@ declare module "express" { function urlencoded(): any; function multipart(): any; + } export = e;