UNPKG

webdev-power-kit

Version:

A powerful toolkit that simplifies access to browser features like clipboard, notifications, battery, vibration, and more — perfect for modern web developers.

14 lines (13 loc) 548 B
/** * @fileoverview Throttle utility — limits how often a function can run. * Useful for scroll events, mouse moves, resize, etc. */ type ThrottledFunction<T extends (...args: any[]) => void> = (...args: Parameters<T>) => void; /** * Creates a throttled version of the given function. * @param fn - Function to throttle * @param interval - Minimum time (in ms) between calls * @returns A throttled function */ export declare function throttle<T extends (...args: any[]) => void>(fn: T, interval: number): ThrottledFunction<T>; export {};