/** * Hook that debounces a value, delaying updates until after the specified delay. * * Useful for optimizing performance in scenarios like search inputs, API calls, * or any situation where you want to limit how often a value changes. * * @template T - The type of the value being debounced * @param value - The value to debounce * @param delay - The delay in milliseconds before the value updates * * @returns The debounced value that only updates after the delay period * * @example * ```tsx * function SearchInput() { * const [searchTerm, setSearchTerm] = useState(''); * const debouncedSearchTerm = useDebounce(searchTerm, 300); * * useEffect(() => { * if (debouncedSearchTerm) { * // This will only run 300ms after the user stops typing * searchAPI(debouncedSearchTerm); * } * }, [debouncedSearchTerm]); * * return ( * setSearchTerm(e.target.value)} * placeholder="Search..." * /> * ); * } * ``` * @see https://thibault.sh/hooks/use-debounce */ declare function useDebounce(value: T, delay: number): T; export { useDebounce };