/** * Debounce a function * * Take Note, the debounced function also contains a "cancel" and "flush" method * "cancel": Allows clearing the timeout * "flush": Allows immediately executing the debounced function if pending * * Example Usage: * * const log = (message: string) => console.log(message); * * const debouncedLog = debounce(log, 2000); * * debouncedLog("Hello, World!"); * debouncedLog.cancel(); * debouncedLog.flush(); * * @param {Function} fn - Function to debounce * @param {number} wait - Amount of time to debounce the function for */ declare function debounce any>(fn: T, wait: number): T & { cancel: () => void; flush: () => void; }; export { debounce, debounce as default };