/**
 * Persistent Queue Implementation
 *
 * Extends the priority queue with file-based persistence.
 * Survives process restarts and provides recovery capabilities.
 */
import { PriorityQueue, PriorityItem, PriorityQueueOptions, PriorityLevel } from './priority-queue';
export interface PersistentQueueOptions extends PriorityQueueOptions {
    /** Directory to store queue data */
    storageDir?: string;
    /** Filename for queue persistence */
    filename?: string;
    /** Whether to auto-save on every operation */
    autoSave?: boolean;
    /** Save interval in ms (if not auto-saving every operation) */
    saveInterval?: number;
    /** Whether to compress stored data */
    compress?: boolean;
}
export interface SerializedQueue<T> {
    version: number;
    createdAt: string;
    lastSavedAt: string;
    items: SerializedQueueItem<T>[];
    stats: {
        processed: number;
        failed: number;
    };
}
export interface SerializedQueueItem<T> {
    id: string;
    data: T;
    enqueuedAt: string;
    attempts: number;
    lastAttemptAt?: string;
    priority: PriorityLevel;
    priorityValue: number;
    metadata?: Record<string, unknown>;
}
/**
 * Persistent Priority Queue
 */
export declare class PersistentQueue<T = unknown> extends PriorityQueue<T> {
    protected persistOptions: Required<PersistentQueueOptions>;
    protected storageFilePath: string;
    protected saveTimer?: NodeJS.Timeout;
    protected dirty: boolean;
    protected initialized: boolean;
    constructor(options?: PersistentQueueOptions);
    /**
     * Ensure storage directory exists
     */
    protected ensureStorageDir(): void;
    /**
     * Load queue from disk
     */
    load(): boolean;
    /**
     * Save queue to disk
     */
    save(): boolean;
    /**
     * Start auto-save timer
     */
    protected startAutoSave(): void;
    /**
     * Stop auto-save timer
     */
    protected stopAutoSave(): void;
    /**
     * Mark queue as dirty (needs saving)
     */
    protected markDirty(): void;
    /**
     * Override enqueue to persist
     */
    enqueuePriority(data: T, priority?: PriorityLevel, metadata?: Record<string, unknown>): PriorityItem<T> | null;
    /**
     * Override dequeue to persist
     */
    dequeue(): PriorityItem<T> | undefined;
    /**
     * Override removeById to persist
     */
    removeById(id: string): boolean;
    /**
     * Override clear to persist
     */
    clear(): number;
    /**
     * Override updatePriority to persist
     */
    updatePriority(id: string, priority: PriorityLevel): boolean;
    /**
     * Delete persisted queue file
     */
    deleteStorage(): boolean;
    /**
     * Get storage file path
     */
    getStoragePath(): string;
    /**
     * Check if storage file exists
     */
    hasStoredData(): boolean;
    /**
     * Get storage file info
     */
    getStorageInfo(): {
        exists: boolean;
        path: string;
        size: number;
        lastModified: Date | null;
    };
    /**
     * Export queue to a specific file
     */
    exportTo(filePath: string): boolean;
    /**
     * Import queue from a file
     */
    importFrom(filePath: string, merge?: boolean): boolean;
    /**
     * Create a backup of the current queue
     */
    backup(): string | null;
    /**
     * List available backups
     */
    listBackups(): string[];
    /**
     * Restore from a backup
     */
    restoreFromBackup(backupPath: string): boolean;
    /**
     * Dispose and cleanup
     */
    dispose(): void;
    /**
     * Format persistent queue status
     */
    formatStatus(): string;
}
/**
 * Create a persistent queue with custom settings
 */
export declare function createPersistentQueue<T>(options?: PersistentQueueOptions): PersistentQueue<T>;
export default PersistentQueue;
