export declare interface RateLimitEntry { attempts: number lockedUntil: number } /** * Pluggable backing store for the auth rate limiter. * * Methods may be sync or async — the limiter awaits them either way. The * default {@link MemoryStore} is process-local (fine for single-instance and * dev). On a horizontally-scaled deployment the in-memory store is trivially * bypassed by spreading attempts across instances, so production should swap * in a shared store via `RateLimiter.useSharedStore()` (cache-backed; becomes * cluster-wide when the cache driver is Redis) or a custom `useStore()`. */ export declare interface RateLimiterStore { get: (key: string) => Promise | RateLimitEntry | undefined set: (key: string, entry: RateLimitEntry, ttlMs: number) => Promise | void delete: (key: string) => Promise | void } /** Process-local store — the default. */ declare class MemoryStore implements RateLimiterStore { get(key: string): RateLimitEntry | undefined; set(key: string, entry: RateLimitEntry): void; delete(key: string): void; } /** * Cache-backed store. Cross-instance when the configured cache driver is * Redis; otherwise behaves like an in-memory store with TTL eviction. Entries * carry a TTL so attempts decay automatically — no separate eviction pass. */ declare class CacheStore implements RateLimiterStore { get(key: string): Promise; set(key: string, entry: RateLimitEntry, ttlMs: number): Promise; delete(key: string): Promise; } export declare class RateLimiter { static useStore(custom: RateLimiterStore): void; static useSharedStore(): void; static useMemoryStore(): void; static isRateLimited(email: string): Promise; static recordFailedAttempt(email: string): Promise; static resetAttempts(email: string): Promise; static validateAttempt(email: string): Promise; }