import type { ExportData, HealthResult, RoundMeta, SyncLog, ChangeNotification } from "./types.js"; /** Save an export atomically — writes to a temp directory then renames. * Skips writing if the data on disk is identical (idempotent). */ export declare function saveExport(data: ExportData, date?: string): Promise; /** Compare two exports for equality using deep structural comparison */ export declare function exportsEqual(a: ExportData, b: ExportData): boolean; /** Save an export grouped by test round (requisitionId). * Merges results sharing a requisitionId into a single directory keyed by earliest visit date. * Writes round-meta.json alongside export files. Returns sorted list of saved round dates. */ export declare function saveRoundExport(data: ExportData): Promise; /** Load round metadata for a given export date */ export declare function loadRoundMeta(date: string): Promise; /** Migrate old per-visit exports to round-based exports. * Idempotent: detects un-migrated directories (no round-meta.json), * groups by requisitionId, merges into earliest-date directories. */ export declare function migrateToRounds(): Promise; /** Update the requisition count in the sync log (separate from per-export tracking) */ export declare function updateRequisitionCount(count: number): Promise; /** Load the most recent export (reads pointer file, then loads the export) */ export declare function loadLatest(): Promise; /** Load a specific export by date */ export declare function loadExport(date: string): Promise; /** Load only results from a specific export (lightweight for history lookups) */ export declare function loadExportResults(date: string): Promise; /** List all export dates (sorted ascending) */ export declare function listExports(): Promise; /** Get sync log */ export declare function getSyncLog(): Promise; /** Save a change notification as a timestamped JSON file. Prunes oldest files beyond MAX_CHANGE_FILES. */ export declare function saveChangeNotification(n: ChangeNotification): Promise; /** Load all change notifications, sorted ascending by timestamp. * Returns notifications and their filenames for safe clearing. */ export declare function loadChangeNotifications(): Promise<{ notifications: ChangeNotification[]; files: string[]; }>; /** Clear specific change notification files. Only deletes the named files, * avoiding race conditions with notifications created after the read. */ export declare function clearChangeNotifications(files: string[]): Promise; /** Load all round exports and merge into a single aggregated ExportData. * Returns null if no exports exist. Also returns the round count to avoid redundant listExports() calls. */ export declare function loadAllExportsAggregated(): Promise<{ data: ExportData | null; roundCount: number; }>;