/** * Ambient module declarations for dependencies that lack type definitions. */ declare module '@git-stunts/plumbing' { interface ExecuteOptions { args: string[]; input?: string | Uint8Array; env?: Record; } interface StreamResult extends AsyncIterable { collect(options?: { asString?: boolean; maxBytes?: number }): Promise; destroy(): Promise; finished: Promise<{ code: number; stderr: string }>; } type ShellRunner = (options: Record) => Promise; interface GitObjectInfo { oid: string; type: string; size: number; } interface GitObject extends GitObjectInfo { content: Uint8Array; } interface GitCatFileSession { info(objectName: string): Promise; read(objectName: string, options?: { maxBytes?: number }): Promise; close(): Promise; terminate(): Promise; } interface GitMktreeSession { write( entries: Array<{ mode: string; type: string; oid: string; name: string }> ): Promise; close(): Promise; terminate(): Promise; } interface GitFastImportSession { writeBlob(content: string | Uint8Array): Promise; checkpoint(): Promise; close(): Promise; abort(): Promise; } export class GitObjectMissingError extends Error { details?: Record; } export class GitProtocolError extends Error {} export class InvalidArgumentError extends Error {} export class ShellRunnerFactory { static ENV_BUN: 'bun'; static ENV_DENO: 'deno'; static ENV_NODE: 'node'; static create(options?: Record): ShellRunner; static validateCwd(cwd: string): Promise; } export default class GitPlumbing { constructor(options: { runner: ShellRunner; cwd?: string }); static createDefault(options?: { cwd?: string; env?: string }): Promise; static createRepository(options?: { cwd?: string; env?: string }): Promise; execute(options: ExecuteOptions): Promise; executeStream(options: ExecuteOptions): Promise; openCatFileSession(): Promise; openMktreeSession(): Promise; openFastImportSession(): Promise; } } declare module 'bun' { export class CryptoHasher { constructor(algorithm: string); update(data: Buffer | Uint8Array | string): this; digest(encoding: 'hex'): string; digest(): Uint8Array; } }