import { AxiosRequestConfig, AxiosError, AxiosPromise, AxiosStatic, AxiosInstance, AxiosResponse } from 'axios' import { LRUCache } from 'lru-cache' export interface ResponseValues { data?: TResponse loading: boolean error: AxiosError | null response?: AxiosResponse } export interface Options { manual?: boolean useCache?: boolean ssr?: boolean autoCancel?: boolean } export interface RefetchOptions { useCache?: boolean } export interface ConfigureOptions { axios?: AxiosInstance | AxiosStatic | any cache?: LRUCache | false defaultOptions?: Options } export interface RefetchFunction { ( config?: AxiosRequestConfig | string, options?: RefetchOptions ): AxiosPromise (e: Event): AxiosPromise } export type UseAxiosResult = [ ResponseValues, RefetchFunction, () => void ] export interface UseAxios { ( config: AxiosRequestConfig | string, options?: Options ): UseAxiosResult loadCache(data: any[]): void serializeCache(): Promise configure(options: ConfigureOptions): void resetConfigure(): void clearCache(): void // private __ssrPromises: Promise[] } declare const useAxios: UseAxios export default useAxios export function loadCache(data: any[]): void export function serializeCache(): Promise export function clearCache(): void export function configure(options: ConfigureOptions): void export function resetConfigure(): void // private export const __ssrPromises: Promise[] export function makeUseAxios(options?: ConfigureOptions): UseAxios