import type { GenerationPlan } from '../../generate/index.ts'; /** A reviewed generated file. Existing files must already match its contents. */ export interface PlannedFile { path: string; content: string; exists: boolean; } /** A generation plan bound to a canonical application directory. */ export interface ApplicationPlan { root: string; files: PlannedFile[]; dependencies: string[]; instructions: string[]; } /** * Review generation against an existing app without writing files. * @param projectRoot Application directory containing package.json. * @param generation Generated file contents, dependencies, and wiring instructions. * @returns A plan bound to the real application root, including unchanged files. * @throws {Error} For conflicting files, symlinks, invalid targets, or pending recovery. */ export declare const planGeneration: (projectRoot: string, generation: GenerationPlan) => ApplicationPlan; /** * Restore an interrupted apply without overwriting intervening application changes. * Files and directories created by someone else are left in place. * @param projectRoot Application directory used by the original apply. * @returns Whether a native generation transaction was recovered. * @throws {Error} For invalid records, symlinks, or generated files edited since apply. */ export declare const recoverGeneration: (projectRoot: string) => boolean; /** * Apply a reviewed plan, publishing complete files without replacing existing ones. * Uses exclusive hard links, or exclusive copies where hard links are unsupported. * @param plan Application plan produced by planGeneration. * @returns Paths created inside the application. * @throws {Error} For stale plans, conflicts, interrupted applies, or failed writes. * When rollback also fails, the error names both failures and keeps the original as `cause`. */ export declare const applyGeneration: (plan: ApplicationPlan) => string[];