import type { Redis } from 'ioredis'; import type { IRateLimiter, NotificationType } from './notifications.types.js'; export interface RateLimitConfig { perMinute?: number; perHour?: number; perDay?: number; burstLimit?: number; burstWindowMs?: number; } export interface RateLimitStatus { allowed: boolean; remaining: { burst?: number; minute?: number; hour?: number; day?: number; }; resetAt: { burst?: number; minute?: number; hour?: number; day?: number; }; retryAfter?: number; } export interface RedisRateLimiterOptions { keyPrefix?: string; defaultLimits?: RateLimitConfig; channelLimits?: Record; enableBurstDetection?: boolean; } export declare class RedisRateLimiter implements IRateLimiter { private readonly redis?; private readonly keyPrefix; private readonly defaultLimits; private readonly channelLimits; private readonly enableBurstDetection; private static readonly MAX_MEMORY_STORE_SIZE; private readonly memoryStore; constructor(redis?: Redis | undefined, options?: RedisRateLimiterOptions); checkLimit(recipientId: string, channel: string, type?: NotificationType): Promise<{ allowed: boolean; retryAfter?: number; }>; recordSent(recipientId: string, channel: string, type?: NotificationType): Promise; reset(recipientId: string, channel?: string): Promise; checkBatch(recipients: Array<{ id: string; channel: string; type?: NotificationType; }>): Promise>; getStatus(recipientId: string, channel: string, type?: NotificationType): Promise; setCustomLimits(recipientId: string, limits: RateLimitConfig): Promise; getCustomLimits(recipientId: string): Promise; removeCustomLimits(recipientId: string): Promise; private getLimitsFor; private buildKey; private recordToRedis; private recordToMemory; private cleanupMemoryStore; private resetChannel; private resetAll; } //# sourceMappingURL=redis-rate-limiter.d.ts.map