add csurf type file

This commit is contained in:
Horiuchi_H
2014-08-19 19:35:30 +09:00
parent 17f8e5aca2
commit a422e8fc07
2 changed files with 42 additions and 17 deletions
+30
View File
@@ -0,0 +1,30 @@
// Type definitions for csurf
// Project: http://expressjs.com
// Definitions by: Hiroki Horiuchi <https://github.com/horiuchi/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../express/express.d.ts" />
declare module Express {
export interface Request {
csrfToken(): string;
}
}
declare module "csurf" {
import express = require('express');
function csurf(options?: {
value?: (req: express.Request) => string;
cookie?: csurf.CookieOptions;
}): express.RequestHandler;
module csurf {
export interface CookieOptions extends express.CookieOptions {
key: string;
}
}
export = csurf;
}