@@ -3,7 +3,7 @@ export interface AxiosTransformer {
33}
44
55export interface AxiosAdapter {
6- ( config : AxiosRequestConfig ) : AxiosPromise ;
6+ ( config : AxiosRequestConfig ) : AxiosPromise < any > ;
77}
88
99export interface AxiosBasicCredentials {
@@ -44,8 +44,8 @@ export interface AxiosRequestConfig {
4444 cancelToken ?: CancelToken ;
4545}
4646
47- export interface AxiosResponse {
48- data : any ;
47+ export interface AxiosResponse < T = any > {
48+ data : T ;
4949 status : number ;
5050 statusText : string ;
5151 headers : any ;
@@ -59,7 +59,7 @@ export interface AxiosError extends Error {
5959 response ?: AxiosResponse ;
6060}
6161
62- export interface AxiosPromise extends Promise < AxiosResponse > {
62+ export interface AxiosPromise < T = any > extends Promise < AxiosResponse < T > > {
6363}
6464
6565export interface CancelStatic {
@@ -101,13 +101,13 @@ export interface AxiosInstance {
101101 request : AxiosInterceptorManager < AxiosRequestConfig > ;
102102 response : AxiosInterceptorManager < AxiosResponse > ;
103103 } ;
104- request ( config : AxiosRequestConfig ) : AxiosPromise ;
105- get ( url : string , config ?: AxiosRequestConfig ) : AxiosPromise ;
104+ request < T = any > ( config : AxiosRequestConfig ) : AxiosPromise < T > ;
105+ get < T = any > ( url : string , config ?: AxiosRequestConfig ) : AxiosPromise < T > ;
106106 delete ( url : string , config ?: AxiosRequestConfig ) : AxiosPromise ;
107107 head ( url : string , config ?: AxiosRequestConfig ) : AxiosPromise ;
108- post ( url : string , data ?: any , config ?: AxiosRequestConfig ) : AxiosPromise ;
109- put ( url : string , data ?: any , config ?: AxiosRequestConfig ) : AxiosPromise ;
110- patch ( url : string , data ?: any , config ?: AxiosRequestConfig ) : AxiosPromise ;
108+ post < T = any > ( url : string , data ?: any , config ?: AxiosRequestConfig ) : AxiosPromise < T > ;
109+ put < T = any > ( url : string , data ?: any , config ?: AxiosRequestConfig ) : AxiosPromise < T > ;
110+ patch < T = any > ( url : string , data ?: any , config ?: AxiosRequestConfig ) : AxiosPromise < T > ;
111111}
112112
113113export interface AxiosStatic extends AxiosInstance {
0 commit comments