import { type Provider } from "@coldtea/pr-lens-schema"; export declare const git: (repo: string, args: readonly string[]) => Promise; export type Commit = { sha: string; ref: string | undefined; }; /** * A ref becomes the commit it named at the moment of the run, and a branch * keeps its name for the permalinks. `HEAD` is resolved to a branch name when * it is on one, since "HEAD" tells a reader of the comment nothing. */ export declare const resolveCommit: (repo: string, ref: string) => Promise; /** * The commit the pull request would be compared against, not the tip of the * base branch: a diff against the tip would attribute every change made on * the base branch since the fork point to this pull request. */ export declare const mergeBase: (repo: string, base: string, head: string) => Promise; export type ChangedFile = { path: string; additions: number | undefined; deletions: number | undefined; }; export type Diff = { files: ChangedFile[]; additions: number; deletions: number; patch: string; truncatedAt: number | undefined; }; export declare const collectDiff: (repo: string, base: string, head: string, maxPatchBytes: number) => Promise; export type RepoSlug = { owner: string; name: string; host: string; provider: Provider; }; /** * Which forge a host belongs to. bitbucket.org is exact because Bitbucket * Cloud has one host; anything with "gitlab" in the name is taken to be a * self-managed GitLab, since those hosts follow no other convention; and * everything else is treated as GitHub, which keeps today's behavior for * every repository the CLI already handles. A self-managed GitLab on a host * that does not say so is what `--forge` exists for. */ export declare const providerForHost: (host: string) => Provider; /** * Where a pull request lives on each forge. The number is the same concept * everywhere — GitLab's iid, Bitbucket's id — but each forge spells the path * differently, and a wrong spelling is a 404 in the reader's face. */ export declare const pullRequestUrl: (slug: RepoSlug, pr: number) => string; export declare const parseRemoteUrl: (url: string) => RepoSlug | undefined; export declare const parseRepoSlug: (slug: string) => RepoSlug | undefined; export declare const remoteSlug: (repo: string, remote: string) => Promise; export declare const repositoryRoot: (repo: string) => Promise; //# sourceMappingURL=git.d.ts.map