/** * Debounces a function, i.e. creates a wrapper that only invokes the original * once a certain amount of time has elapsed without being invoked. * * @param func The original function. * @param wait The amount of time to wait for inactivity (in milliseconds). * @param immediate If true, trigger the function on the leading edge, instead * of the trailing. Defaults to false. * @param abortSignal Optionally specify an abortSignal for the throttled * function. */ export declare function debounce(func: (...args: [...T]) => void, wait: number, immediate?: boolean, abortSignal?: AbortSignal): (...args: [...T]) => void; /** * Same as `debounce()`, but optimized for animation and rendering. * * @param func The function to debounce. * @param abortSignal Optionally specify an abortSignal for the throttled * function. */ export declare function debounceAnimation(func: (...args: [...T]) => void, abortSignal?: AbortSignal): (...args: [...T]) => void; /** * Debounces an async function that returns a promise. Creates a wrapper that * only invokes the original once a certain amount of time has elapsed without * being invoked. All calls during the debounce period share the same promise * and receive the same result. * * @param func The original async function. * @param wait The amount of time to wait for inactivity (in milliseconds) * defaults to 300. * @returns A debounced version of the function that returns a promise. */ export declare function debounceAsync(func: (...args: [...T]) => R | Promise, wait?: number): (...args: [...T]) => Promise;