import { FiledistExtractEntry, ManagedFileMetadata } from '../types'; /** * Derive the lock file path from the config file path. * Strips the `.yml` suffix from the config file basename and appends `.lock`. * * Examples: * `/project/.filedist.yml` → `/project/.filedist.lock` * `/project/myconfig.yml` → `/project/myconfig.lock` */ export declare function getLockfilePath(configFilePath: string): string; export type LockfileData = { version: number; /** Maps package spec → resolved version/ref string. */ packages: Record; /** * Set definitions stored during install; used by check/purge/frozen-install * to operate without reading the user configuration file. */ sets?: FiledistExtractEntry[]; /** Maps output-dir key → pipe-delimited managed-file lines. */ files?: Record; /** SHA-256 checksum of packages + files + sets sections. Validated on every read. */ checksum?: string; }; /** * Compute a SHA-256 checksum over the packages, files, and sets sections of a * lockfile. The input is deterministic (keys sorted) so the result is stable * across writes. */ export declare function computeLockfileChecksum(data: Pick): string; /** * Read a lock file from the given absolute path. * Returns undefined when the file does not exist. * Throws when the file exists but cannot be parsed or has a bad checksum. */ export declare function readLockfile(lockfilePath: string): LockfileData | undefined; /** * Write a lock file to the given absolute path. */ export declare function writeLockfile(lockfilePath: string, data: LockfileData): void; /** * Read the set definitions stored in a lock file. * Returns undefined when the file does not exist or has no sets. */ export declare function readSetsFromLockfile(lockfilePath: string): FiledistExtractEntry[] | undefined; /** * Build a LockfileData object from a map of spec → resolved version and source. */ export declare function buildLockfileData(resolvedPackages: Map): LockfileData; /** * Returns the key used in managed_files for a given output directory. * The key is relative to cwd, normalised to forward slashes. */ export declare function outputDirKey(cwd: string, outputDir: string): string; /** * Read managed file entries for a specific output directory from a lock file. * Returns an empty array when the lock file or directory entry does not exist. */ export declare function readManagedFilesForDir(lockfilePath: string, cwd: string, outputDir: string): ManagedFileMetadata[]; /** * Write managed file entries for a specific output directory into a lock file. * Reads the current lock file, updates the entry for outputDir, and writes it back. * When entries is empty the key is removed. */ export declare function writeManagedFilesForDir(lockfilePath: string, cwd: string, outputDir: string, entries: ManagedFileMetadata[]): void; //# sourceMappingURL=lockfile.d.ts.map