@types/csurf
TypeScript icon, indicating that this package has built-in type declarations

1.11.5 • Public • Published

Installation

npm install --save @types/csurf

Summary

This package contains type definitions for csurf (https://www.npmjs.org/package/csurf).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/csurf.

index.d.ts

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;

Additional Details

Credits

These definitions were written by Hiroki Horiuchi, and Piotr Błażejewicz.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/csurf

Weekly Downloads

220,136

Version

1.11.5

License

MIT

Unpacked Size

4.23 kB

Total Files

5

Last publish

Collaborators

  • types