$ cnpm install @types/csurf
npm install --save @types/csurf
This package contains type definitions for csurf (https://www.npmjs.org/package/csurf).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/csurf.
import express = require("express-serve-static-core");
declare global {
namespace Express {
interface Request {
csrfToken(): string;
}
}
}
declare function csurf(options?: {
value?: ((req: express.Request) => string) | undefined;
/**
* @default false
*/
cookie?: csurf.CookieOptions | boolean | undefined;
ignoreMethods?: string[] | undefined;
sessionKey?: string | undefined;
}): express.RequestHandler;
declare namespace csurf {
interface CookieOptions extends express.CookieOptions {
/**
* @default '_csrf'
*/
key?: string | undefined;
}
}
export = csurf;
These definitions were written by Hiroki Horiuchi, and Piotr Błażejewicz.
Copyright 2013 - present © cnpmjs.org | Home |