export interface DebounceOptions { /** * Call function on the leading edge of the timeout. * Defaults to false. */ leading?: boolean; /** * Call function on the trailing edge of the timeout. * Defaults to true. */ trailing?: boolean; /** * Maximum time the function can be delayed before it's invoked. * Useful to ensure eventual execution even with continuous calls. */ maxWait?: number; } export interface DebouncedFunction unknown> { (...args: Parameters): ReturnType | undefined; /** Cancel any pending invocation */ cancel: () => void; /** Immediately invoke any pending invocation */ flush: () => ReturnType | undefined; /** Check if there's a pending invocation */ pending: () => boolean; } /** * Create a debounced function that delays invoking func until after wait ms * have elapsed since the last time the debounced function was invoked. * * @param fn - The function to debounce * @param wait - The number of milliseconds to delay * @param options - Debounce options * @returns Debounced function * * @example * const debounced = debounceFast(saveInput, 300) * input.addEventListener('input', debounced) * * @example * // With leading edge * const debounced = debounceFast(onClick, 300, { leading: true, trailing: false }) */ export declare function debounceFast unknown>(fn: T, wait: number, options?: DebounceOptions): DebouncedFunction; //# sourceMappingURL=debounce.d.ts.map