import type { Settings } from '../../types/index.js'; export type DownloadedTranslation = { updatedAt?: string; postProcessHash?: string; fileName?: string; }; export type DownloadedVersionEntry = { fileId: string; versionId: string; fileName?: string; staged?: boolean; translations: { [locale: string]: DownloadedTranslation; }; }; export type DownloadedVersions = { version: 2; branchId: string; entries: DownloadedVersionEntry[]; }; export type DownloadedVersionEntryV1 = { fileName?: string; updatedAt?: string; postProcessHash?: string; sourceHash?: string; }; export type DownloadedVersionsV1 = { version: number; entries: { [branchId: string]: { [fileId: string]: { [versionId: string]: { [locale: string]: DownloadedVersionEntryV1; }; }; }; }; }; /** * Reads the lockfile and returns v2 data regardless of the on-disk format. * If the file is v1, `originalV1` contains the full v1 data so that * `writeLockfile` can merge changes back without losing other branches. */ export declare function readLockfile(settings: Settings): { data: DownloadedVersions; entryMap: EntryMap; originalV1: DownloadedVersionsV1 | null; }; /** * Writes the lockfile. If `originalV1` is provided, merges the current * branch's data back into the v1 structure (preserving other branches) * and writes v1 format. Otherwise writes v2. */ export declare function writeLockfile(data: DownloadedVersions, originalV1: DownloadedVersionsV1 | null): void; export type EntryMap = Map; export declare function buildEntryMap(entries: DownloadedVersionEntry[]): EntryMap; /** * Finds or creates an entry, keeping the map and backing array in sync. * If the fileId exists but versionId changed, replaces it in-place. */ export declare function findOrCreateEntry(entryMap: EntryMap, entries: DownloadedVersionEntry[], fileId: string, versionId: string): DownloadedVersionEntry; /** * Writes staged file entries into the lockfile. * Each entry is marked with `staged: true` and empty translations. */ export declare function writeStagedEntries(settings: Settings, stagedFiles: { fileId: string; versionId: string; fileName: string; }[], branchId?: string): void; /** * Reads staged entries from the lockfile. * Returns the same shape as FileTranslationData for compatibility * with the download workflow. */ export declare function getStagedEntriesFromLockfile(settings: Settings): Record;