/** * @omnifolio/rate-governor — Core Rate Limiter * * In-memory rate limiter with automatic cleanup and emergency eviction. * Works standalone for single-instance deployments; pair with a RedisAdapter * for multi-instance / Cloud Run / Kubernetes environments. * * Built by OmniFolio — https://omnifolio.app */ import type { RateLimitConfig, RateLimitResult, RateLimitStats, RedisAdapter } from './types'; /** * Check (and increment) rate limit using the in-memory store. * * This is the synchronous fast-path used for single-instance deployments * or as a fallback when Redis is unavailable. */ export declare function checkRateLimit(identifier: string, config: RateLimitConfig): RateLimitResult; /** * Check (and increment) rate limit using a RedisAdapter. * * Uses atomic INCR+EXPIRE for the hot path (1 round-trip). * Falls back to in-memory if the adapter call returns `null`. */ export declare function checkRateLimitAsync(identifier: string, config: RateLimitConfig, redis: RedisAdapter): Promise; /** Get stats about the in-memory store */ export declare function getStats(): RateLimitStats; /** Manually block an identifier for `durationMs` (default 1 hour) */ export declare function blockIdentifier(identifier: string, durationMs?: number): void; /** Unblock a previously blocked identifier */ export declare function unblockIdentifier(identifier: string): void; /** Clear all rate limit records (useful in tests) */ export declare function clearStore(): void; //# sourceMappingURL=rate-limiter.d.ts.map