import type { AnyFunction } from '../@types'; declare type LooseArray = [...T, ...any[]]; export declare const iife: (fn: T, ...args: [...Parameters, ...any[]]) => ReturnType; /** * Generate a one-off function for a given function. * @param fn - The function to generate a one-off function for. * @param callback - The callback to call when the one-off function is called twice or more. */ export declare const once: (fn: T, callback?: ((times: number) => void) | undefined) => (...args: [...Parameters, ...any[]]) => ReturnType; declare type SimpleDebounce = (fn: T, ms: number) => (...args: LooseArray>) => void; export declare const debounceS: SimpleDebounce; declare type Debounce = (fn: T, ms: number) => (...args: LooseArray>) => Promise>; export declare const debounce: Debounce; declare type SimpleThrottleTime = (fn: T, ms: number, strict?: boolean) => (...args: LooseArray>) => void; /** * @param [strict = false] If true, the window of target function be invoked will * greater than maxium of specified ms and target function's * execution time. If false, just greater than specified ms. * @return { Function } Throttled function */ export declare const throttleTimeS: SimpleThrottleTime; declare type SimpleThrottle = (fn: T, ms: number) => (...args: LooseArray>) => void; export declare const throttleS: SimpleThrottle; declare type ThrottleTime = (fn: T, ms: number, strict?: boolean) => (...args: LooseArray>) => Promise>; /** * @param [strict = false] If true, the window of target function be invoked will * greater than maxium of specified ms and target function's * execution time. If false, just greater than specified ms. * @return { Function } Throttled function */ export declare const throttleTime: ThrottleTime; declare type Throttle = (fn: T) => (...args: LooseArray>) => Promise>; export declare const throttle: Throttle; export {}; //# sourceMappingURL=function.d.ts.map