type TabId = string;
export type CrashBufferAttrs = {
    tabId: TabId;
    updatedAt: number;
    sessionAttributes?: Record<string, any>;
    resourceAttributes?: Record<string, any>;
    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<void>;
    /**
     * @deprecated Prefer `getRrwebEventsWindow(...)`.
     */
    getAllEvents(): Promise<Array<any>>;
    /**
     * @deprecated Prefer `clearTab(tabId)`.
     */
    clearEvents(): Promise<void>;
    setAttrs(attrs: Omit<CrashBufferAttrs, 'updatedAt'> & {
        updatedAt?: number;
    }): Promise<void>;
    getAttrs(tabId: TabId): Promise<CrashBufferAttrs | null>;
    getAllAttrs(): Promise<CrashBufferAttrs[]>;
    /**
     * Updates `updatedAt` for the tab without clobbering existing attributes.
     */
    touchTab(tabId: TabId, updatedAt?: number): Promise<void>;
    /**
     * 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<number>;
    appendEvent(record: CrashBufferRrwebEventRecord): Promise<void>;
    appendSpans(records: CrashBufferOtelSpanRecord[]): Promise<void>;
    getRrwebEventsWindow(tabId: TabId, fromTs: number, toTs: number): Promise<CrashBufferRrwebEventRecord[]>;
    /**
     * Returns the last (highest-ts) FullSnapshot record at/before `cutoffTs`.
     * Used to keep a replayable anchor when pruning.
     */
    getLastRrwebFullSnapshotBefore(tabId: TabId, cutoffTs: number): Promise<CrashBufferRrwebEventRecord | null>;
    /**
     * 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<CrashBufferRrwebEventRecord | null>;
    getOtelSpansWindow(tabId: TabId, fromTs: number, toTs: number): Promise<CrashBufferOtelSpanRecord[]>;
    pruneOlderThan(tabId: TabId, cutoffTs: number): Promise<void>;
    /**
     * 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<void>;
    clearTab(tabId: TabId): Promise<void>;
}
export {};
//# sourceMappingURL=indexedDb.service.d.ts.map