Permalink
Browse files

almost working

  • Loading branch information...
1 parent 8534b4c commit c2113e5fc0af2f6742bb63be169a819e844daeb9 @seanhess committed Nov 14, 2012
Showing with 20 additions and 12 deletions.
  1. +19 −11 Definitions/express-3.0.d.ts
  2. +1 −1 Tests/express-tests.ts
@@ -93,13 +93,21 @@ declare module _express {
listen(handle: any, listeningListener?: Function): void;
get(name: string): any;
- get(path: string, handler: (req: ServerRequest, res: ServerResponse) => void ): void;
- get(path: RegExp, handler: (req: ServerRequest, res: ServerResponse) => void ): void;
- get(path: string, callbacks: any, callback: () => void ): void;
+ get(path: string, handler: Handler ): void;
+ get(path: RegExp, handler: Handler ): void;
+ get(path: string, ...callbacks: Handler[]): void;
- post(path: string, handler: (req: ServerRequest, res: ServerResponse) => void ): void;
- post(path: RegExp, handler: (req: ServerRequest, res: ServerResponse) => void ): void;
- post(path: string, callbacks: any, callback: () => void ): void;
+ post(path: string, handler: Handler ): void;
+ post(path: RegExp, handler: Handler ): void;
+ post(path: string, ...callbacks: Handler[]): void;
+
+ put(path: string, handler: Handler ): void;
+ put(path: RegExp, handler: Handler ): void;
+ put(path: string, ...callbacks: Handler[]): void;
+
+ del(path: string, handler: Handler ): void;
+ del(path: RegExp, handler: Handler ): void;
+ del(path: string, ...callbacks: Handler[]): void;
}
export interface ServerRequest extends http.ServerRequest {
@@ -197,11 +205,6 @@ declare module _express {
}
declare module "express" {
- export interface ServerApplication extends _express.ServerApplication {}
- export interface ServerRequest extends _express.ServerRequest {}
- export interface ServerResponse extends _express.ServerResponse {}
- export interface Handler extends _express.Handler {}
-
export function (): _express.ServerApplication;
export function createServer(): ServerApplication;
export function static(path: string): any;
@@ -211,4 +214,9 @@ declare module "express" {
export function bodyParser(options?: any): Handler;
export function errorHandler(opts?: any): Handler;
export function methodOverride(): Handler;
+
+ export interface ServerApplication extends _express.ServerApplication {}
+ export interface ServerRequest extends _express.ServerRequest {}
+ export interface ServerResponse extends _express.ServerResponse {}
+ export interface Handler extends _express.Handler {}
}
View
@@ -238,4 +238,4 @@ function test_middleware() {
app.use(express.cookieSession());
app.use(express.directory('public'));
app.use(express.static('public'));
-}
+}

0 comments on commit c2113e5

Please sign in to comment.