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

revert: change type of AxiosResponse to any (#4186)

* revert: change type of AxiosResponse to any

* types: add back default types

My bad xD

* Remove redundant default params
This commit is contained in:
Rodry
2021-10-22 09:14:23 +01:00
committed by GitHub
parent 1025d1231a
commit 2c9cc76ee9
2 changed files with 13 additions and 13 deletions
Vendored
+12 -12
View File
@@ -15,7 +15,7 @@ export interface AxiosResponseTransformer {
} }
export interface AxiosAdapter { export interface AxiosAdapter {
(config: AxiosRequestConfig): AxiosPromise<any>; (config: AxiosRequestConfig): AxiosPromise;
} }
export interface AxiosBasicCredentials { export interface AxiosBasicCredentials {
@@ -112,7 +112,7 @@ export interface AxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'hea
headers: HeadersDefaults; headers: HeadersDefaults;
} }
export interface AxiosResponse<T = unknown, D = any> { export interface AxiosResponse<T = any, D = any> {
data: T; data: T;
status: number; status: number;
statusText: string; statusText: string;
@@ -121,7 +121,7 @@ export interface AxiosResponse<T = unknown, D = any> {
request?: any; request?: any;
} }
export interface AxiosError<T = unknown, D = any> extends Error { export interface AxiosError<T = any, D = any> extends Error {
config: AxiosRequestConfig<D>; config: AxiosRequestConfig<D>;
code?: string; code?: string;
request?: any; request?: any;
@@ -130,7 +130,7 @@ export interface AxiosError<T = unknown, D = any> extends Error {
toJSON: () => object; toJSON: () => object;
} }
export interface AxiosPromise<T = unknown> extends Promise<AxiosResponse<T>> { export interface AxiosPromise<T = any> extends Promise<AxiosResponse<T>> {
} }
export interface CancelStatic { export interface CancelStatic {
@@ -174,14 +174,14 @@ export class Axios {
response: AxiosInterceptorManager<AxiosResponse>; response: AxiosInterceptorManager<AxiosResponse>;
}; };
getUri(config?: AxiosRequestConfig): string; getUri(config?: AxiosRequestConfig): string;
request<T = unknown, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>; request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
get<T = unknown, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>; get<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
delete<T = unknown, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>; delete<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
head<T = unknown, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>; head<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
options<T = unknown, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>; options<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
post<T = unknown, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>; post<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
put<T = unknown, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>; put<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
patch<T = unknown, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>; patch<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
} }
export interface AxiosInstance extends Axios { export interface AxiosInstance extends Axios {
+1 -1
View File
@@ -296,7 +296,7 @@ axios.interceptors.response.use((response: AxiosResponse) => Promise.resolve(res
// Adapters // Adapters
const adapter: AxiosAdapter = (config: AxiosRequestConfig) => { const adapter: AxiosAdapter = (config: AxiosRequestConfig) => {
const response: AxiosResponse<any> = { const response: AxiosResponse = {
data: { foo: 'bar' }, data: { foo: 'bar' },
status: 200, status: 200,
statusText: 'OK', statusText: 'OK',