/** * Config backup/restore commands extracted from interactive-mode. * * `handleConfigBackupCommand` snapshots the reusable-file profiles and the * resource-relevant settings to a JSON bundle; `handleConfigRestoreCommand` * reads such a bundle back, confirming with the user before clobbering local * state. Both operate through a narrow `host` seam (settings manager + the * status/error/selector callbacks) so the file IO and validation live outside * the god file while interactive-mode keeps only thin delegating wrappers. */ import type { Component } from "@caupulican/pi-tui"; import type { SettingsManager } from "../../core/settings-manager.ts"; export interface ConfigBackupHost { readonly settingsManager: SettingsManager; showStatus(message: string): void; showError(errorMessage: string): void; } export interface ConfigRestoreHost extends ConfigBackupHost { showSelector(create: (done: () => void) => { component: Component; focus: Component; onSuperseded?: () => void; }): void; handleReloadCommand(): Promise; } export interface ProfileFilesSnapshot { directoryExisted: boolean; files: Map; } export declare function captureProfileFiles(profilesDir: string): ProfileFilesSnapshot; export declare function restoreProfileFiles(profilesDir: string, snapshot: ProfileFilesSnapshot): void; export declare function handleConfigBackupCommand(host: ConfigBackupHost, fileArg?: string): Promise; export declare function handleConfigRestoreCommand(host: ConfigRestoreHost, fileArg: string): Promise; //# sourceMappingURL=config-backup.d.ts.map