import type { ExportManifest } from "../backend/types.js"; /** * Hooks fired during {@link exportWorkspaceTree} placement so a git worktree can * repair its metadata to the new location as part of the (rollback-safe) move. */ export interface WorkspacePlacementHooks { /** * Invoked once the tree is placed at its destination but *before* any * backup/source cleanup, so a throw here is still recoverable. Used to run * `git worktree repair` against the new path. Throwing rolls the move back. */ onPlaced?: (placedPath: string) => Promise; /** * Invoked with the path where the tree ends up after a failed * placement/`onPlaced` — normally the restored source, but the destination * itself when the tree could not be moved back — to best-effort re-link git * metadata there. Must not throw. */ onRolledBack?: (survivingPath: string) => Promise; } /** * Mirror-replace the contents of `sourceDir` onto `targetDir` (the `--workspace` * egress). A move with REPLACE semantics: stale files removed, atomic swap, rollback * on failure, no-op when source === target. NEVER deletes the source on failure; * instead reports where the data survives via `recovery`. `hooks` lets a git * worktree repair its metadata to the new path as part of the move. */ export declare function exportWorkspaceTree(sourceDir: string, targetDir: string, hooks?: WorkspacePlacementHooks): Promise; //# sourceMappingURL=workspace-tree-export.d.ts.map