import { GitObjectStore } from './objects.js'; /** A best common ancestor of `a` and `b` (one that is not an ancestor of another common ancestor), or null. */ export declare function mergeBase(store: GitObjectStore, a: string, b: string, limit?: number): Promise; export type TreeChange = { path: string; status: 'added' | 'removed' | 'modified'; oldSha?: string; newSha?: string; oldMode?: string; newMode?: string; }; /** Recursive tree compare between two commits or trees (paths in the post-image order, no rename pairing — like `diff-tree -r` without -M). */ export declare function diffTrees(store: GitObjectStore, from: string | null, to: string, prefix?: string): Promise; export type Edit = { kind: ' ' | '-' | '+'; line: string; }; /** A shortest edit script between two texts (Myers, O((N+M)D)). */ export declare function lineDiff(oldText: string, newText: string): Edit[]; /** The unified-diff hunks (the body GitHub serves as a file's `patch`), 3 lines of context. */ export declare function unifiedPatch(oldText: string, newText: string, context?: number): string; export type DiffFile = { filename: string; status: 'added' | 'removed' | 'modified'; additions: number; deletions: number; sha?: string; patch?: string; }; /** GitHub's file list between `base` and `head` (three-dot: from merge-base(base, head), or base when histories are unrelated), with counts and patches. */ export declare function diffFiles(store: GitObjectStore, baseSha: string, headSha: string, opts?: { patch?: boolean; }): Promise; /** Three-way line merge. Return null for overlapping edits; preserve exact line endings. * Binary payloads belong to the caller's conflict path, never a text decoder's replacement. */ export declare function mergeText(base: string, ours: string, theirs: string): string | null; /** The blob at a path in a commit (walking its trees segment by segment), or null when the commit, a directory on the * way or the file is not there. A host that serves a file at a revision (the Hugging Face Hub's `resolve`) reads it. */ export declare function blobAt(store: GitObjectStore, commit: string, path: string): Promise<{ sha: string; mode: string; bytes: Uint8Array; } | null>;