export interface DebouncedFunction unknown> { (...args: Parameters): void; /** * Cancel any pending debounced invocation */ cancel: () => void; /** * Immediately invoke the callback with pending arguments, if any */ flush: () => void; } /** * A hook for debouncing callback functions with cancel and flush support. * * @param callback - The function to debounce * @param delay - The debounce delay in milliseconds (default: 500ms). * Changes are reactive. * @returns A debounced version of the callback with cancel() and flush() methods * * @example * ```tsx * const debouncedSearch = useDebounce((query) => { * fetch(`/api/search?q=${query}`); * }, 500); * * // Cancel pending search * debouncedSearch.cancel(); * * // Execute immediately * debouncedSearch.flush(); * ``` */ export declare function useDebounce any>(callback: T, delay?: number): DebouncedFunction;