type TabId = string; export type CrashBufferAttrs = { tabId: TabId; updatedAt: number; sessionAttributes?: Record; resourceAttributes?: Record; userAttributes?: any; }; export type CrashBufferRrwebEventRecord = { id?: number; tabId: TabId; ts: number; isFullSnapshot?: boolean; event: any; }; export type CrashBufferOtelSpanRecord = { id?: number; tabId: TabId; ts: number; span: any; }; export declare class IndexedDBService { private dbPromise; constructor(); private openDB; /** * @deprecated Prefer `appendEvent(tabId, ...)` and `getRrwebEventsWindow(...)`. * This writes into the legacy store with no pruning semantics. */ saveEvent(event: any): Promise; /** * @deprecated Prefer `getRrwebEventsWindow(...)`. */ getAllEvents(): Promise>; /** * @deprecated Prefer `clearTab(tabId)`. */ clearEvents(): Promise; setAttrs(attrs: Omit & { updatedAt?: number; }): Promise; getAttrs(tabId: TabId): Promise; getAllAttrs(): Promise; /** * Updates `updatedAt` for the tab without clobbering existing attributes. */ touchTab(tabId: TabId, updatedAt?: number): Promise; /** * Best-effort garbage collection for orphaned tabs. * Deletes all data for tabs whose `attrs.updatedAt` is older than `maxAgeMs`. */ sweepStaleTabs(maxAgeMs: number, now?: number): Promise; appendEvent(record: CrashBufferRrwebEventRecord): Promise; appendSpans(records: CrashBufferOtelSpanRecord[]): Promise; getRrwebEventsWindow(tabId: TabId, fromTs: number, toTs: number): Promise; /** * Returns the last (highest-ts) FullSnapshot record at/before `cutoffTs`. * Used to keep a replayable anchor when pruning. */ getLastRrwebFullSnapshotBefore(tabId: TabId, cutoffTs: number): Promise; /** * Returns the last (highest-ts) Meta event record at/before `cutoffTs`. * * rrweb replays expect the stream to begin with: * - Meta * - FullSnapshot * * We persist packed events (plus a small wrapper) so we detect Meta via `record.event.eventType`. */ getLastRrwebMetaBefore(tabId: TabId, cutoffTs: number): Promise; getOtelSpansWindow(tabId: TabId, fromTs: number, toTs: number): Promise; pruneOlderThan(tabId: TabId, cutoffTs: number): Promise; /** * Prune older data while keeping rrweb replayability: * - rrweb: keep the last Meta + FullSnapshot pair at/before cutoff as an "anchor" * - spans: prune strictly by cutoff */ pruneOlderThanWithRrwebSnapshotAnchor(tabId: TabId, cutoffTs: number): Promise; clearTab(tabId: TabId): Promise; } export {}; //# sourceMappingURL=indexedDb.service.d.ts.map