import type { GitRange, GitRepoInfo } from './types.js';
export type GitErrorCode = 'git-missing' | 'not-a-repo' | 'bad-ref' | 'merge-base-failed' | 'timeout' | 'max-buffer' | 'git-failed' | 'not-implemented';
export declare class GitError extends Error {
    readonly code: GitErrorCode;
    readonly exitCode?: number;
    readonly stderr?: string;
    constructor(code: GitErrorCode, message: string, options?: {
        cause?: unknown;
        exitCode?: number;
        stderr?: string;
    });
}
export interface RunGitOptions {
    cwd?: string;
    repoRoot?: string;
    signal?: AbortSignal;
    timeoutMs?: number;
    maxBuffer?: number;
    allowExitCodes?: readonly number[];
}
export interface RunGitResult {
    stdout: string;
    stderr: string;
    exitCode: number;
    argv: string[];
    cwd: string;
}
export interface RunGitRawResult {
    stdout: Buffer;
    stderr: string;
    exitCode: number;
    argv: string[];
    cwd: string;
}
export declare const GIT_GLOBAL_ARGS: readonly ["--no-pager", "-c", "color.ui=false", "-c", "core.quotePath=false", "-c", "core.autocrlf=false", "--no-optional-locks"];
export declare function runGit(args: readonly string[], options?: RunGitOptions): Promise<RunGitResult>;
export declare function runGitRaw(args: readonly string[], options?: RunGitOptions): Promise<RunGitRawResult>;
export declare function preflightRepo(repoRoot?: string, options?: RunGitOptions): Promise<GitRepoInfo>;
export declare function gitVersion(repoRoot?: string, options?: RunGitOptions): Promise<string>;
export declare function detectDefaultBase(repoRoot?: string, options?: RunGitOptions): Promise<string | undefined>;
export declare function gitMergeBase(base: string, head?: string, options?: RunGitOptions): Promise<string>;
export interface ResolveDiffRangeOptions extends RunGitOptions {
    base?: string;
    head?: string;
    staged?: boolean;
}
export declare function resolveDiffRange(options?: ResolveDiffRangeOptions): Promise<GitRange>;
export declare function buildDiffRangeArgs(range: GitRange, version?: string): string[];
