/** * In-memory rate-limit store for hazo_api. * * Moved here from hazo_secure/ratelimit per D-014: rate limiting consolidates * in hazo_api. hazo_secure keeps its implementation for one major version with * a @deprecated JSDoc, then drops it in hazo_secure@2.0.0. */ interface RateLimitState { count: number; resetAt: number; } interface RateLimitStore { get(key: string): Promise; /** max is optional for backward compat; ConnectRateLimitStore requires it. */ increment(key: string, windowMs: number, max?: number): Promise; reset(key: string): Promise; } interface MemoryStoreOptions { now?: () => number; sweepIntervalMs?: number; } declare class MemoryRateLimitStore implements RateLimitStore { private readonly map; private readonly now; private sweepTimer; constructor(opts?: MemoryStoreOptions); get(key: string): Promise; increment(key: string, windowMs: number, _max?: number): Promise; reset(key: string): Promise; size(): number; sweep(): void; stop(): void; } declare function getDefaultMemoryStore(): MemoryRateLimitStore; export { MemoryRateLimitStore, type MemoryStoreOptions, type RateLimitState, type RateLimitStore, getDefaultMemoryStore };