npm.io
0.0.6 • Published 2 years ago

@types/koa-cors

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

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

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

export = koaCors;

Additional Details

  • Last updated: Mon, 20 Nov 2023 2324 GMT
  • Dependencies: @types/koa

Credits

These definitions were written by Romain Faust.