2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-21 13:24:11 +03:00

Change headers type to string record (#3021)

This correctly reflects the type in a more type safe manner.

Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
Remco Haszing
2021-09-05 14:14:12 +02:00
committed by GitHub
parent 92b29d2775
commit 90205f8ab7
Vendored
+3 -3
View File
@@ -1,5 +1,5 @@
export interface AxiosTransformer {
(data: any, headers?: any): any;
(data: any, headers?: Record<string, string>): any;
}
export interface AxiosAdapter {
@@ -53,7 +53,7 @@ export interface AxiosRequestConfig<T = any> {
baseURL?: string;
transformRequest?: AxiosTransformer | AxiosTransformer[];
transformResponse?: AxiosTransformer | AxiosTransformer[];
headers?: any;
headers?: Record<string, string>;
params?: any;
paramsSerializer?: (params: any) => string;
data?: T;
@@ -84,7 +84,7 @@ export interface AxiosResponse<T = never> {
data: T;
status: number;
statusText: string;
headers: any;
headers: Record<string, string>;
config: AxiosRequestConfig<T>;
request?: any;
}