2.2.8 • Published 6 months ago

@types/kcors v2.2.8

Weekly downloads
6,118
License
MIT
Repository
github
Last release
6 months ago

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

// Type definitions for kcors 2.2
// Project: https://github.com/koajs/cors
// Definitions by: Xavier Stouder <https://github.com/Xstoudi>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4

import * as Koa from "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: Thu, 23 Dec 2021 23:34:58 GMT
  • Dependencies: @types/koa
  • Global values: none

Credits

These definitions were written by Xavier Stouder.