import type { AccountSnapshot } from '../accounts/account-snapshot.js'; /** * Read + parse a legacy account snapshot. Throws when the file is missing, a * symlink, not JSON, or not a JSON object. The open() + read-from-fd shape * closes the TOCTOU window CodeQL's `js/file-system-race` flagged: the old * `lstatSync(path)` then `readFileSync(path)` pair could be swapped between * the check and the use. We use `O_NOFOLLOW` so the kernel refuses to open * a symlink atomically (ELOOP) — no separate symlink check to race against — * then read from the file descriptor we already hold, which can't be * substituted under us. Symlink rejection matters because the snapshot * directory is mode-700 and we don't want an attacker who can write into it * to redirect a read to an arbitrary file on disk. */ export declare function readLegacyAccount(email: string, accountsDirPath: string): AccountSnapshot;