UNPKG

git-tweezers

Version:

Advanced git staging tool with hunk and line-level control

42 lines (41 loc) 1.64 kB
import { type Options as ExecaOptions } from 'execa'; export interface GitOptions extends ExecaOptions { cwd?: string; } export declare class GitWrapper { private repoRoot; constructor(cwd?: string); private readonly cwd; execute(args: string[], options?: GitOptions): Promise<string>; executeWithInput(args: string[], input: string, options?: GitOptions): Promise<string>; diff(file: string, context?: number): Promise<string>; diffAll(context?: number): Promise<string>; getChangedFiles(options?: { trackedOnly?: boolean; stagedOnly?: boolean; respectGitignore?: boolean; }): Promise<string[]>; diffCached(file?: string, context?: number): Promise<string>; /** * Get both staged and unstaged diffs for a file * Returns an object with both diffs for dual-layer tracking */ getDualLayerDiff(file: string, context?: number): Promise<{ staged: string; unstaged: string; }>; apply(patch: string, cached?: boolean): Promise<void>; applyWithOptions(patch: string, options: string[]): Promise<void>; reverseApplyCached(patch: string, options?: string[]): Promise<void>; status(short?: boolean): Promise<string>; add(files: string | string[]): Promise<void>; reset(files?: string | string[]): Promise<void>; isUntracked(file: string): Promise<boolean>; addIntentToAdd(file: string): Promise<void>; isBinary(file: string): Promise<boolean>; getGitRoot(): string; get gitRoot(): string; static getGitRootStatic(cwd: string): string; private getGitRootStatic; getGitDir(): string; }