import type { GitChangedFile, GitChurnSort, GitChurnSummary, GitCochangeAggregationOptions, GitCochangeSummary, GitCommit, GitCommitFileChange, GitDiffHunks, GitNumstat, GitRange, GitFileStatus, GitTreeEntry } from './types.js';
export interface GitLogNumstatRecord {
    commit: GitCommit;
    numstat: GitNumstat[];
}
export declare class GitParseError extends Error {
    constructor(message: string);
}
/** A path cannot be represented losslessly by the valid-UTF-8 V1 contracts. */
export declare class GitPathError extends GitParseError {
    constructor(message: string);
}
export declare function splitNul(input: Buffer): Buffer[];
/** Split a `-z` stream only when its final record is explicitly terminated. */
export declare function splitNulStrict(input: Buffer, label?: string): Buffer[];
/**
 * Validate a public string before it is persisted, joined, or passed to Git.
 * Entity/blob-lineage V1 paths deliberately support valid UTF-8 only.
 */
export declare function assertValidGitPath(input: string): string;
export declare function decodeGitPath(input: Buffer | string): string;
/**
 * Map a git status letter to the typed status. Exported so the raw
 * `diff-tree` reader in api.ts classifies exactly as `--name-status` parsing
 * does, rather than growing a second table that can drift.
 */
export declare function statusFromCode(status: string): GitFileStatus;
/**
 * Parse `--raw -z` diff records: the form emitted by `git diff-tree --raw` and
 * `git log --raw`. Each record is
 *
 *   `:<oldmode> <newmode> <oldsha> <newsha> <STATUS>\0<path>\0`
 *
 * with rename and copy statuses carrying a similarity score and a second path
 * (`R100\0<oldpath>\0<newpath>\0`).
 *
 * `--raw` is the only diff format that reports both blob object ids, which is
 * what makes historical entity extraction affordable: the ids address the exact
 * bytes of a file at a revision, so parse results can be cached
 * content-addressably. Git's all-zero placeholder for "absent on this side" is
 * normalized to `undefined`.
 *
 * Framing is deliberately strict. A prefix, malformed header, missing path, or
 * unterminated final record makes the complete stream unusable rather than
 * turning a valid prefix into apparently complete evidence.
 */
export declare function parseRawDiffRecordsZ(_input: Buffer): GitCommitFileChange[];
/**
 * Parse `git ls-tree -r -z` output: `<mode> <type> <sha>\t<path>\0`. Blobs are
 * the only entries of interest, so submodules (`commit`) and trees are dropped.
 */
export declare function parseLsTreeZ(_input: Buffer): GitTreeEntry[];
/** Rename/copy similarity score: `R75` → `75`. Exported alongside `statusFromCode`. */
export declare function parseSimilarity(status: string): number | undefined;
export declare function parseNameStatusZ(_input: Buffer): GitChangedFile[];
export declare function parseNumstatZ(_input: Buffer): GitNumstat[];
export interface ParseDiffPatchHunksOptions {
    includeLineText?: boolean;
}
export declare function parseDiffPatchHunks(_patch: string, _range: GitRange, _options?: ParseDiffPatchHunksOptions): GitDiffHunks;
export declare function parseLogRecords(_input: Buffer): GitCommit[];
export declare function parseLogNumstatZ(_input: Buffer): GitLogNumstatRecord[];
export declare function aggregateChurn(_records: readonly GitLogNumstatRecord[], _range: GitRange, _sortedBy?: GitChurnSort): GitChurnSummary;
export declare function aggregateCochange(_records: readonly GitLogNumstatRecord[], _range: GitRange, _options?: GitCochangeAggregationOptions): GitCochangeSummary;
