//#region src/function/throttle.d.ts /** * Creates a throttled function that only invokes func at most once per every wait milliseconds. * * @template T - The type of the function to throttle * @param func - The function to throttle * @param wait - The number of milliseconds to throttle invocations to (default: 0) * @param options - The options object * @param options.leading - Specify invoking on the leading edge of the timeout (default: true) * @param options.trailing - Specify invoking on the trailing edge of the timeout (default: true) * @returns Returns the new throttled function * * @example * const throttled = throttle(() => console.log('Hello'), 1000); * throttled(); // Logs 'Hello' immediately * throttled(); // Ignored * // After 1 second, next call will be allowed * * @example * // Without leading edge * const throttled = throttle(() => console.log('Hello'), 1000, { leading: false }); * throttled(); // Waits 1 second before logging 'Hello' */ declare function throttle unknown>(func: T, wait?: number, options?: { leading?: boolean; trailing?: boolean; }): T & { cancel(): void; flush(): ReturnType; }; //#endregion export { throttle }; //# sourceMappingURL=throttle.d.mts.map