/** * Rate Limiter for controlling API call frequency */ export interface RateLimiterConfig { maxCallsPerHour: number; maxCallsPerMinute: number; warningThreshold: number; } export interface RateLimiterStats { callsThisMinute: number; callsThisHour: number; minuteLimit: number; hourLimit: number; isWarning: boolean; isBlocked: boolean; nextAvailableAt?: Date; } export declare const DEFAULT_RATE_LIMITER_CONFIG: RateLimiterConfig; export declare class RateLimiter { private config; private callTimestamps; constructor(config?: Partial); /** * Clean up old timestamps outside the tracking window */ private cleanup; /** * Get calls within a time window */ private getCallsInWindow; /** * Check if we can make a call (doesn't record the call) */ canMakeCall(): boolean; /** * Record a call (should be called after making an API call) */ recordCall(): void; /** * Try to acquire permission to make a call * @returns true if call is allowed, false if rate limited */ tryAcquire(): boolean; /** * Wait until we can make a call, then acquire * @param maxWaitMs Maximum time to wait (default: 5 minutes) * @returns true if acquired, false if timeout */ waitAndAcquire(maxWaitMs?: number): Promise; /** * Get time until next call is available */ getWaitTime(): number; /** * Get current rate limiter statistics */ getStats(): RateLimiterStats; /** * Format stats for display */ formatStats(): string; /** * Reset the rate limiter */ reset(): void; /** * Update configuration */ updateConfig(config: Partial): void; } //# sourceMappingURL=rate-limiter.d.ts.map