/** Converts string or Uint8Array to bytes. */
export declare function toBytes(data: string | Uint8Array): Uint8Array;
/** Default hash function using node:crypto SHA-1. */
export declare function defaultHash(data: Uint8Array): string;
/**
 * Eagerly kicks off the async crypto probe when no custom hash is provided.
 * Returns a promise that resolves when the probe completes.
 */
export declare function initCryptoReady(hash: HashFn | undefined): Promise<boolean>;
export type HashFn = (data: Uint8Array) => string;
/** Computes a Git blob SHA-1: `SHA1("blob " + len + "\0" + content)`. */
export declare function hashBlob(hash: HashFn, content: Uint8Array): string;
export interface TreeEntry {
    readonly mode: string;
    readonly path: string;
    readonly oid: string;
}
/** Builds the binary tree buffer in Git's internal format and hashes it. */
export declare function hashTree(hash: HashFn, entries: TreeEntry[]): string;
interface CommitData {
    readonly treeOid: string;
    readonly parents: readonly string[];
    readonly message: string;
    readonly author: string;
    readonly date: string;
}
/** Builds a Git-style commit string and hashes it. */
export declare function hashCommit(hash: HashFn, opts: CommitData): string;
/** Parses a single mktree-formatted line into mode, path, and oid. */
export declare function parseMktreeEntry(line: string): TreeEntry;
export {};
