import type { ProgressFile } from "./types.js";
export interface ProgressStoreOptions {
    filePath?: string;
    backupPath?: string;
    /** Called when neither the main file nor the backup is usable. */
    rebuild?: () => Promise<ProgressFile | null>;
}
export declare function signProgress(file: ProgressFile): string;
export declare function verifyProgress(file: ProgressFile): boolean;
declare function dayKey(now: Date): string;
export declare function createEmptyProgress(now?: Date): ProgressFile;
/**
 * Read-only peek: main file → backup → null. Never writes — safe for fs.watch
 * reloads that may race an in-flight atomic rename.
 */
export declare function peekProgress(opts?: ProgressStoreOptions): Promise<ProgressFile | null>;
/**
 * Load progress with the recovery chain: main file → backup → rebuild → empty.
 * Never silently zeroes a user if any recoverable state exists.
 */
export declare function loadProgress(opts?: ProgressStoreOptions): Promise<ProgressFile>;
/**
 * Save progress: sign, atomic write under a file lock, and maintain the backup
 * (written when the level increased — caller passes `levelledUp` — or at most once/day).
 */
export declare function saveProgress(file: ProgressFile, opts?: ProgressStoreOptions, levelledUp?: boolean): Promise<void>;
/**
 * Read-modify-write under the lock — the safe way for concurrent sidecars to award XP.
 */
export declare function updateProgress(mutate: (file: ProgressFile) => Promise<{
    file: ProgressFile;
    levelledUp: boolean;
}>, opts?: ProgressStoreOptions): Promise<ProgressFile>;
export { dayKey };
//# sourceMappingURL=store.d.ts.map