/** * 滑动窗口速率限制器 — 使用环形缓冲区,O(1) 摊销复杂度 */ export declare class RollingWindowRateLimiter { private readonly windowMs; private readonly maxRequests; private readonly burstLimit; /** 环形缓冲区存储时间戳 */ private ring; /** 写入指针 */ private head; /** 有效元素数量 */ private count; constructor(windowMs?: number, maxRequests?: number, burstLimit?: number); tryAcquire(): boolean; stats(): { windowCount: number; windowMs: number; maxRequests: number; }; destroy(): void; /** 从尾部驱逐过期条目 */ private evictExpired; /** 统计最近 1s 内的请求数 */ private burstCount; } //# sourceMappingURL=rate-limiter.d.ts.map