/** * A throttled function with a cancel method. */ export interface ThrottledFunction unknown> { (...arguments_: Parameters): void; /** Cancels any pending throttled invocation. */ cancel: () => void; } /** * Creates a throttled version of the provided function that only * invokes it at most once per the specified wait period. * * @param function_ - The function to throttle. * @param wait - The minimum time between invocations in milliseconds. * @returns The throttled function with a cancel method. * * @example * ```typescript * const throttled = throttle(() => console.log("called"), 300); * throttled(); * throttled(); * throttled.cancel(); * ``` */ export declare const throttle: unknown>(function_: T, wait: number) => ThrottledFunction;