/** * SMI-4484: SQLite corruption detection + self-heal helpers * * On fresh macOS installs, the native better-sqlite3 driver writes WAL-mode * journal files that the WASM driver (sql.js) cannot read. The result is a * `database disk image is malformed` error on the next sync. * * These helpers let both the sql.js driver and the CLI database opener * recognise a corruption-class error and recover by backing up the bad file * and rebuilding an empty database — instead of crashing the user's command. */ /** * Determine whether an error indicates a corrupt / unreadable SQLite file. * * @param err - The thrown value (Error, string, or anything). * @returns true if the error message matches a known corruption marker. */ export declare function isCorruptionError(err: unknown): boolean; /** * Back up a corrupt SQLite file by renaming it out of the way. * * The backup path is `${path}.corrupt-` where the timestamp is an * ISO string with `:` and `.` replaced by `-` so it is filesystem-safe. * * @param path - Path to the corrupt database file. Must be a real file path * (not `:memory:`) and must exist on disk. * @returns The path the corrupt file was moved to. * @throws Error if `path` is `:memory:` or the file does not exist. */ export declare function backupCorruptDbFile(path: string): string; //# sourceMappingURL=corruption.d.ts.map