import { CancellationToken } from "../../../../base/common/cancellation.js"; import { Disposable, IReference } from "../../../../base/common/lifecycle.js"; import { IInstantiationService } from "../../../../platform/instantiation/common/instantiation.js"; import { ILogService } from "../../../../platform/log/common/log.service.js"; import { IGitHubChangedFile, IGitHubPullRequestChanges, IGitHubPullRequestContext, IGitHubPullRequestSummary, IGitHubPullRequestsPage, IGitHubRepository } from "../common/types.js"; import { GitHubPullRequestModel } from "./models/githubPullRequestModel.js"; import { GitHubPullRequestReviewThreadsModel } from "./models/githubPullRequestReviewThreadsModel.js"; import { GitHubPullRequestCIModel } from "./models/githubPullRequestCIModel.js"; import { GitHubIssueModel } from "./models/githubIssueModel.js"; import { IGitHubRecentIssue, IGitHubRecentPullRequest, IGitHubRecentPullRequestReviewThread } from "./fetchers/githubRecentUserWorkFetcher.js"; import { IObservable } from "../../../../base/common/observable.js"; import { ISessionsService } from "../../../services/sessions/browser/sessionsService.service.js"; import { GitHubCommit } from "../../../../platform/github/common/githubQueryService.js"; import { ApiRequestOptions } from "@codingame/monaco-vscode-github-service-override/vscode/vs/platform/github/common/client/request"; import { URI } from "../../../../base/common/uri.js"; import { IGitHubService } from "./githubService.service.js"; /** Whether a reference can be resolved by the currently configured GitHub service. */ export declare function isGitHubReferenceSupported(uri: URI, enterpriseHost: string | undefined): boolean; export declare class GitHubService extends Disposable implements IGitHubService { private readonly _logService; readonly _serviceBrand: undefined; readonly activeSessionPullRequestObs: IObservable; readonly activeSessionPullRequestCIObs: IObservable; readonly activeSessionPullRequestReviewThreadsObs: IObservable; private readonly _changesFetcher; private readonly _recentUserWorkFetcher; private readonly _pullRequestsFetcher; private readonly _pullRequestFetcher; private readonly _pullRequestContextFetcher; private readonly _repositoryFetcher; private readonly _pullRequestReferences; private readonly _pullRequestReviewThreadsReferences; private readonly _pullRequestCIReferences; private readonly _issueReferences; private readonly _apiClient; get enterpriseHost(): string | undefined; /** * Cache of in-flight / resolved `findPullRequestNumberByHeadBranch` * lookups, keyed by `${owner}/${repo}#${branch}`. Promises are kept * indefinitely — PR-number assignment is monotonic for the lifetime of * a branch, and live PR state (open/closed/draft, CI) is refreshed via * `createPullRequestModelReference` once we know the number. */ private readonly _findPRByBranchCache; constructor(instantiationService: IInstantiationService, sessionsService: ISessionsService, _logService: ILogService); authenticateForRepositoryAccess(token: CancellationToken): Promise; getRepositories(query: string, token: CancellationToken): Promise; createPullRequestModelReference(owner: string, repo: string, prNumber: number): IReference; createPullRequestReviewThreadsModelReference(owner: string, repo: string, prNumber: number): IReference; createPullRequestCIModelReference(owner: string, repo: string, prNumber: number, headSha: string): IReference; createIssueModelReference(owner: string, repo: string, issueNumber: number): IReference; getCommit(owner: string, repo: string, sha: string, token: CancellationToken): 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>; getChangedFiles(owner: string, repo: string, base: string, head: string): Promise; getPullRequestChangedFiles(owner: string, repo: string, pullRequestNumber: number): Promise; getPullRequestChanges(owner: string, repo: string, pullRequestNumber: number): Promise; getFileContent(owner: string, repo: string, path: string, ref: string): Promise; 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; findPullRequestNumberByHeadBranch(owner: string, repo: string, branch: string): Promise; private _fetchPullRequestNumberByHeadBranch; }