import type { FnPs, Fns, Option, Positive } from '@chzky/core'; type ThrottlingReturn = Option ? (R extends void ? never : R) : never>; /** ## `throttle` : 函数节流 + 在一段时间内(`delay`ms)只允许目标函数执行一次 @example Usage ```ts let res = 0 // normal-call const fn = throttle((a: number, b: number) => { res += a + b }, 200) // curry-call const fn2 = throttle(100)((c: number, d: number) => { res += c + d return res }) fn(1, 2) fn(2, 1) fn(2, 4) assert(res === 3) await sleep(200) fn(2, 2) fn(3, 3) assert(res === 7) assert(fn2(1, 2).unwrap() === 10) assert(fn2(3, 2).is_none) fn2(4, 45) assert(res === 10) ``` @category Async */ export declare function throttle(delay: Positive): >(fn: T) => FnPs, ThrottlingReturn>; export declare function throttle, D extends number>(fn: T, delay: Positive): FnPs, ThrottlingReturn>; export {}; //# sourceMappingURL=throttle.d.ts.map