import { SafetyCheckResult, OperationResult, BranchDeletionRecommendation, RelatedBranches } from '../types/index.js'; /** * Branch Cleaner * * Handles branch deletion after worktree closure: * - Safe delete (git branch -d) for merged branches * - Force delete (git branch -D) for unmerged branches * - Remote branch warnings * - User prompts based on merge status */ export declare class BranchCleaner { /** * Delete a branch * * @param branchName - Name of branch to delete * @param repoRoot - Repository root path * @param safety - Safety check result * @param force - Force deletion even if not merged * @returns Result object with success status and message */ cleanup(branchName: string, repoRoot: string, safety: SafetyCheckResult, force?: boolean): Promise; /** * Delete remote branch * * @param branchName - Name of branch to delete * @param repoRoot - Repository root path * @param remoteName - Remote name (default: origin) * @returns Result object with success status and message */ deleteRemote(branchName: string, repoRoot: string, remoteName?: string): Promise; /** * Check if branch can be safely deleted * * @param branchName - Branch name * @param repoRoot - Repository root path * @returns True if branch is merged and can be safely deleted */ canSafelyDelete(branchName: string, repoRoot: string): boolean; /** * Get deletion strategy. * * Force delete only when the user explicitly asked for it. An unmerged * branch is deleted with `-d`, so Git refuses and the caller reports * "not fully merged — use --force"; escalating to `-D` automatically would * discard the user's commits without their consent. * * @param force - Force flag from user * @returns Deletion strategy */ private getDeletionStrategy; /** * Branches that must never be deleted. * * The repository's detected primary branch, plus 'main' and 'master' as a * baseline so an offline or remote-less repository stays protected. * * @param repoRoot - Repository root path */ private getProtectedBranches; /** * Get deletion recommendation * * @param safety - Safety check result * @returns Recommendation object */ getRecommendation(safety: SafetyCheckResult): BranchDeletionRecommendation; /** * List branches that would be affected * * @param branchName - Branch name * @param repoRoot - Repository root path * @returns List of related branches (local and remote) */ getRelatedBranches(branchName: string, repoRoot: string): RelatedBranches; } //# sourceMappingURL=BranchCleaner.d.ts.map