type Callback = (...args: any[]) => void; /** * Delay callback execution by a specified time. * Unlike debounce, subsequent calls during the delay period are ignored. * * @param cb Callback to invoke. * @param delay Time to wait before invoking the callback. * @returns A new function that schedules the callback once and ignores subsequent calls until executed. */ export declare const delay: (cb: F, delay?: number) => F; /** * Debounce callback: delays execution until calls stop. * Each new call resets the timer, so the callback fires only after the delay elapses with no further calls (trailing-edge). * Use when you want to react to the end of a burst of events (e.g. user stops typing). * * @param cb Callback to invoke. * @param delay Idle time (ms) to wait after the last call before invoking. * @returns Wrapped function that postpones invocation until activity ceases. */ export declare const debounce: (cb: F, delay?: number) => F; /** * Throttle callback: limits execution to at most once per interval. * The callback fires immediately on the first call; * subsequent calls within the same interval are dropped (leading-edge). * Use when you need regular updates at a bounded rate (e.g. scroll or resize handlers). * * @param cb Callback to invoke. * @param delay Minimum interval (ms) between successive invocations. * @returns Wrapped function that rate-limits invocations. */ export declare const throttle: (cb: F, delay?: number) => F; /** * Debounce and throttle callback. * Executes immediately on the first call (throttle), prevents calls during the throttle window, * and ensures a final call happens after activity stops (debounce). * * @param cb Callback to invoke. * @param delay Time window for both throttle and debounce. * @returns A new function that combines throttle and debounce behavior. */ export declare const debounceAndThrottle: (cb: F, delay?: number) => F; export {}; //# sourceMappingURL=debounce.d.ts.map