Path: blob/main/extensions/copilot/src/extension/githubPullRequest.d.ts
13388 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import type { CancellationToken, Disposable, Uri } from 'vscode';67export interface TitleAndDescriptionProvider {8provideTitleAndDescription(context: { commitMessages: string[]; patches: string[] | { patch: string; fileUri: string; previousFileUri?: string }[]; issues?: { reference: string; content: string }[]; template?: string; compareBranch?: string }, token: CancellationToken): Promise<{ title: string; description?: string } | undefined>;9}1011export interface ReviewerComments {12// To tell which files we should add a comment icon in the "Files Changed" view13files: Uri[];14succeeded: boolean;15// For removing comments16disposable?: Disposable;17}1819export interface ReviewerCommentsProvider {20provideReviewerComments(context: { repositoryRoot: string; commitMessages: string[]; patches: { patch: string; fileUri: string; previousFileUri?: string }[] }, token: CancellationToken): Promise<ReviewerComments>;21}2223export interface RepositoryDescription {24owner: string;25repositoryName: string;26defaultBranch: string;27currentBranch?: string;28pullRequest?: {29title: string;30url: string;31number: number;32id: number;33};34}3536export interface API {37/**38* Register a PR title and description provider.39*/40registerTitleAndDescriptionProvider(title: string, provider: TitleAndDescriptionProvider): Disposable;4142/**43* Register a PR reviewer comments provider.44*/45registerReviewerCommentsProvider(title: string, provider: ReviewerCommentsProvider): Disposable;4647/**48* Get the repository description for a given URI.49* This includes the owner, repository name, default branch, current branch (if applicable),50* and pull request information (if applicable).51*52* @returns A promise that resolves to a `RepositoryDescription` object or `undefined` if no repository is found.53*/54getRepositoryDescription(uri: Uri): Promise<RepositoryDescription | undefined>;55}565758