/** * Custom hook for throttling function calls with trailing execution * * @param fn - The function to throttle * @param delay - The throttle delay in milliseconds * @returns A throttled version of the function * * Features: * - Throttles function calls to at most once per delay period * - Ensures trailing execution: if calls happen during throttle window, * the last call executes at the end of the window * - Proper cleanup on component unmount * - Handles rapid successive calls by using the latest arguments * * @example * ```tsx * const sendReaction = useCallback(async (emoji: string) => { * await send({ type: emoji }); * }, [send]); * * const throttledSend = useThrottle(sendReaction, 200); * * // Usage * throttledSend('👍'); // Will execute at end of 200ms window * throttledSend('❤️'); // Will override previous call * throttledSend('😂'); // Will execute with '😂' after 200ms * ``` */ export declare function useThrottle(fn: (...args: Args) => R, delay: number): (...args: Args) => R;