git-tweezers
Version:
Advanced git staging tool with hunk and line-level control
30 lines (29 loc) • 1.27 kB
TypeScript
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(): Promise<string[]>;
diffCached(file?: string, context?: number): Promise<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;
}