Skip to content

Commit

Permalink
fix(types): allow to specify partial default headers for instance cre…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
lukashroch committed Oct 13, 2021
1 parent 1025d12 commit 2d1b305
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ export interface AxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'hea
headers: HeadersDefaults;
}

export interface CreateAxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
headers: Partial<HeadersDefaults>;
}

export interface AxiosResponse<T = unknown, D = any> {
data: T;
status: number;
Expand Down Expand Up @@ -190,7 +194,7 @@ export interface AxiosInstance extends Axios {
}

export interface AxiosStatic extends AxiosInstance {
create(config?: AxiosRequestConfig): AxiosInstance;
create(config?: CreateAxiosDefaults): AxiosInstance;
Cancel: CancelStatic;
CancelToken: CancelTokenStatic;
Axios: typeof Axios;
Expand Down

0 comments on commit 2d1b305

Please sign in to comment.