import type { PonyCommitMessage } from "./commit-message.js"; import type { PonyProject } from "./project.js"; import { type WritePolicyResult } from "./write-policy.js"; export interface PendingWrite { apply: () => Promise; rollback: () => Promise; } export interface PendingFileWrite extends PendingWrite { absolutePath: string; } export declare function createPendingFileWrite(absolutePath: string, apply: () => Promise): Promise; /** * Multi-record domain mutations must never leave successfully written files * ahead of a later failed write, even in working-tree delivery mode. */ export declare function applyWritesAtomically(writes: PendingWrite[]): Promise; export declare function rollbackWrites(writes: PendingWrite[]): Promise; export interface ConfigAndRecordMutation { project: PonyProject; recordWrites: PendingFileWrite[]; previousConfigContent: string; nextConfigContent: string; commitMessage: PonyCommitMessage; } /** * Config migrations share one transaction boundary: all record writes and the * config marker are delivered or restored together under the project policy. */ export declare function applyConfigAndRecordMutation({ project, recordWrites, previousConfigContent, nextConfigContent, commitMessage, }: ConfigAndRecordMutation): Promise; //# sourceMappingURL=atomic-writes.d.ts.map