/** * Types for Throttle Pattern */ import { Logger } from "./common"; /** * Options for throttle pattern */ export interface ThrottleOptions { /** * Function to throttle */ execute: (...args: TArgs) => Promise | TResult; /** * Minimum interval between executions in milliseconds * @default 1000 */ interval?: number; /** * Execute on leading edge (immediately on first call) * @default true */ leading?: boolean; /** * Execute on trailing edge (after interval expires) * @default true */ trailing?: boolean; /** * Logger */ logger?: Logger; /** * Callback when execution is throttled (skipped) */ onThrottled?: () => void; /** * Callback when execution happens */ onExecute?: (...args: TArgs) => void; } /** * Throttled function with utility methods */ export interface ThrottledFunction { (...args: TArgs): Promise; cancel(): void; flush(): Promise; } //# sourceMappingURL=throttle.d.ts.map