import { DependencyList } from 'react'; export type UseAsyncProps = { /** The async callback or an array of async callbacks to call for fetching data. */ callback: (() => TReturnType | Promise) | Array<() => TReturnType | Promise>; /** The default value to populate the data as when initially mounted or reloading data. */ defaultValue: TReturnType | TDefaultValueType; /** Optional toggle to ignore previous async callback data */ ignorePrevious?: boolean; }; /** * Hook for invoking async code and keeping track of its state. * * Data is loaded in 3 different ways: * 1. On initial mount. * 2. When any of the `deps` change. * 3. When the `reload` function is called. */ export declare const useAsync: ({ callback, defaultValue, ignorePrevious }: UseAsyncProps, deps: DependencyList) => { data: TReturnType | TDefaultValueType; error: Error | null; isLoading: boolean; reload: () => void; };