mirror of
https://github.com/tenrok/axios.git
synced 2026-06-11 18:02:32 +03:00
typings: allow custom return types
response interceptor might change the type from AxiosResponse to anything they like
This commit is contained in:
committed by
Khaled Garbaya
parent
0b3db5d87a
commit
73cab975f0
Vendored
+7
-7
@@ -109,13 +109,13 @@ export interface AxiosInstance {
|
||||
request: AxiosInterceptorManager<AxiosRequestConfig>;
|
||||
response: AxiosInterceptorManager<AxiosResponse>;
|
||||
};
|
||||
request<T = any>(config: AxiosRequestConfig): AxiosPromise<T>;
|
||||
get<T = any>(url: string, config?: AxiosRequestConfig): AxiosPromise<T>;
|
||||
delete<T = any>(url: string, config?: AxiosRequestConfig): AxiosPromise<T>;
|
||||
head<T = any>(url: string, config?: AxiosRequestConfig): AxiosPromise<T>;
|
||||
post<T = any>(url: string, data?: any, config?: AxiosRequestConfig): AxiosPromise<T>;
|
||||
put<T = any>(url: string, data?: any, config?: AxiosRequestConfig): AxiosPromise<T>;
|
||||
patch<T = any>(url: string, data?: any, config?: AxiosRequestConfig): AxiosPromise<T>;
|
||||
request<T = any, R = AxiosResponse<T>> (config: AxiosRequestConfig): Promise<R>;
|
||||
get<T = any, R = AxiosResponse<T>>(url: string, config?: AxiosRequestConfig): Promise<R>;
|
||||
delete<T = any, R = AxiosResponse<T>>(url: string, config?: AxiosRequestConfig): Promise<R>;
|
||||
head<T = any, R = AxiosResponse<T>>(url: string, config?: AxiosRequestConfig): Promise<R>;
|
||||
post<T = any, R = AxiosResponse<T>>(url: string, data?: any, config?: AxiosRequestConfig): Promise<R>;
|
||||
put<T = any, R = AxiosResponse<T>>(url: string, data?: any, config?: AxiosRequestConfig): Promise<R>;
|
||||
patch<T = any, R = AxiosResponse<T>>(url: string, data?: any, config?: AxiosRequestConfig): Promise<R>;
|
||||
}
|
||||
|
||||
export interface AxiosStatic extends AxiosInstance {
|
||||
|
||||
Reference in New Issue
Block a user