export declare const LFS_TYPE = "application/vnd.git-lfs+json"; export type LfsObject = { oid: string; size: number | string; }; /** Where a pack keeps its objects: by oid. */ /** Where a server keeps its LFS objects: an object's size when it holds one (the batch API answers from it, never * loading the object), and the store an upload's verified bytes go to. */ export type LfsStore = { size(oid: string): Promise; put(oid: string, bytes: Uint8Array): Promise; /** an upload's body written as it arrives and kept only when `accept` holds for its size and SHA-256 (`ctx.blobs.putStream`): * a store with it never holds an object whole */ putStream?(oid: string, chunks: AsyncIterable, accept: (written: { size: number; sha256: string; }) => boolean): Promise; }; /** A pointer file's object (`version https://git-lfs.github.com/spec/v1`, `oid sha256:`, `size `), or null * for any other file. */ export declare function parseLfsPointer(file: Uint8Array | string): LfsObject | null; /** A pointer file's text for an object. */ export declare const lfsPointer: (o: LfsObject) => string; /** An object's sha256, as its oid. */ export declare function lfsOid(bytes: Uint8Array): Promise; /** `POST …/info/lfs/objects/batch`: for each object asked, an upload's action (none when the object is held already) or * a download's (an error when it is not held), by the basic transfer. `href` names where an object goes up or comes * down; `header` is sent with each action. */ export declare function lfsBatch(body: unknown, opts: { store: LfsStore; href: (operation: 'upload' | 'download', o: LfsObject) => string; header?: Record; }): Promise; /** A basic transfer's upload (`PUT` of the object's bytes): kept when they hash to the oid and have the declared size * (the size is the request's Content-Length when the caller has no other), else refused and nothing kept. A body * stream goes to the store's `putStream` as it arrives, read no further than the declared size; bytes, or a store * without one, are checked whole. */ export declare function lfsUpload(body: Uint8Array | ReadableStream | null, o: LfsObject, store: LfsStore): Promise;