/** * @file GitHub pull request merge-async REST helpers. The only merge * endpoint that accepts stacked pull requests. */ /** * Fetch the current result for a UUID. `enqueued` is final for queue * requests; poll the merge-check endpoint for the eventual merge state. */ export declare function getPullRequestMergeResult(config: GetPullRequestMergeResultConfig): Promise; /** * Standard headers: JSON accept/content-type, the API version the endpoint * ships in, and a Bearer token when one resolves. */ export declare function pullMergeHeaders(token?: string | undefined): Record; export type PullRequestAsyncMergeStatus = 'pending' | 'merged' | 'enqueued' | 'failed'; export type PullRequestMergeAction = 'default' | 'direct_merge' | 'merge_queue'; export type PullRequestMergeMethod = 'merge' | 'squash' | 'rebase'; export interface PullRequestMergePendingDetails { readonly bypassRules?: boolean | undefined; readonly expectedHeadSha: string; readonly mergeAction: 'default' | 'merge_queue' | 'direct_merge'; readonly mergeMethod: 'default' | 'merge' | 'squash' | 'rebase'; readonly message: string; readonly uuid: string; } export interface PullRequestMergeMergedDetails { readonly message: string; readonly sha: string; } export interface PullRequestMergeMessageDetails { readonly message: string; } export type PullRequestMergeDetails = PullRequestMergePendingDetails | PullRequestMergeMergedDetails | PullRequestMergeMessageDetails; export interface PullRequestAsyncMergeResult { readonly details: PullRequestMergeDetails; readonly status: PullRequestAsyncMergeStatus; } export interface RequestPullRequestMergeConfig { /** * Override the API origin (GitHub Enterprise / tests). */ readonly apiUrl?: string | undefined; /** * Whether to bypass repository rules the authenticated actor may bypass. */ readonly bypassRules?: boolean | undefined; /** * Extra commit-message detail. Direct merges only. */ readonly commitMessage?: string | undefined; /** * Automatic commit-message title. Direct merges only. */ readonly commitTitle?: string | undefined; /** * `direct_merge` skips a configured queue, `merge_queue` requires one, * `default` uses a queue when the target branch has one. */ readonly mergeAction?: PullRequestMergeAction | undefined; /** * The merge method. Direct merges only. */ readonly mergeMethod?: PullRequestMergeMethod | undefined; /** * Pull request number to merge. */ readonly pullNumber: number; /** * Repo in "owner/name" form. */ readonly repo: string; /** * SHA the PR head must match. When omitted, GitHub pins the head at * request time and cancels the merge if the PR moves. */ readonly sha?: string | undefined; /** * GitHub token with contents:write. Falls back to `getGitHubToken()` * (env → `git config` → `gh`) when omitted. */ readonly token?: string | undefined; } export type GetPullRequestMergeResultConfig = Omit & { readonly uuid: string; }; /** * Request an async merge: `pending` (202 or 409), `merged`, or `enqueued`. * A 400/403/404/422 throws `HttpResponseError`; rule violations fail later. */ export declare function requestPullRequestMerge(config: RequestPullRequestMergeConfig): Promise;