/** debounce:函数防抖 * @params * func「function,required」:最后要执行的函数 * wait「number」:设定的频发触发的频率时间,默认值是300 * immediate「boolean」:设置是否是开始边界触发,默认值是false,true:第一次触发,false:最后一次触发 * @return * func执行的返回结果 * @describe 触发事件后在 n 秒内函数只能执行一次,如果在 n 秒内又触发了事件,则会重新计算函数执行时间。 */ export type Options = { isImmediate?: boolean; maxWait?: number; callback?: (data: Result) => void; }; export interface DebouncedFunction any> { (this: ThisParameterType, ...args: Args & Parameters): Promise>; cancel: (reason?: any) => void; } export declare function debounce any>(func: F, waitMilliseconds?: number, options?: Options>): DebouncedFunction;