import { DependencyList } from 'react'; export interface AsyncState { pending: boolean; error?: Error; result?: T; } export interface AsyncActions { start: (...args: any[]) => Promise; cancel: () => void; } export declare type AsyncFn = [AsyncState, AsyncActions]; /** * Hook that returns state and a callback for an `async` function or a function that returns a promise. * The state is of the same shape as `useAsync`. */ export declare const useAsyncFn: (fn: (...args: any[]) => Promise, deps?: DependencyList, initialState?: Partial> | undefined) => AsyncFn;