UNPKG

@fe6/water-pro

Version:

An enterprise-class UI design language and Vue-based implementation

17 lines (16 loc) 645 B
/** @format */ export interface DebounceAndThrottleOptions { immediate?: boolean; debounce?: boolean; once?: boolean; } export declare type CancelFn = () => void; export declare type DebounceAndThrottleProcedure<T extends unknown[]> = (...args: T) => unknown; export declare type DebounceAndThrottleProcedureResult<T extends unknown[]> = [ DebounceAndThrottleProcedure<T>, CancelFn ]; /** * @description: Applicable in components */ export declare function useDebounce<T extends unknown[]>(handle: DebounceAndThrottleProcedure<T>, wait: number, options?: DebounceAndThrottleOptions): DebounceAndThrottleProcedureResult<T>;