2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-20 20:00:40 +03:00

fix(types): allow to specify partial default headers for instance creation (#4185)

Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
Lukas Hroch
2022-05-09 19:03:05 +01:00
committed by GitHub
parent 356b166182
commit ac96144dd3
2 changed files with 10 additions and 1 deletions
Vendored
+5 -1
View File
@@ -137,6 +137,10 @@ export interface AxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'hea
headers: HeadersDefaults;
}
export interface CreateAxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
headers?: AxiosRequestHeaders | Partial<HeadersDefaults>;
}
export interface AxiosResponse<T = any, D = any> {
data: T;
status: number;
@@ -254,7 +258,7 @@ export interface GenericFormData {
}
export interface AxiosStatic extends AxiosInstance {
create(config?: AxiosRequestConfig): AxiosInstance;
create(config?: CreateAxiosDefaults): AxiosInstance;
Cancel: CancelStatic;
CancelToken: CancelTokenStatic;
Axios: typeof Axios;