import { type GitObjectStore } from './objects.js'; import { type Service } from './smart-http.js'; /** One exchange: `GET info/refs?service=` when there is no body, `POST ` when there is. It answers * the response's bytes, and throws when the server did not answer 200. */ export type SmartHttpTransport = (request: { service: Service; body?: Uint8Array; }) => Promise; /** What a server advertises: its refs (peeled `^{}` lines dropped), the ref its HEAD names, and its capabilities. */ export type RemoteRefs = { refs: Map; head: string | null; caps: string[]; }; /** `GET info/refs?service=`, read. */ export declare function lsRemote(transport: SmartHttpTransport, service: Service): Promise; /** `POST git-upload-pack` with `done`: every object `wants` reach and `haves` do not, read into `store`. */ export declare function fetchPack(transport: SmartHttpTransport, store: GitObjectStore, wants: string[], haves: string[]): Promise; /** One ref update a push asks for: `old` is the server's value as advertised (ZERO_SHA to create), `new` the object * to point it at (ZERO_SHA to delete). */ export type PushCommand = { name: string; old: string; new: string; }; /** `POST git-receive-pack`: the commands and the pack of what they need beyond `haves`, atomic when `atomic` (the * server offered it). Answers each command's outcome by ref name: null when the server took it, else its reason. */ export declare function sendPack(transport: SmartHttpTransport, store: GitObjectStore, commands: PushCommand[], haves: string[], atomic?: boolean): Promise>;