import { lstat, mkdir, readFile, rm, rmdir, writeFile } from "node:fs/promises"; type FileSource = string | Uint8Array; type CleanupFile = readonly [path: string, source: FileSource]; type CleanupPlan = { cleanupFiles: CleanupFile[]; collisionPath: string | null; createdDirectories: string[]; rootDirectories: string[]; }; type CleanupItem = { path: string; status: "missing" | "preserved" | "preserved-existing" | "preserved-modified" | "removed"; error?: string; }; type DirectoryMetadata = { isDirectory(): boolean; isSymbolicLink(): boolean; }; type ScaffoldOperations = { lstat?: typeof lstat; mkdir?: typeof mkdir; readFile?: typeof readFile; rm?: typeof rm; rmdir?: typeof rmdir; writeFile?: typeof writeFile; }; export declare function pathExists(path: string, inspect: (path: string) => Promise): Promise; export declare function removeOwnedFile(path: string, expected: FileSource, read: (path: string) => Promise, remove: (path: string, options: { force: boolean; }) => Promise): Promise<{ path: string; status: "missing"; } | { path: string; status: "removed"; } | { path: string; status: "preserved-modified"; }>; export declare function removeCreatedDirectories(created: readonly string[], removeDirectory: (path: string) => Promise): Promise; export declare function ensureDirectoryPath(root: string, relativePath: string, operations: { inspect: (path: string) => Promise; makeDirectory: (path: string) => Promise; }): Promise; export declare function cleanupSummary(results: readonly CleanupItem[]): string; export declare function cleanupResult(results: CleanupItem[]): { removed: number; preserved: number; items: CleanupItem[]; }; export declare function withCleanupPlan(caught: unknown, cleanupPlan: CleanupPlan): Error & { cleanupPlan: CleanupPlan; }; export declare function cleanupScaffold(cleanupPlan: CleanupPlan, operations?: ScaffoldOperations): Promise<{ removed: number; preserved: number; items: CleanupItem[]; }>; export declare function createScaffold({ canonicalLanguage, contentLanguage, formatVersion, generateId, operations, repositoryRoot, }: { canonicalLanguage?: string; contentLanguage: string; formatVersion: number; generateId: () => string | Promise; operations?: ScaffoldOperations; repositoryRoot: string; }): Promise<{ createdIdea: { id: string; path: string; state: string; }; paths: { ideaPath: string; statusPath: string; eventsPath: string; ledgerPath: string; outerPath: string; deploymentDocumentPath: string; innerPath: string; implementationDocumentPath: string; idealPath: string; ideaDocumentPath: string; }; }>; export {}; //# sourceMappingURL=writer.d.ts.map