import { CancellationToken } from "../../../../base/common/cancellation.js"; import { IReference } from "../../../../base/common/lifecycle.js"; import { IObservable } from "../../../../base/common/observable.js"; import { ApiRequestOptions } from "@codingame/monaco-vscode-github-service-override/vscode/vs/platform/github/common/client/request"; import { GitHubCommit } from "../../../../platform/github/common/githubQueryService.js"; import { IGitHubRepository, IGitHubChangedFile, IGitHubPullRequestChanges, IGitHubPullRequestsPage, IGitHubPullRequestSummary, IGitHubPullRequestContext } from "../common/types.js"; import { IGitHubRecentIssue, IGitHubRecentPullRequest, IGitHubRecentPullRequestReviewThread } from "./fetchers/githubRecentUserWorkFetcher.js"; import { GitHubIssueModel } from "./models/githubIssueModel.js"; import { GitHubPullRequestCIModel } from "./models/githubPullRequestCIModel.js"; import { GitHubPullRequestModel } from "./models/githubPullRequestModel.js"; import { GitHubPullRequestReviewThreadsModel } from "./models/githubPullRequestReviewThreadsModel.js"; export interface IGitHubService { readonly _serviceBrand: undefined; readonly enterpriseHost: string | undefined; activeSessionPullRequestObs: IObservable; activeSessionPullRequestCIObs: IObservable; activeSessionPullRequestReviewThreadsObs: IObservable; /** Obtain repository access before opening the repository picker. */ authenticateForRepositoryAccess(token: CancellationToken): Promise; /** Silently search up to 100 repositories, or list the user's most recently updated accessible repositories for an empty query. */ getRepositories(query: string, token: CancellationToken): Promise; /** * Get a reference to a reactive model for a GitHub pull request. */ createPullRequestModelReference(owner: string, repo: string, prNumber: number): IReference; /** * Get a reference to a reactive model for review threads on a GitHub pull request. */ createPullRequestReviewThreadsModelReference(owner: string, repo: string, prNumber: number): IReference; /** * Get a reference to a reactive model for CI checks on a pull request head SHA. */ createPullRequestCIModelReference(owner: string, repo: string, prNumber: number, headSha: string): IReference; /** * Get a reference to a reactive model for a GitHub issue. */ createIssueModelReference(owner: string, repo: string, issueNumber: number): IReference; getCommit(owner: string, repo: string, sha: string, token: CancellationToken): Promise; /** * List files changed between two refs using the GitHub compare API. */ getChangedFiles(owner: string, repo: string, base: string, head: string): Promise; getPullRequestChangedFiles(owner: string, repo: string, pullRequestNumber: number): Promise; /** * List the files a pull request changes along with its current title and * the merge base and head commits that bound its diff. */ getPullRequestChanges(owner: string, repo: string, pullRequestNumber: number): Promise; getFileContent(owner: string, repo: string, path: string, ref: string): Promise; /** List one page of open pull requests, ordered by most recently updated. */ getPullRequests(owner: string, repo: string, cursor?: string): Promise; getPullRequestsWaitingForReview(owner: string, repo: string): Promise; getPullRequestsAssignedToViewer(owner: string, repo: string): Promise; getPullRequestContext(owner: string, repo: string, number: number): Promise; /** * Find the most recently updated pull request whose head branch is * `branch` in `owner/repo`. Returns `undefined` if no PR exists. * * Successful numeric results are cached per `(owner, repo, branch)` * for the lifetime of the service (PR number is monotonic per * branch lifetime). Transient failures and `undefined` results are * not cached, so a later retry can succeed once a PR is created. */ findPullRequestNumberByHeadBranch(owner: string, repo: string, branch: string): Promise; getRecentAssignedIssues(owner: string, repo: string, token: CancellationToken, options?: ApiRequestOptions): Promise; getRecentAuthoredPullRequests(owner: string, repo: string, token: CancellationToken, options?: ApiRequestOptions): Promise; getPullRequestReviewThreads(owner: string, repo: string, pullRequestNumber: number, token: CancellationToken, options?: ApiRequestOptions): Promise; getIssuesWithLinkedPullRequests(owner: string, repo: string, issueNumbers: readonly number[], token: CancellationToken, options?: ApiRequestOptions): Promise>; } export declare const IGitHubService: import("../../../../platform/instantiation/common/instantiation.js").ServiceIdentifier;