feat(typings): expose return type of useAxios

This commit is contained in:
TOYAMA Nao 2021-03-28 13:06:08 +09:00
parent e4241d69a8
commit 3273ba1fba

18
src/index.d.ts vendored
View File

@ -31,18 +31,20 @@ export interface ConfigureOptions {
defaultOptions?: Options
}
export type UseAxiosResult<TResponse = any, TError = any> = [
ResponseValues<TResponse, TError>,
(
config?: AxiosRequestConfig,
options?: RefetchOptions
) => AxiosPromise<TResponse>,
() => void
]
export interface UseAxios {
<TResponse = any, TError = any>(
config: AxiosRequestConfig | string,
options?: Options
): [
ResponseValues<TResponse, TError>,
(
config?: AxiosRequestConfig,
options?: RefetchOptions
) => AxiosPromise<TResponse>,
() => void
]
): UseAxiosResult<TResponse, TError>
loadCache(data: any[]): void
serializeCache(): Promise<any[]>