export interface RateLimitDecision { allowed: boolean; /** Seconds until the window resets (for Retry-After). */ retryAfter: number; } export interface RateLimiterOptions { redisUrl?: string; /** Requests per minute per token. */ tokenLimit: number; /** Requests per minute per IP. */ ipLimit: number; keyPrefix?: string; } export declare class RateLimiter { private redis; private redisFailed; private readonly memory; private readonly opts; constructor(opts: RateLimiterOptions); /** Connect to Redis if configured. Safe to call once at boot. */ init(): Promise; /** Check both the per-token and per-IP windows. Fail-open on Redis errors. */ check(token: string | undefined, ip: string): Promise; private checkOne; private checkMemory; private pruneMemory; } //# sourceMappingURL=ratelimit.d.ts.map