0.0.6 • Published 6 months ago

@types/koa-cors v0.0.6

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

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

// Type definitions for koa-cors 0.0
// Project: https://github.com/evert0n/koa-cors
// Definitions by: Romain Faust <https://github.com/romain-faust>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

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 | ReadonlyArray<string> | undefined;
        headers?: string | ReadonlyArray<string> | undefined;
        maxAge?: number | undefined;
        methods?: string | ReadonlyArray<string> | undefined;
        origin?: boolean | string | ((request: Request) => string) | undefined;
    }
}

export = koaCors;

Additional Details

  • Last updated: Tue, 20 Jul 2021 18:01:29 GMT
  • Dependencies: @types/koa
  • Global values: none

Credits

These definitions were written by Romain Faust.