/** * Template hash utilities for detecting user modifications * * Stores SHA256 hashes of template files at install time. * Used to determine if users have modified templates. */ import type { TemplateHashes } from "../types/migration.js"; /** * Compute SHA256 hash of content */ export declare function computeHash(content: string): string; /** * Load stored template hashes */ export declare function loadHashes(cwd: string): TemplateHashes; /** * Save template hashes */ export declare function saveHashes(cwd: string, hashes: TemplateHashes): void; /** * Update hashes for specific files * * @param cwd - Working directory * @param files - Map of relative paths to file contents */ export declare function updateHashes(cwd: string, files: Map): void; /** * Update hash for a single file by reading its current content */ export declare function updateHashFromFile(cwd: string, relativePath: string): void; /** * Remove hash entry for a file (e.g., after deletion) */ export declare function removeHash(cwd: string, relativePath: string): void; /** * Rename hash entry (used after file rename) */ export declare function renameHash(cwd: string, oldPath: string, newPath: string): void; /** * Check if a template file has been modified by the user * * @param cwd - Working directory * @param relativePath - Relative path to the file * @param hashes - Stored template hashes * @returns true if file has been modified from template, false otherwise */ export declare function isTemplateModified(cwd: string, relativePath: string, hashes: TemplateHashes): boolean; /** * Check if a file matches its original template content * (Useful for determining if a file can be safely auto-migrated) * * @param cwd - Working directory * @param relativePath - Relative path to the file * @param originalContent - Original template content * @returns true if file matches original template */ export declare function matchesOriginalTemplate(cwd: string, relativePath: string, originalContent: string): boolean; /** * Get modification status for multiple files * * @param cwd - Working directory * @param relativePaths - Array of relative paths to check * @param hashes - Stored template hashes * @returns Map of path to modification status */ export declare function getModificationStatus(cwd: string, relativePaths: string[], hashes: TemplateHashes): Map; /** * Initialize template hashes after init * * Scans all template directories and computes hashes for files. * This should be called at the end of `aim init` to enable * modification detection on subsequent updates. * * @param cwd - Working directory * @returns Number of files hashed */ export declare function initializeHashes(cwd: string): number; //# sourceMappingURL=template-hash.d.ts.map