5.0.4 • Published 2 years ago
@types/koa-csrf v5.0.4
Installation
npm install --save @types/koa-csrf
Summary
This package contains type definitions for koa-csrf (https://github.com/koajs/csrf).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-csrf.
index.d.ts
// Type definitions for koa-csrf 3.0
// Project: https://github.com/koajs/csrf
// Definitions by: Haskaalo <https://github.com/haskaalo>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/* =================== USAGE ===================
import * as koaCsrf from 'koa-csrf';
import * as Koa from "koa";
const app = new Koa();
app.use(new koaCsrf({
invalidSessionSecretMessage: 'Invalid session secret',
invalidSessionSecretStatusCode: 403,
invalidTokenMessage: 'Invalid CSRF token',
invalidTokenStatusCode: 403,
excludedMethods: [ 'GET', 'HEAD', 'OPTIONS' ],
disableQuery: false
}));
=============================================== */
export = koaCsrf;
import { Middleware } from 'koa';
declare module "koa" {
interface Context {
csrf: string;
}
}
declare const koaCsrf: {
new (opts?: {
invalidSessionSecretMessage?: string | undefined;
invalidSessionSecretStatusCode?: number | undefined;
invalidTokenMessage?: string | undefined;
invalidTokenStatusCode?: number | undefined;
excludedMethods?: string[] | undefined;
disableQuery?: boolean | undefined;
}): Middleware;
};
Additional Details
- Last updated: Thu, 08 Jul 2021 16:23:20 GMT
- Dependencies: @types/koa
- Global values: none
Credits
These definitions were written by Haskaalo.