import { type PullRequest, type PRFilters, type MergeOptions } from "../../types/index.js"; /** * Service for GitHub pull request operations * Single Responsibility: PR operations */ export declare class PRService { /** * List pull requests with filters * Note: GitHub API doesn't support state="all" for PRs, so we fetch both open and closed separately */ list(filters?: PRFilters): Promise; /** * Get a specific PR by number */ get(prNumber: number, opts?: { quiet?: boolean; }): Promise; /** * Get PR for a specific issue */ getByIssue(issueNumber: number, openOnly?: boolean): Promise; /** * Merge a pull request */ merge(prNumber: number, options: MergeOptions): Promise; /** * Checkout a PR branch locally */ checkout(prNumber: number): Promise; /** * Get PR diff */ getDiff(prNumber: number): Promise; /** * Wait for PR to be created for an issue */ waitForCreation(issueNumber: number, timeoutSeconds?: number): Promise; /** * Delete a branch */ deleteBranch(branchName: string): Promise; /** * Get PR timeline events */ getTimeline(prNumber: number): Promise; /** * Get PR review comments */ getReviewComments(prNumber: number): Promise; /** * Check if PR is mergeable */ isMergeable(prNumber: number): Promise; /** * Check if PR is a draft */ isDraft(prNumber: number): Promise; /** * Convert draft PR to ready for review */ convertToReady(prNumber: number): Promise; /** * Get all PRs for an issue (including closed) */ getAllByIssue(issueNumber: number): Promise; /** * Request review from GitHub Copilot */ requestCopilotReview(prNumber: number): Promise; /** * Get the latest Copilot comment on the PR linked to an issue */ getLatestCopilotCommentForIssue(issueNumber: number): Promise<{ author: string; date: string; body: string; } | null>; /** * Wrap a value in single quotes for safe shell interpolation. * Escapes embedded single quotes with the standard `'\''` idiom. */ private shellQuote; /** * Read the merge commit SHA and best-effort merge method for a PR. * * The shared `PullRequestSchema` doesn't carry the merge commit, so this * reads it (and the PR's own commit list) via `gh pr view`, then classifies * the merge shape so the caller can pick the right revert: * - `merge` → the merge commit has ≥2 parents (revert with `-m 1`) * - `rebase` → the merge commit SHA is one of the PR's own commits * (GitHub replayed them onto the base; revert each newest-first) * - `squash` → otherwise (a single new commit; revert it directly) * * `commitShas` is returned oldest-first (as GitHub reports it) for the * rebase case. */ getMergeInfo(prNumber: number): Promise<{ mergeCommitSha: string | null; mergeMethodGuess: "squash" | "merge" | "rebase"; commitShas: string[]; }>; /** * Create a pull request via `gh pr create`. * * The body is passed on stdin (`--body-file -`) so it can contain any * special characters safely (mirrors `IssueService.addComment`). Returns the * new PR number and URL. */ create(params: { base: string; head: string; title: string; body: string; draft?: boolean; }): Promise<{ number: number; url: string; }>; } //# sourceMappingURL=PRService.d.ts.map