/** * Git Service * * Serviço para operações Git no contexto do framework RW-UC. * Utiliza simple-git para interação com repositórios Git. */ /** * Resultado do status do Git */ export interface GitStatus { isClean: boolean; current: string | null; tracking: string | null; staged: string[]; modified: string[]; untracked: string[]; deleted: string[]; conflicted: string[]; ahead: number; behind: number; } /** * Resultado do diff */ export interface GitDiff { files: GitDiffFile[]; insertions: number; deletions: number; } /** * Arquivo no diff */ export interface GitDiffFile { file: string; changes: number; insertions: number; deletions: number; binary: boolean; } /** * Informação de commit */ export interface GitCommitInfo { hash: string; date: string; message: string; author: string; email: string; } /** * Opções para criar commit */ export interface CommitOptions { message: string; files?: string[]; author?: string; allowEmpty?: boolean; } /** * Resultado de operação Git */ export interface GitOperationResult { success: boolean; message: string; data?: unknown; } /** * Serviço Git */ export declare class GitService { private git; private workingDirectory; constructor(workingDirectory: string); /** * Verifica se o diretório é um repositório Git */ isRepository(): Promise; /** * Inicializa um novo repositório Git */ init(): Promise; /** * Obtém status do repositório */ status(): Promise; /** * Obtém diff do repositório */ diff(files?: string[]): Promise; /** * Obtém diff entre duas referências */ diffBetween(from: string, to: string): Promise; /** * Adiciona arquivos ao staging */ add(files: string | string[]): Promise; /** * Remove arquivos do staging */ unstage(files: string | string[]): Promise; /** * Cria um commit */ commit(options: CommitOptions): Promise; /** * Obtém log de commits */ log(count?: number): Promise; /** * Obtém o último commit */ getLastCommit(): Promise; /** * Obtém branch atual */ getCurrentBranch(): Promise; /** * Lista todas as branches */ listBranches(): Promise<{ current: string; all: string[]; }>; /** * Cria uma nova branch */ createBranch(name: string, checkout?: boolean): Promise; /** * Muda para uma branch */ checkout(ref: string): Promise; /** * Deleta uma branch */ deleteBranch(name: string, force?: boolean): Promise; /** * Cria uma tag */ createTag(name: string, message?: string): Promise; /** * Obtém o hash de um commit específico */ getCommitHash(ref?: string): Promise; /** * Verifica se há mudanças não commitadas */ hasUncommittedChanges(): Promise; /** * Descarta mudanças em arquivos específicos */ discardChanges(files: string | string[]): Promise; /** * Stash das mudanças atuais */ stash(message?: string): Promise; /** * Aplica stash */ stashPop(): Promise; /** * Obtém o diretório de trabalho */ getWorkingDirectory(): string; /** * Verifica se um arquivo está rastreado pelo Git */ isTracked(file: string): Promise; /** * Obtém o conteúdo de um arquivo em uma revisão específica */ getFileAtRevision(file: string, revision?: string): Promise; } /** * Cria uma instância do GitService */ export declare function createGitService(workingDirectory: string): GitService; /** * Formata mensagem de commit padrão Ralph */ export declare function formatRalphCommitMessage(taskId: string, taskName: string, type?: 'feat' | 'fix' | 'test' | 'refactor' | 'chore' | 'docs'): string; //# sourceMappingURL=git-service.d.ts.map