import type { HfHubAccessor } from '../../accessor/hf_hub.ts'; /** One file a commit adds or replaces. */ export interface Addition { path: string; data: Uint8Array; } /** * A write the Hub will only accept through the LFS/Xet upload path. * * Thrown rather than papered over, because the alternative is a commit that * references content the Hub never received: the file would appear in the * tree and every read of it would fail. Which files land here is the * repository's own `.gitattributes` plus a size threshold, so it is the * repo's decision, not a fixed byte count this code could apply. */ export declare class LfsRequiredError extends Error { constructor(message: string); } /** The commit endpoint for one revision. */ export declare function commitUrl(accessor: HfHubAccessor, revision?: string): string; /** * Ask the Hub how each file must be uploaded. * * The Hub decides regular-vs-LFS-vs-Xet from the repository's * `.gitattributes` and the file's size, so it is asked rather than guessed. It * only needs the first bytes to sniff the type, which is why a sample rather * than the content is sent. */ export declare function uploadModes(accessor: HfHubAccessor, additions: Addition[], revision?: string): Promise>; /** * Serialize one commit as newline-delimited JSON. * * The header line comes first and carries the message; every operation is one * line after it. This is the Hub's own shape, not a convention chosen here. */ export declare function payload(additions: Addition[], deletions: string[], folders: string[], message: string, description?: string, parent?: string): Uint8Array; export interface CommitOptions { additions?: Addition[]; deletions?: string[]; folders?: string[]; message?: string; description?: string; createPr?: boolean; revision?: string; } /** * Apply one commit to the repository. * * Every addition is checked against the preupload endpoint first, and a file * the Hub wants uploaded out of band is refused here rather than referenced by * a commit whose content never arrived. */ export declare function commit(accessor: HfHubAccessor, options?: CommitOptions): Promise>; //# sourceMappingURL=commit.d.ts.map