@types/cors

  • Version 2.8.12
  • Published
  • 6.35 kB
  • No dependencies
  • MIT license

Install

npm i @types/cors
yarn add @types/cors
pnpm add @types/cors

Overview

TypeScript definitions for cors

Index

Functions

function e

e: <T extends e.CorsRequest = e.CorsRequest>(
options?: e.CorsOptions | e.CorsOptionsDelegate<T>
) => (
req: T,
res: {
statusCode?: number | undefined;
setHeader(key: string, value: string): any;
end(): any;
},
next: (err?: any) => any
) => void;

    Interfaces

    interface CorsOptions

    interface CorsOptions {}

      property allowedHeaders

      allowedHeaders?: string | string[] | undefined;

        property credentials

        credentials?: boolean | undefined;

          property exposedHeaders

          exposedHeaders?: string | string[] | undefined;

            property maxAge

            maxAge?: number | undefined;

              property methods

              methods?: string | string[] | undefined;
              • 'GET,HEAD,PUT,PATCH,POST,DELETE'

              property optionsSuccessStatus

              optionsSuccessStatus?: number | undefined;
              • 204

              property origin

              origin?: StaticOrigin | CustomOrigin | undefined;
              • '*''

              property preflightContinue

              preflightContinue?: boolean | undefined;
              • false

              interface CorsRequest

              interface CorsRequest {}

                property headers

                headers: IncomingHttpHeaders;

                  property method

                  method?: string | undefined;

                    Type Aliases

                    type CorsOptionsDelegate

                    type CorsOptionsDelegate<T extends CorsRequest = CorsRequest> = (
                    req: T,
                    callback: (err: Error | null, options?: CorsOptions) => void
                    ) => void;

                      Package Files (1)

                      Dependencies (0)

                      No dependencies.

                      Dev Dependencies (0)

                      No dev dependencies.

                      Peer Dependencies (0)

                      No peer dependencies.

                      Badge

                      To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                      You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/cors.

                      • Markdown
                        [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/cors)
                      • HTML
                        <a href="https://www.jsdocs.io/package/@types/cors"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>