mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-20 12:00:53 +08:00
add csurf type file
This commit is contained in:
Vendored
+30
@@ -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;
|
||||
}
|
||||
|
||||
Vendored
+12
-17
@@ -8,6 +8,18 @@
|
||||
declare module Express {
|
||||
export interface Request {
|
||||
session?: any;
|
||||
|
||||
// These declarations are merged into express's Request type
|
||||
login(user: any, done: (err: any) => void): void;
|
||||
login(user: any, options: Object, done: (err: any) => void): void;
|
||||
logIn(user: any, done: (err: any) => void): void;
|
||||
logIn(user: any, options: Object, done: (err: any) => void): void;
|
||||
|
||||
logout(): void;
|
||||
logOut(): void;
|
||||
|
||||
isAuthenticated(): boolean;
|
||||
isUnauthenticated(): boolean;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,20 +80,3 @@ declare module 'passport' {
|
||||
}
|
||||
}
|
||||
|
||||
declare module Express {
|
||||
export interface Request {
|
||||
|
||||
// These declarations are merged into express's Request type
|
||||
login(user: any, done: (err: any) => void): void;
|
||||
login(user: any, options: Object, done: (err: any) => void): void;
|
||||
logIn(user: any, done: (err: any) => void): void;
|
||||
logIn(user: any, options: Object, done: (err: any) => void): void;
|
||||
|
||||
logout(): void;
|
||||
logOut(): void;
|
||||
|
||||
isAuthenticated(): boolean;
|
||||
isUnauthenticated(): boolean;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user