2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-17 19:21:29 +03:00

fix(types): fixed CommonRequestHeadersList & CommonResponseHeadersList types to be private in commonJS; (#5503)

This commit is contained in:
Dmitriy Mozgovoy
2023-01-28 15:58:56 +02:00
committed by GitHub
parent 342c0ba9a1
commit 5a3d0a3234
3 changed files with 23 additions and 8 deletions
Vendored
+6 -2
View File
@@ -42,7 +42,7 @@ export class AxiosHeaders {
static concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
setContentType(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
getContentType(parser?: RegExp): RegExpExecArray | null;
getContentType(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
hasContentType(matcher?: AxiosHeaderMatcher): boolean;
@@ -75,10 +75,14 @@ export class AxiosHeaders {
[Symbol.iterator](): IterableIterator<[string, AxiosHeaderValue]>;
}
type CommonRequestHeadersList = 'Accept' | 'Content-Type' | 'Content-Length' | 'User-Agent' | 'Content-Encoding' | 'Authorization';
type CommonRequestHeadersList = 'Accept' | 'Content-Length' | 'User-Agent' | 'Content-Encoding' | 'Authorization';
type ContentType = AxiosHeaderValue | 'text/html' | 'text/plain' | 'multipart/form-data' | 'application/json' | 'application/x-www-form-urlencoded' | 'application/octet-stream';
export type RawAxiosRequestHeaders = Partial<RawAxiosHeaders & {
[Key in CommonRequestHeadersList]: AxiosHeaderValue;
} & {
'Content-Type': ContentType
}>;
export type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders;