import { Duration } from "./duration.js"; /** * Creates a synchronize decorator that ensures only one instance of a method runs at a time. * Uses a mutex to prevent concurrent execution of the decorated method. * * @param delay - Optional delay between executions after the mutex is released * @returns A method decorator that implements synchronization behavior * @throws ArgumentException if delay is not a positive Duration * * @example * ```typescript * class Example { * @synchronize(Duration.fromSeconds(1)) * async updateResource(): Promise { * // This will ensure only one update happens at a time * // Other calls will wait for the current one to complete * await this.database.update(data); * } * } * ``` */ export declare function synchronize>(delay: Duration): SynchronizeMethodDecorator; export declare function synchronize>(target: SynchronizeDecoratorTargetMethod, context: SynchronizeDecoratorContext): SynchronizeDecoratorReplacementMethod; export type SynchronizeDecoratorTargetMethod> = (this: This, ...args: Args) => any; export type SynchronizeDecoratorReplacementMethod> = (this: This, ...args: Args) => Promise; export type SynchronizeDecoratorContext> = ClassMethodDecoratorContext>; export type SynchronizeMethodDecorator> = (value: SynchronizeDecoratorTargetMethod, context: SynchronizeDecoratorContext) => SynchronizeDecoratorReplacementMethod; //# sourceMappingURL=synchronize.d.ts.map