mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
30 lines
693 B
TypeScript
30 lines
693 B
TypeScript
// Type definitions for csurf
|
|
// Project: https://www.npmjs.org/package/csurf
|
|
// 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 | boolean;
|
|
}): express.RequestHandler;
|
|
|
|
module csurf {
|
|
export interface CookieOptions extends express.CookieOptions {
|
|
key: string;
|
|
}
|
|
}
|
|
|
|
export = csurf;
|
|
}
|