import type { Env } from "../ci/env.js"; export interface Ident { name: string; email: string; } /** Default author and committer of release commits. */ export declare const RELEASE_IDENTITY: Ident; export interface CommitIdentity { author: Ident; committer: Ident; } /** * Identity from `GIT_AUTHOR_*` and `GIT_COMMITTER_*`; the committer defaults * to the author and each field to `RELEASE_IDENTITY` when empty. */ export declare const identityFromEnv: (env: Readonly>) => CommitIdentity; export interface PushOptions { /** `--atomic`: every ref updates or none. */ atomic?: boolean; /** `--force-with-lease` per remote ref: expected sha, `""` when the ref must not exist. */ leases?: Readonly>; /** Auth header for an http(s) remote, replacing persisted checkout credentials. */ token?: string | undefined; } /** Git writes of effects; never touches the working tree, index or HEAD. */ export interface GitWriter { /** * Commit of `files` without `deletes` on top of `parent` with the configured * identity and both dates set to `date`, so equal input gives an equal sha; * not signed. Deleting a missing path is a no-op. */ commitFiles: (commit: { parent: string; files: ReadonlyMap; deletes?: readonly string[]; message: string; date: string; }) => Promise; /** Lightweight tag; no-op at `sha`, `E_TAG_EXISTS` elsewhere unless `force`. */ tag: (name: string, sha: string, opts?: { force?: boolean; }) => Promise; /** Pushes refspecs to the remote; a failed lease is `E_PUSH_LEASE`. */ push: (refspecs: readonly string[], opts?: PushOptions) => Promise; } /** `GitWriter` backed by the `git` executable in `cwd`. */ export declare const gitWriter: (cwd: string, debug?: (message: string) => void, { identity, env, remote, }?: { identity?: CommitIdentity; env?: Env; remote?: string; }) => GitWriter;