import type { PersistedState } from "./types.js";
export declare function saveState(dataDir: string, state: PersistedState): Promise<void>;
/**
 * Load raw persisted state from disk.
 * Returns the raw parsed JSON — caller is responsible for migration
 * from legacy format to current PersistedState.
 *
 * Checks agentvault.json first, falls back to secure-channel.json
 * for backward compatibility. Auto-migrates on first legacy load.
 */
export declare function loadState(dataDir: string): Promise<any | null>;
/**
 * Check whether persisted state is valid and usable (has deviceId, deviceJwt, and at least one session).
 */
export declare function isStateValid(dataDir: string): Promise<boolean>;
/**
 * Create a backup of the state file (atomic write via tmp + rename).
 * Silent no-op if no state file exists.
 */
export declare function backupState(dataDir: string): Promise<void>;
/**
 * Restore state from backup if primary state is missing/empty/invalid but .bak exists and is valid.
 * Returns true if state was successfully restored.
 */
export declare function restoreState(dataDir: string): Promise<boolean>;
export declare function clearState(dataDir: string): Promise<void>;
//# sourceMappingURL=state.d.ts.map