npm.io
2.0.6 • Published 11 months ago

@types/koa2-cors

Licence
MIT
Version
2.0.6
Deps
1
Size
3 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/koa2-cors

Summary

This package contains type definitions for koa2-cors (https://github.com/zadzbw/koa2-cors#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa2-cors.

index.d.ts

import Koa = require("koa");
declare namespace cors {
    interface Options {
        origin?: string | ((ctx: Koa.Context) => boolean | string) | undefined;
        exposeHeaders?: string[] | undefined;
        maxAge?: number | undefined;
        credentials?: boolean | undefined;
        allowMethods?: string[] | undefined;
        allowHeaders?: string[] | undefined;
    }
}

declare function cors(options?: cors.Options): Koa.Middleware;

export = cors;

Additional Details

  • Last updated: Fri, 24 Oct 2025 0441 GMT
  • Dependencies: @types/koa

Credits

These definitions were written by xialeistudio.