import type { FileChange, ToolkitManifest } from "./types.js"; /** Hash a file's content with SHA-256 */ export declare function hashFile(filePath: string): string; /** Walk a directory recursively, returning relative paths */ export declare function walkDir(dir: string): string[]; /** Load existing manifest if present */ export declare function loadManifest(targetDir: string): ToolkitManifest | null; /** Save manifest to target directory */ export declare function saveManifest(targetDir: string, manifest: ToolkitManifest): void; /** Check if a directory has a pi-extension-toolkit installation */ export declare function isToolkitInstalled(targetDir: string): boolean; /** Get installed version, or null */ export declare function getInstalledVersion(targetDir: string): string | null; /** Create a backup of target files before overwriting */ export declare function createBackup(targetDir: string, files: string[]): string | null; /** * Compute file changes between current state and expected source state. * * Modes: * - `"create"`: Compares template files against target (all files are new or skipped) * - `"retrofit"`: Compares existing files against known manifest hashes */ export declare function computeChanges(targetDir: string, sourceFiles: Map, // relativePath -> sourceHash operation: "create" | "retrofit", force: boolean): FileChange[]; /** * Apply file changes computed by computeChanges(). * Returns lists of created, updated, skipped, and conflicted files. */ export declare function applyChanges(targetDir: string, sourceDir: string, sourceFiles: Map, changes: FileChange[], backup: boolean): { created: string[]; updated: string[]; skipped: string[]; conflicts: string[]; backupDir: string | null; }; /** * Build a manifest for all source files so future runs can detect user modifications. */ export declare function buildManifest(sourceFiles: Map, version: string, operation: "create" | "retrofit"): ToolkitManifest;