2.8.17 • Published 2 years ago

@types/cors v2.8.17

Weekly downloads
3
License
MIT
Repository
github
Last release
2 years ago

Installation

npm install --save @types/cors

Summary

This package contains type definitions for cors (https://github.com/expressjs/cors/).

Details

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

index.d.ts

// Type definitions for cors 2.8
// Project: https://github.com/expressjs/cors/
// Definitions by: Alan Plum <https://github.com/pluma>
//                 Gaurav Sharma <https://github.com/gtpan77>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

import { IncomingHttpHeaders } from 'http';

type StaticOrigin = boolean | string | RegExp | (boolean | string | RegExp)[];

type CustomOrigin = (requestOrigin: string | undefined, callback: (err: Error | null, origin?: StaticOrigin) => void) => void;

declare namespace e {
    interface CorsRequest {
        method?: string | undefined;
        headers: IncomingHttpHeaders;
    }
    interface CorsOptions {
        /**
         * @default '*''
         */
        origin?: StaticOrigin | CustomOrigin | undefined;
        /**
         * @default 'GET,HEAD,PUT,PATCH,POST,DELETE'
         */
        methods?: string | string[] | undefined;
        allowedHeaders?: string | string[] | undefined;
        exposedHeaders?: string | string[] | undefined;
        credentials?: boolean | undefined;
        maxAge?: number | undefined;
        /**
         * @default false
         */
        preflightContinue?: boolean | undefined;
        /**
         * @default 204
         */
        optionsSuccessStatus?: number | undefined;
    }
    type CorsOptionsDelegate<T extends CorsRequest = CorsRequest> = (
        req: T,
        callback: (err: Error | null, options?: CorsOptions) => void,
    ) => void;
}

declare function 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;
export = e;

Additional Details

  • Last updated: Fri, 09 Jul 2021 07:31:29 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Alan Plum, and Gaurav Sharma.

engine.ioapollo-server-express@withjoy/server-core@wistoft/jagoa@wistoft/jagos@wistoft/jase@neuvernetzung/cms@jeje-devs/ts-roller@debian404/common@atomist/automation-clientsomryst-apipadlocksambients-serveropenapi-typescript-node-merged-latest1@mote/api-server@makeproaudio/makehausgamiphy-service-coreer-notifications-api@nuragic/apollo-server-express@nuragic/apollo-server-koatiles-api-client-nodejsslack-middleware-serverpackage-ughmikro-orm-graphql-exampleapi.bio.adludio.comrentacar-proxymanbulloo-graphql-access-layeropenapi-typescript-node-sku1@sdoubey/rxdbpiral-compass-basearch-helper@box-labs/microservice-corestk-server@darwin_/proxy@jessitron/automation-clientalekseyio-blog-sdkcraftprofitweb@jadiewadie/simple-serveruhc-public-api-nodejskallax-rest@prelog/libraryrestfuel@aacruz/api-serverudiamshimeyezonreact_whj_design@mui/studio-app@labshare/loopback-restdecentral-games-mobile-serverbusiness_serviceclv-restystarter-ts-projecthypertell-server@dimetrail/firebase@quantform/expressdev387-seven-clijwt-express-mysql-typeorm-template-typescriptjed-libraryspeed-ts@everything-registry/sub-chunk-946mam-app-packageauth-14system-pandatbc-contacts-graphql-apitanyatenshijster4-base-backnodejstest-graphql-yoga-nlkowolkenkitweb-tobi-2-appworker_threads_clusterswutubung-gatsbyws-sdexhip-serverrhythmchatbackendsunraystelen-apisph-entitiesstarfield-ts-modloaderspataxx.protestmodule.microservice.apitest-rxdbswiss-armytida-frameworkvcr.jsvcr.js-nextvespervesper-jbpittsvideo-transcoder@dolphjs/core@docsploit/espress@discorde/datamodel@code-journal/local-api@creatio-tech/graphql-core@cuku/local-api@daimo/api@daleighan-dsp/common@comfortcooker/core@cv-dev/cv-auth@cortical/core
2.8.17

2 years ago

2.8.16

2 years ago

2.8.15

2 years ago

2.8.14

2 years ago

2.8.13

3 years ago

2.8.12

4 years ago

2.8.11

4 years ago

2.8.10

4 years ago

2.8.9

5 years ago

2.8.8

5 years ago

2.8.7

5 years ago

2.8.6

6 years ago

2.8.5

6 years ago

2.8.4

7 years ago

2.8.3

8 years ago

2.8.2

8 years ago

2.8.1

8 years ago

2.8.0

8 years ago

0.0.33

9 years ago

0.0.32

9 years ago

0.0.31

9 years ago

0.0.30

9 years ago

0.0.29

9 years ago

0.0.28-alpha

9 years ago

0.0.27-alpha

9 years ago

0.0.26-alpha

9 years ago

0.0.25-alpha

9 years ago

0.0.24-alpha

9 years ago

0.0.23-alpha

9 years ago

0.0.22-alpha

9 years ago

0.0.17-alpha

9 years ago

0.0.16-alpha

9 years ago