import { type GatewayPaths } from './paths.js'; import type { ResetBackupBundle } from './reset-backup.js'; type Phase = 'prepared' | 'active-moved' | 'fresh-installed' | 'complete'; type ComponentPaths = { config: string; database: string; wal: string; shm: string; session: string; }; export type ResetJournal = { version: 1; phase: Phase; backupBundle: string; staged: ComponentPaths; active: ComponentPaths; rollback: ComponentPaths; }; export type ResetInstallOptions = { paths: GatewayPaths; configPath: string; backup: ResetBackupBundle; staged: { config: string; database: string; session: string; }; /** Test-only seam, called after each durable/destructive boundary. */ afterStep?: (step: string) => void; }; /** Runtime validation for untrusted on-disk journal JSON. */ export declare function parseResetJournal(value: unknown): ResetJournal; export declare function readResetJournal(path: string): ResetJournal | undefined; /** * Installs already validated fresh candidates. The caller holds gateway.lock. * Errors before completion restore the old state and leave the journal behind * if restoration itself cannot be validated. */ export declare function installFreshReset(options: ResetInstallOptions): void; export type ResetRecoveryOptions = { paths?: GatewayPaths; configPath?: string; afterStep?: (step: string) => void; }; /** Restores a validated backup after any interrupted reset-install phase. */ export declare function recoverInterruptedReset(options?: ResetRecoveryOptions): void; export {};