import { type DependencyList } from "react"; export interface UseAsyncDebounceReturn { result: T | undefined; loading: boolean; error: unknown; } /** * Debounces an asynchronous callback, useful for preventing spam API calls * when a user types in a search box. It manages loading state and only * resolves the final promise after the debounce delay. * * @param callback - The asynchronous function to execute after the debounce delay. * @param delay - The debounce delay in milliseconds (default: 300). * @param dependencies - Optional explicit dependency list that triggers a re-debounce when changed. * @returns Object containing the result, loading state, and error. * * @example * ```tsx * const { result, loading, error } = useAsyncDebounce( * async () => api.get(`/search?q=${query}`), * 300, * [query] * ); * ``` */ export declare function useAsyncDebounce(callback: () => T | Promise, delay?: number, dependencies?: DependencyList): UseAsyncDebounceReturn; export default useAsyncDebounce;