@types/koa2-cors

TypeScript definitions for koa2-cors

Usage no npm install needed!

<script type="module">
  import typesKoa2Cors from 'https://cdn.skypack.dev/@types/koa2-cors';
</script>

README

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.