diff --git a/index.d.cts b/index.d.cts index c386ae82..8f086191 100644 --- a/index.d.cts +++ b/index.d.cts @@ -345,55 +345,15 @@ declare namespace axios { protocol?: string; } - type Method = - | 'get' - | 'GET' - | 'delete' - | 'DELETE' - | 'head' - | 'HEAD' - | 'options' - | 'OPTIONS' - | 'post' - | 'POST' - | 'put' - | 'PUT' - | 'patch' - | 'PATCH' - | 'purge' - | 'PURGE' - | 'link' - | 'LINK' - | 'unlink' - | 'UNLINK'; + type UppercaseMethod = "GET" | "DELETE" | "HEAD" | "OPTIONS" | "POST" | "PUT" | "PATCH" | "PURGE" | "LINK" | "UNLINK"; + + type Method = (UppercaseMethod | Lowercase) & {}; type ResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream' | 'formdata'; - type responseEncoding = - | 'ascii' - | 'ASCII' - | 'ansi' - | 'ANSI' - | 'binary' - | 'BINARY' - | 'base64' - | 'BASE64' - | 'base64url' - | 'BASE64URL' - | 'hex' - | 'HEX' - | 'latin1' - | 'LATIN1' - | 'ucs-2' - | 'UCS-2' - | 'ucs2' - | 'UCS2' - | 'utf-8' - | 'UTF-8' - | 'utf8' - | 'UTF8' - | 'utf16le' - | 'UTF16LE'; + type UppercaseResponseEncoding = "ASCII" | "ANSI" | "BINARY" | "BASE64" | "BASE64URL" | "HEX" | "LATIN1" | "UCS-2" | "UCS2" | "UTF-8" | "UTF8" | "UTF16LE"; + + type responseEncoding = (UppercaseResponseEncoding | Lowercase) & {}; interface TransitionalOptions { silentJSONParsing?: boolean; diff --git a/index.d.ts b/index.d.ts index af25bd44..935356cd 100644 --- a/index.d.ts +++ b/index.d.ts @@ -272,27 +272,9 @@ export enum HttpStatusCode { NetworkAuthenticationRequired = 511, } -export type Method = - | "get" - | "GET" - | "delete" - | "DELETE" - | "head" - | "HEAD" - | "options" - | "OPTIONS" - | "post" - | "POST" - | "put" - | "PUT" - | "patch" - | "PATCH" - | "purge" - | "PURGE" - | "link" - | "LINK" - | "unlink" - | "UNLINK"; +type UppercaseMethod = "GET" | "DELETE" | "HEAD" | "OPTIONS" | "POST" | "PUT" | "PATCH" | "PURGE" | "LINK" | "UNLINK"; + +export type Method = (UppercaseMethod | Lowercase) & {}; export type ResponseType = | "arraybuffer" @@ -303,31 +285,9 @@ export type ResponseType = | "stream" | "formdata"; -export type responseEncoding = - | "ascii" - | "ASCII" - | "ansi" - | "ANSI" - | "binary" - | "BINARY" - | "base64" - | "BASE64" - | "base64url" - | "BASE64URL" - | "hex" - | "HEX" - | "latin1" - | "LATIN1" - | "ucs-2" - | "UCS-2" - | "ucs2" - | "UCS2" - | "utf-8" - | "UTF-8" - | "utf8" - | "UTF8" - | "utf16le" - | "UTF16LE"; +type UppercaseResponseEncoding = "ASCII" | "ANSI" | "BINARY" | "BASE64" | "BASE64URL" | "HEX" | "LATIN1" | "UCS-2" | "UCS2" | "UTF-8" | "UTF8" | "UTF16LE"; + +export type responseEncoding = (UppercaseResponseEncoding | Lowercase) & {}; export interface TransitionalOptions { silentJSONParsing?: boolean;