import type { FunctionCallback } from "@gaopeng123/utils.ts-types"; declare type ThrottleFunction = FunctionCallback; /** * @desc 函数节流 * @param fn 函数 * @param timeout 延迟执行毫秒数 * @param type 1 表时间戳版,2 表定时器版 */ export declare type ThrottleOptions = { /** * 1 时间戳记录 2 setTimeout版本 * 时间戳版本第一次会执行 leading为true setTimeout 尾部会执行一次 trailing为true */ type?: 1 | 2; leading?: boolean; trailing?: boolean; notThrottle?: (...arg: T) => void; clearTimeout?: (val: any) => any; }; export declare const createThrottle: (fn: FunctionCallback, wait: number, options: ThrottleOptions, timeout: any) => FunctionCallback; /** * 获取默认参数 * @param options */ export declare const throttleOptions: (options?: ThrottleOptions) => { type: number; leading: boolean; } & ThrottleOptions; export declare const throttle: (fn: FunctionCallback, wait?: number, options?: ThrottleOptions) => FunctionCallback; export {};