import type { serviceworker } from '../dist_ts_interfaces/index.js';
type ICumulativeMetrics = serviceworker.ICumulativeMetrics;
type IEventLogEntry = serviceworker.IEventLogEntry;
type TEventType = serviceworker.TEventType;
/**
 * PersistentStore manages persistent data for the service worker:
 * - Cumulative metrics: Persist across SW restarts, reset on cache invalidation
 * - Event log: Persists across SW restarts AND cache invalidation
 */
export declare class PersistentStore {
    private static instance;
    private store;
    private initialized;
    private readonly CUMULATIVE_KEY;
    private readonly EVENT_LOG_KEY;
    private readonly MAX_EVENTS;
    private readonly MAX_AGE_DAYS;
    private readonly MAX_AGE_MS;
    private readonly SAVE_INTERVAL_MS;
    private saveInterval;
    private cumulativeMetrics;
    private isDirty;
    private constructor();
    /**
     * Gets the singleton instance
     */
    static getInstance(): PersistentStore;
    /**
     * Initializes the store and starts periodic saving
     */
    init(): Promise<void>;
    /**
     * Starts periodic saving of metrics
     */
    private startPeriodicSave;
    /**
     * Stops periodic saving
     */
    stopPeriodicSave(): void;
    /**
     * Loads cumulative metrics from store
     */
    loadCumulativeMetrics(): Promise<ICumulativeMetrics>;
    /**
     * Saves cumulative metrics to store
     */
    saveCumulativeMetrics(): Promise<void>;
    /**
     * Gets the current cumulative metrics
     */
    getCumulativeMetrics(): ICumulativeMetrics;
    /**
     * Updates cumulative metrics with session delta
     */
    updateCumulativeMetrics(delta: Partial<ICumulativeMetrics>): void;
    /**
     * Resets cumulative metrics (called on cache invalidation)
     */
    resetCumulativeMetrics(): Promise<void>;
    /**
     * Logs an event to the persistent event log
     */
    logEvent(type: TEventType, message: string, details?: Record<string, any>): Promise<void>;
    /**
     * Gets event log entries
     */
    getEventLog(options?: {
        limit?: number;
        type?: TEventType;
        since?: number;
        before?: number;
    }): Promise<{
        events: IEventLogEntry[];
        totalCount: number;
    }>;
    /**
     * Gets count of events since a timestamp
     */
    getEventCount(since: number): Promise<number>;
    /**
     * Clears all events from the log
     */
    clearEventLog(): Promise<boolean>;
    /**
     * Applies retention policy to event log:
     * - Max 10,000 events
     * - Max 30 days old
     */
    private applyRetentionPolicy;
    /**
     * Flushes pending changes (call before SW stops)
     */
    flush(): Promise<void>;
}
export declare const getPersistentStore: () => PersistentStore;
export {};
