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

1.0.5 • Public • Published

Installation

npm install --save @types/restify-cors-middleware

Summary

This package contains type definitions for restify-cors-middleware (https://github.com/TabDigital/restify-cors-middleware).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/restify-cors-middleware.

index.d.ts

/// <reference types="node" />

import { RequestHandler } from "restify";

declare namespace corsMiddleware {
    interface Options {
        /**
         * an array of whitelisted origins
         * can be both strings and regular expressions
         */
        origins: Array<string | RegExp>;
        /** user defined headers to allow */
        allowHeaders: string[];
        /** user defined headers to expose */
        exposeHeaders: string[];
        /** if true, uses creds */
        credentials?: boolean | undefined;
        /** ms to cache preflight requests */
        preflightMaxAge?: number | undefined;
        /** customize preflight request handling */
        preflightStrategy?: any;
    }

    interface CorsMiddleware {
        actual: RequestHandler;
        preflight: RequestHandler;
    }
}

declare function corsMiddleware(options: corsMiddleware.Options): corsMiddleware.CorsMiddleware;
export = corsMiddleware;

Additional Details

Credits

These definitions were written by Daniel Thunell.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/restify-cors-middleware

Weekly Downloads

955

Version

1.0.5

License

MIT

Unpacked Size

4.72 kB

Total Files

5

Last publish

Collaborators

  • types