/** * Throttle Utility * * Creates a throttled version of a function that executes immediately * on the first call (leading edge), then suppresses subsequent calls * within the interval, firing once more after the interval with the * latest arguments if any calls were made during the wait (trailing edge). */ type AnyFunction = (...args: any[]) => void; interface ThrottledFunction { (...args: Parameters): void; cancel: () => void; flush: () => void; isPending: () => boolean; } /** * Creates a throttled function that invokes func at most once per * interval. The first call executes immediately (leading edge). * Subsequent calls during the interval are coalesced, and the * function fires once more after the interval with the latest * arguments (trailing edge). * * @param func - The function to throttle * @param interval - The minimum time between executions in milliseconds * @returns A throttled version of the function with cancel, flush, and isPending methods */ export declare function throttle(func: T, interval: number): ThrottledFunction; export {};