/** * @description returns throttled function or value * the last one always returns last-call value in the end if no more new calls were provided * @example * import { useThrottleFunction, useThrottleValue } from '../../composables' * ... * const localThrottledFunction = useThrottleFunction(functionToThrottle, props) * const localThrottledValue = useThrottleValue(reactiveValueToThrottle, props) */ import { Ref, ExtractPropTypes } from 'vue'; type ThrottledFunctionArgs = any[]; type ThrottledFunction = (...args: ThrottledFunctionArgs) => Output; export declare const useThrottleProps: { delay: { type: NumberConstructor; default: number; validator: (value: number) => boolean; }; }; type UseThrottleProps = ExtractPropTypes; /** * @param fn passed function to throttle * @param props { delay } call delay in ms */ export declare function useThrottleFunction(fn: ThrottledFunction, props: UseThrottleProps): (this: any, ...args: ThrottledFunctionArgs) => Output; /** * @param value passed reactive value to throttle * @param props { delay } call delay in ms */ export declare function useThrottleValue(value: Ref, props: UseThrottleProps): Ref; export {};