File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 11import { AxiosRequestConfig , AxiosResponse , AxiosInstance } from 'axios' ;
22
3- export interface IParams {
3+ export interface IParams < T > {
44 axios ?: AxiosInstance ;
55 url : string ;
66 method ?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'PATCH' ;
@@ -11,24 +11,24 @@ export interface IParams {
1111 */
1212 filter ?: ( ) => boolean ;
1313 forceDispatchEffect ?: ( ) => boolean ;
14- customHandler ?: ( error : null | Error , response : null | AxiosResponse ) => void ;
14+ customHandler ?: ( error : null | Error , response : null | AxiosResponse < T > ) => void ;
1515}
1616
17- export interface IResponseStatus {
18- response : null | AxiosResponse ;
17+ export interface IResponseStatus < T > {
18+ response : null | AxiosResponse < T > ;
1919 error : null | Error ;
2020 loading : boolean ;
2121}
2222
23- export interface IReturns extends IResponseStatus {
23+ export interface IReturns < T > extends IResponseStatus < T > {
2424 /**
2525 * @deprecated Alias of `reFetch`
2626 */
2727 query : ( ) => number ;
2828 reFetch : ( ) => number ;
2929}
3030
31- declare const useAxios : ( params : IParams ) => IReturns ;
31+ declare const useAxios : < T = any > ( params : IParams < T > ) => IReturns < T > ;
3232export default useAxios ;
3333
3434export declare const axios : AxiosInstance ;
You can’t perform that action at this time.
0 commit comments