UNPKG

@coolio/http

Version:
19 lines (18 loc) 762 B
export declare enum ContentType { BINARY = "application/octet-stream", JSON = "application/json", MULTIPART_FORM = "multipart/form-data", TEXT = "text/plain", URL_ENCODED = "application/x-www-form-urlencoded", VND_JSON = "application/vnd.api+json" } export declare const ContentTypeRegex: { JSON: RegExp; MULTIPART: RegExp; TEXT: RegExp; URL_ENCODED: RegExp; }; export declare type ContentTypeMap<T> = Record<keyof typeof ContentTypeRegex, T>; export declare function switchContentType<T>(contentType: string, map: ContentTypeMap<T>, defaultResult: T): T; export declare function switchContentType<T>(contentType: string, map: ContentTypeMap<T>): T | undefined; //# sourceMappingURL=contentType.d.ts.map