/** * Async retry state */ export type AsyncRetryState = { loading: boolean; error: Error | undefined; value: T | undefined; retryCount: number; }; /** * Hook that provides async function execution with retry capability * * @template TArgs - The argument types for the async function * @template TResult - The return type of the async function * @param fn - Async function to execute * @param options - Retry options * @returns Tuple of [state, callback, retry] * * @example * ```tsx * const [state, fetchUser, retry] = useAsyncRetry( * async (userId: string) => { * const response = await fetch(`/api/users/${userId}`); * if (!response.ok) throw new Error('Failed to fetch'); * return response.json(); * }, * { retries: 3, retryDelay: attempt => attempt * 1000 } * ); * * // Later... * const handleClick = () => { * fetchUser('123'); * }; * * // Or retry the last call * const handleRetry = () => { * retry(); * }; * ``` */ export declare function useAsyncRetry(function_: (...args: TArguments) => Promise, options?: { retries?: number; retryDelay?: number | ((attempt: number) => number); }): [ AsyncRetryState, (...args: TArguments) => Promise, () => Promise ]; //# sourceMappingURL=useAsyncRetry.d.ts.map