UNPKG

git-yike-logger-hook

Version:

A TypeScript Git hook plugin for automatically generating commit logs with TODO/WIP comment scanning

48 lines (47 loc) 1.03 kB
import { CommitLog, GitStatus } from './types'; /** * Git 操作工具类 */ export declare class GitUtils { private git; constructor(); /** * 获取当前提交信息 */ getCurrentCommitInfo(): Promise<Partial<CommitLog>>; /** * 获取当前分支名称 */ getCurrentBranch(): Promise<string>; /** * 获取远程仓库信息 */ getRemoteInfo(): Promise<{ name: string; url: string; } | undefined>; /** * 获取暂存区的文件状态 */ getStagedFiles(): Promise<string[]>; /** * 获取工作区文件状态 */ getWorkingDirectoryStatus(): Promise<GitStatus>; /** * 获取文件变更详情 */ getFileChanges(): Promise<{ added: string[]; modified: string[]; deleted: string[]; renamed: Array<{ from: string; to: string; }>; }>; /** * 检查是否在 Git 仓库中 */ isGitRepository(): Promise<boolean>; }