import type { RateLimitConfig } from '../../types/queue.js';
export type ServiceName = 'openrouter' | 'kieApi' | 'telegramBotApi';
export declare class RateLimiter {
    private config;
    private windows;
    private backoffCounts;
    constructor(config?: Partial<RateLimitConfig>);
    acquire(service: ServiceName, chatId?: string): Promise<{
        allowed: boolean;
        waitMs: number;
    }>;
    recordRequest(service: ServiceName, chatId?: string): void;
    private getPerSecondLimit;
    private getPerMinuteLimit;
    private calculateBackoff;
    getBackoffCount(service: ServiceName, chatId?: string): number;
    isMaxRetriesExceeded(service: ServiceName, maxRetries?: number, chatId?: string): boolean;
    resetBackoff(service: ServiceName, chatId?: string): void;
    updateConfig(config: Partial<RateLimitConfig>): void;
    getConfig(): RateLimitConfig;
}
export declare const rateLimiter: RateLimiter;
//# sourceMappingURL=rate-limiter.d.ts.map