/**
 * Lock file management — tracks generated file integrity via SHA-1 to detect user-modified files.
 * Preservation regions: markers `AURORA:<NAME>-START/END` in HTML comments let bodies survive
 * regeneration (see openspec/changes/preservation-regions).
 */
import type { LockFile, Scope } from '../domain/model.js';
/**
 * SHA-1 hex digest. Used as the integrity primitive for the lockfile.
 * Not cryptographically strong — purpose is change detection, not security.
 */
export declare function sha1(content: string): string;
/**
 * Extract preservation region bodies from content.
 * Returns a Map<regionName, bodyContent>. Throws on malformed markers.
 */
export declare function extractPreservationRegions(content: string): Map<string, string>;
/**
 * Strip preservation region bodies from content, preserving markers.
 * Renaming a marker invalidates the hash because the marker name stays in
 * the stripped string. Files without regions are returned unchanged.
 */
export declare function stripPreservationRegions(content: string): string;
/**
 * Compute integrity hash EXCLUDING preservation region bodies.
 * For files without regions this equals `sha1(content)` (backward compat).
 */
export declare function sha1WithPreservation(content: string): string;
/**
 * Normalize a region body for stable hashing: LF line endings and no trailing
 * whitespace. Applied ONLY to the hash input; the stored body keeps its
 * original formatting.
 */
export declare function normalizeRegionBody(body: string): string;
/**
 * Hash each preservation region body in content. Returns a plain object
 * ready to serialize into the lockfile. Empty input → empty object.
 */
export declare function hashRegionBodies(content: string): Record<string, string>;
/**
 * Outcome of {@link mergePreservationRegions}. The three name arrays are disjoint
 * and describe what happened to every region. Used for per-region log lines.
 */
export interface MergeResult {
    /** The merged file contents, ready to be written to disk. */
    content: string;
    /** Regions present in `existingContent` but not in `newContent`. Their body was lost. */
    dropped: string[];
    /** Regions kept byte-for-byte from `existingContent` because the user had modified them. */
    preserved: string[];
    /** Regions whose body was refreshed from `newContent` because `priorHashes` indicated no user edits. */
    updated: string[];
}
/**
 * Merge preservation regions: per-region decision based on priorHashes.
 * - If the existing body hash matches priorHashes[name] → use newContent body
 *   (user did not modify → template improvement propagates).
 * - Otherwise → preserve existingContent body byte-for-byte.
 * - If priorHashes is undefined → preserve all (fallback, legacy lockfile).
 * - Regions only in newContent keep their new body.
 * - Regions only in existingContent are dropped (body lost).
 */
export declare function mergePreservationRegions(newContent: string, existingContent: string, priorHashes?: Record<string, string>): MergeResult;
/** Load lock files from `cliter/{boundedContext}/.locks/{scope}/{moduleName}.lock.json`. */
export declare function loadLockFiles(boundedContextName: string, moduleName: string, scope: Scope, cwd?: string): LockFile[];
/** Save lock files to `cliter/{boundedContext}/.locks/{scope}/{moduleName}.lock.json`. */
export declare function saveLockFiles(boundedContextName: string, moduleName: string, lockFiles: LockFile[], scope: Scope, cwd?: string): void;
export declare function findLockFile(lockFiles: LockFile[], relativePath: string): LockFile | undefined;
/** True when the file's current content matches its lock entry — i.e. user did NOT modify it. */
export declare function isFileUnmodified(filePath: string, lockFiles: LockFile[], relativePath: string): boolean;
