mirror of
https://github.com/simoneb/axios-hooks.git
synced 2025-12-08 21:25:56 +00:00
feat(typings): expose return type of useAxios
This commit is contained in:
parent
e4241d69a8
commit
3273ba1fba
18
src/index.d.ts
vendored
18
src/index.d.ts
vendored
@ -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[]>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user