export interface RecentEventDeduplicatorOptions { /** 事件在窗口内保留的最长时间。 */ ttlMs?: number; /** 防止异常流量让内存无限增长。 */ maxEntries?: number; /** 测试或特殊运行时可注入单调时钟。 */ now?: () => number; } /** * 有界的进程内事件去重窗口。 * * 检查与提交刻意分离:调用方应只在 canonical 处理成功后调用 commit, * 这样上游重投仍能恢复一次失败的事件处理。 */ export declare class RecentEventDeduplicator { private readonly entries; private readonly ttlMs; private readonly maxEntries; private readonly now; constructor(options?: RecentEventDeduplicatorOptions); has(key: TKey): boolean; commit(key: TKey): void; private prune; }