Neurosis Prevention Mechanism

    @types/koa2-cors
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.2 • Public • Published

    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

    // Type definitions for koa2-cors 2.0
    // Project: https://github.com/zadzbw/koa2-cors#readme
    // Definitions by: xialeistudio <https://github.com/xialeistudio>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    // TypeScript Version: 2.3
    
    import * as Koa from '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: Thu, 08 Jul 2021 16:23:26 GMT
    • Dependencies: @types/koa
    • Global values: none

    Credits

    These definitions were written by xialeistudio.

    Keywords

    none

    Install

    npm i @types/koa2-cors

    DownloadsWeekly Downloads

    8,557

    Version

    2.0.2

    License

    MIT

    Unpacked Size

    4.08 kB

    Total Files

    4

    Last publish

    Collaborators

    • types