Installation
npm install --save @types/koa-cors
Summary
This package contains type definitions for koa-cors (https://github.com/evert0n/koa-cors).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-cors.
import { Context, Middleware, Request } from "koa";
declare function koaCors(options?: koaCors.Options): Middleware;
declare namespace koaCors {
interface Options {
credentials?: true | ((ctx: Context) => boolean) | undefined;
expose?: string | ReadonlyArray<string> | undefined;
headers?: string | ReadonlyArray<string> | undefined;
maxAge?: number | undefined;
methods?: string | ReadonlyArray<string> | undefined;
origin?: boolean | string | ((request: Request) => string) | undefined;
}
}
export = koaCors;
Additional Details
- Last updated: Tue, 07 Nov 2023 09:09:38 GMT
- Dependencies: @types/koa
Credits
These definitions were written by Romain Faust.