UNPKG

@akiojin/claude-worktree

Version:

Interactive Git worktree manager for Claude Code with graphical branch selection

74 lines 3.94 kB
import { BranchInfo } from './ui/types.js'; export declare class GitError extends Error { cause?: unknown | undefined; constructor(message: string, cause?: unknown | undefined); } /** * 現在のディレクトリがGitリポジトリかどうかを確認 * @returns {Promise<boolean>} Gitリポジトリの場合true */ export declare function isGitRepository(): Promise<boolean>; /** * Gitリポジトリのルートディレクトリを取得 * @returns {Promise<string>} リポジトリのルートパス * @throws {GitError} リポジトリルートの取得に失敗した場合 */ export declare function getRepositoryRoot(): Promise<string>; export declare function getRemoteBranches(): Promise<BranchInfo[]>; export declare function getLocalBranches(): Promise<BranchInfo[]>; /** * ローカルとリモートのすべてのブランチ情報を取得 * @returns {Promise<BranchInfo[]>} ブランチ情報の配列 */ export declare function getAllBranches(): Promise<BranchInfo[]>; export declare function createBranch(branchName: string, baseBranch?: string): Promise<void>; export declare function branchExists(branchName: string): Promise<boolean>; export declare function deleteBranch(branchName: string, force?: boolean): Promise<void>; export declare function hasUncommittedChanges(worktreePath: string): Promise<boolean>; export declare function getChangedFilesCount(worktreePath: string): Promise<number>; export declare function showStatus(worktreePath: string): Promise<string>; export declare function stashChanges(worktreePath: string, message?: string): Promise<void>; export declare function discardAllChanges(worktreePath: string): Promise<void>; export declare function commitChanges(worktreePath: string, message: string): Promise<void>; export declare function hasUnpushedCommits(worktreePath: string, branch: string): Promise<boolean>; /** * Get the latest commit message for a specific branch in a worktree */ export declare function getLatestCommitMessage(worktreePath: string, branch: string): Promise<string | null>; /** * Get the count of unpushed commits */ export declare function getUnpushedCommitsCount(worktreePath: string, branch: string): Promise<number>; /** * Get the count of uncommitted changes (staged + unstaged) */ export declare function getUncommittedChangesCount(worktreePath: string): Promise<number>; /** * Enhanced session information for better display */ export interface EnhancedSessionInfo { hasUncommittedChanges: boolean; uncommittedChangesCount: number; hasUnpushedCommits: boolean; unpushedCommitsCount: number; latestCommitMessage: string | null; branchType: 'feature' | 'bugfix' | 'hotfix' | 'develop' | 'main' | 'master' | 'other'; } /** * Get enhanced session information for display */ export declare function getEnhancedSessionInfo(worktreePath: string, branch: string): Promise<EnhancedSessionInfo>; export declare function fetchAllRemotes(): Promise<void>; export declare function getCurrentVersion(repoRoot: string): Promise<string>; export declare function calculateNewVersion(currentVersion: string, versionBump: 'patch' | 'minor' | 'major'): string; export declare function executeNpmVersionInWorktree(worktreePath: string, newVersion: string): Promise<void>; export declare function deleteRemoteBranch(branchName: string, remote?: string): Promise<void>; export declare function getCurrentBranchName(worktreePath: string): Promise<string>; export declare function pushBranchToRemote(worktreePath: string, branchName: string, remote?: string): Promise<void>; export declare function checkRemoteBranchExists(branchName: string, remote?: string): Promise<boolean>; /** * 現在のディレクトリがworktreeディレクトリかどうかを確認 * @returns {Promise<boolean>} worktreeディレクトリの場合true */ export declare function isInWorktree(): Promise<boolean>; //# sourceMappingURL=git.d.ts.map