import { Duration } from "./duration.js"; import { DecoratorReplacementMethod, DecoratorTargetMethod, MethodDecoratorContext } from "./decorator-helpers.js"; /** * Creates a throttle decorator that limits how often a method can be called. * Ensures a minimum time between executions, dropping calls that occur too frequently. * * @param delay - The minimum time that must pass between executions * @returns A method decorator that implements throttling behavior * @throws ArgumentException if delay is not a positive Duration * * @example * ```typescript * class Example { * @throttle(Duration.fromSeconds(1)) * async handleScroll(): Promise { * // This will execute at most once per second * // Additional calls within the second will be ignored * console.log('Scroll event processed'); * } * } * ``` */ export declare function throttle, Return extends Promise | void>(delay: Duration): ThrottleMethodDecorator; export declare function throttle, Return extends Promise | void>(target: DecoratorTargetMethod, context: MethodDecoratorContext): DecoratorReplacementMethod; export type ThrottleMethodDecorator, Return extends Promise | void> = (target: DecoratorTargetMethod, context: MethodDecoratorContext) => DecoratorReplacementMethod; //# sourceMappingURL=throttle.d.ts.map