@types/koa-cors
Version:
TypeScript definitions for koa-cors
36 lines (27 loc) • 1.2 kB
Markdown
# 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.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-cors/index.d.ts)
````ts
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 | readonly string[] | undefined;
headers?: string | readonly string[] | undefined;
maxAge?: number | undefined;
methods?: string | readonly string[] | undefined;
origin?: boolean | string | ((request: Request) => string) | undefined;
}
}
export = koaCors;
````
### Additional Details
* Last updated: Mon, 20 Nov 2023 23:36:24 GMT
* Dependencies: [@types/koa](https://npmjs.com/package/@types/koa)
# Credits
These definitions were written by [Romain Faust](https://github.com/romain-faust).