/** * Background cleanup task for expired checkpoints. * * Runs periodically to delete checkpoints that have passed their TTL, * keeping the storage clean without manual intervention. */ import type { CheckpointStorage } from './types'; /** * Options for checkpoint cleanup task. */ export interface CheckpointCleanupOptions { /** Interval between cleanup runs in milliseconds. Default: 1 hour */ intervalMs?: number; } /** * Background task for TTL-based checkpoint cleanup. * * Usage: * ```typescript * const cleanup = new CheckpointCleanupTask(storage); * cleanup.start(); // Begins periodic cleanup * cleanup.stop(); // Stops cleanup (call on shutdown) * ``` */ export declare class CheckpointCleanupTask { private storage; private intervalMs; private timer?; private running; /** Default cleanup interval: 1 hour in milliseconds */ static readonly DEFAULT_INTERVAL_MS = 3600000; constructor(storage: CheckpointStorage, options?: CheckpointCleanupOptions); /** * Start the periodic cleanup task. * Safe to call multiple times (no-op if already running). */ start(): void; /** * Stop the periodic cleanup task. */ stop(): void; /** * Run cleanup once (can be called manually or scheduled). * Returns number of deleted checkpoints. */ runOnce(): Promise; /** * Check if the task is currently running. */ isRunning(): boolean; private runCleanup; } //# sourceMappingURL=cleanup.d.ts.map