npm.io
2.2.9 • Published 11 months ago

@types/kcors

Licence
MIT
Version
2.2.9
Deps
1
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/kcors

Summary

This package contains type definitions for kcors (https://github.com/koajs/cors).

Details

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

index.d.ts

import Koa = require("koa");

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

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

Additional Details

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

Credits

These definitions were written by Xavier Stouder.