/** * Backup Workflow * * Handles backup creation, restoration, and management */ import { type RestoreOptions } from '../infrastructure/backup.js'; /** * Backup type */ export type BackupType = 'plugins' | 'config' | 'full'; /** * Backup metadata */ export interface BackupMetadata { filename: string; path: string; type: BackupType; created: Date; size: number; fileCount?: number; description?: string; } /** * Backup progress event */ export interface BackupProgress { phase: 'scanning' | 'compressing' | 'writing' | 'done' | 'error'; current?: number; total?: number; filename?: string; message?: string; } /** * Backup workflow options */ export interface BackupWorkflowOptions { backupDir: string; maxBackups?: number; description?: string; onProgress?: (progress: BackupProgress) => void; /** * Optional AbortSignal — backup creation/restore checks signal at the * tar-stream boundary and aborts cleanly. Phase 3 audit, finding API [11]. * * NOTE: Currently used only for surface-API consistency with sync/migrate/ * download. Tar streaming itself doesn't expose mid-stream cancellation * cleanly; honored at workflow setup + completion phases only. */ signal?: AbortSignal; } /** * Backup workflow class */ export declare class BackupWorkflow { private options; constructor(options: BackupWorkflowOptions); /** * Create a backup of a directory */ create(sourceDir: string, type?: BackupType): Promise; private createInternal; /** * Restore a backup */ restore(backupPath: string, targetDir: string, options?: RestoreOptions): Promise<{ restoredFiles: number; }>; private restoreInternal; /** * List available backups */ list(type?: BackupType): Promise; /** * Delete a backup */ delete(backupPath: string): Promise; /** * Delete old backups, keeping only the specified number */ cleanup(type: BackupType, keepCount: number): Promise; /** * Get backup contents without extracting */ getContents(backupPath: string): Promise; /** * Get detailed backup information */ getInfo(backupPath: string): Promise; } /** * Create a backup workflow */ export declare function createBackupWorkflow(options: BackupWorkflowOptions): BackupWorkflow; /** * Quick backup of plugins directory */ export declare function quickBackup(pluginsDir: string, backupDir: string, description?: string): Promise; /** * Quick restore of latest backup */ export declare function quickRestore(backupDir: string, targetDir: string, type?: BackupType): Promise<{ restoredFiles: number; } | null>; //# sourceMappingURL=backup.d.ts.map