import { DependencyList } from 'react'; export interface AsyncEffectInit { /** * Do something async! */ execute: (signal: AbortSignal) => Promise; /** * Registers a callback to execute when the async handler resolves. Analagous * to `Promise.then`. */ onFulfilled?: ((value: ResultType) => void) | null; /** * Registers a callback to execute when the async handler rejects. Analagous * to `Promise.catch`. */ onRejected?: ((reason: any) => void) | null; /** * Registers a callback to execute when the async handler completes, whether * successfully or not. Analagous to `Promise.finally`. */ onSettled?: (() => void) | null; /** * Registers a callback to execute when the underlying `React.useEffect` is * cleaned up. */ onCleanup?: (() => void) | null; } /** * Makes asynchronous work inside the React lifecycle easy with automatic guards * against updating internal component state if the component is unmounted * before the async work is finished. */ export declare function useAsyncEffect(initFactory: AsyncEffectInit | (() => AsyncEffectInit), deps?: DependencyList): void;