import { ProgressPromise } from '@prezly/progress-promise'; export type AsyncProgressState = { error?: undefined; loading: boolean; progress: number; value?: undefined; } | { error: Error; loading: false; progress: number; value?: undefined; } | { error?: undefined; loading: false; progress: number; value: T; }; /** * ProgressPromise variant of react-use's useAsyncFn(). * React hook that returns state and a trigger callback for a function * that returns a progress promise (or a regular promise). * @see https://streamich.github.io/react-use/?path=/story/side-effects-useasyncfn--docs */ export declare function useAsyncProgressFn(fn: () => PromiseLike | ProgressPromise | T, initialState?: AsyncProgressState): [AsyncProgressState, () => ProgressPromise];