forked from schonfeld/csurf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
39 lines (35 loc) · 1.1 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Type definitions for csurf 1.11
// Project: https://www.npmjs.org/package/csurf
// Definitions by: Hiroki Horiuchi <https://github.com/horiuchi>
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
//
// Pasted and Tweaked by: Francis Okoyo <https://github.com/francisokoyo>
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;
ignoreRoutes?: string[] | undefined;
ignoreRoutePatterns?: RegExp[] | undefined;
sessionKey?: string | undefined;
}): express.RequestHandler;
declare namespace csurf {
interface CookieOptions extends express.CookieOptions {
/**
* @default '_csrf'
*/
key?: string | undefined;
}
}
export = csurf;