import { Observable } from "rxjs"; import { NostrEvent } from "../helpers/event.js"; import { IExpirationManager } from "./interface.js"; /** Manages expiration state for events with expiration tags */ export declare class ExpirationManager implements IExpirationManager { /** A stream of event IDs that have expired */ readonly expired$: Observable; /** Internal subject for expired$ observable */ private expiredSubject; /** Maps event ID to expiration timestamp */ private expirations; /** Current timeout for the next expiration check */ private timer; /** Timestamp of the next expiration check */ private nextCheck; constructor(); /** * Add an event to the expiration manager if it has an expiration tag * @param event The event to track for expiration */ track(event: NostrEvent): void; /** * Remove an event from expiration tracking * @param eventId The ID of the event to remove */ forget(eventId: string): void; /** * Check if an event is expired * @param event The event to check * @returns true if the event has expired, false otherwise */ check(event: NostrEvent): boolean; /** * Tears down the manager: cancels any pending timer and completes the expired$ stream * @note This is a terminal operation; the manager should be discarded after calling it. */ dispose(): void; /** Allows the manager to be used with the `using` keyword */ [Symbol.dispose](): void; /** * Remove expired events from the store and emit them */ private emitNotifications; }