import { WorktreeInfo, OperationResult, RemovalStrategy } from '../types/index.js'; /** * Worktree Remover * * Safely removes Git worktrees with proper error handling: * - Executes git worktree remove * - Handles locked worktrees * - Handles missing directories * - Handles permission errors * - Supports force removal */ export declare class WorktreeRemover { /** * Remove a worktree * * @param worktree - Worktree information * @param force - Force removal even if worktree has changes * @param repoRoot - Repository to run git in; defaults to the process cwd * @returns Result object with success status and message */ remove(worktree: WorktreeInfo, force?: boolean, repoRoot?: string): Promise; /** * Locate the `.git/worktrees/` directory belonging to a worktree path. * * The directory name is usually the path's basename but git disambiguates * collisions, so each candidate's `gitdir` file is read and compared instead * of guessing. * * @param worktreePath - Absolute path of the worktree * @param repoRoot - Repository to run git in * @returns Absolute path to the administrative directory, or null */ private findAdminDir; /** * Prune a single worktree whose directory has gone missing. * * Scoped deliberately: `git worktree prune` takes no path argument and would * discard the administrative data of *every* prunable worktree in the * repository, including ones the user never asked about. Removing just this * worktree's own directory under `.git/worktrees/` is exactly what prune * would do for it, and nothing more. * * @param worktree - Worktree information * @param repoRoot - Repository to run git in * @returns Result object with success status and message */ private prune; /** * Check if worktree can be removed without force * * @param worktree - Worktree information * @returns True if removal is safe without --force */ canRemoveSafely(worktree: WorktreeInfo): boolean; /** * Get removal strategy for a worktree * * @param worktree - Worktree information * @returns Recommended removal strategy */ getRemovalStrategy(worktree: WorktreeInfo): RemovalStrategy; /** * Unlock a worktree * * @param worktree - Worktree information * @returns Result object with success status and message */ unlock(worktree: WorktreeInfo): Promise; /** * Lock a worktree * * @param worktree - Worktree information * @param reason - Optional reason for locking * @returns Result object with success status and message */ lock(worktree: WorktreeInfo, reason?: string): Promise; } //# sourceMappingURL=WorktreeRemover.d.ts.map