|
| 1 | +/*--------------------------------------------------------------------------------------------- |
| 2 | +* Copyright (c) Microsoft Corporation. All rights reserved. |
| 3 | +* Licensed under the MIT License. See License.txt in the project root for license information. |
| 4 | +*--------------------------------------------------------------------------------------------*/ |
| 5 | + |
| 6 | +import type * as vscode from 'vscode'; |
| 7 | +import type * as vscodeTypes from 'vscode'; |
| 8 | +import type { Event, MessageItem, Uri, WorkspaceFolder } from 'vscode'; |
| 9 | +import type { AzExtInputBoxOptions, AzExtOpenDialogOptions, AzExtWorkspaceFolderPickOptions, IAzureMessageOptions, IAzureQuickPickItem, IAzureQuickPickOptions, IAzureUserInput, IActionContext, PromptResult } from './index'; |
| 10 | + |
| 11 | +/** |
| 12 | + * Wrapper class of several `vscode.window` methods that handle user input. |
| 13 | + * This class is meant to only be used for copilot input scenerios |
| 14 | + */ |
| 15 | +export declare class CopilotUserInput implements IAzureUserInput { |
| 16 | + constructor(vscode: typeof import('vscode'), relevantContext?: string, getLoadingView?: () => vscodeTypes.WebviewPanel | undefined); |
| 17 | + onDidFinishPrompt: Event<PromptResult>; |
| 18 | + showQuickPick<T extends IAzureQuickPickItem>(items: T[] | Thenable<T[]>, options: IAzureQuickPickOptions & { canPickMany: true; }): Promise<T[]>; |
| 19 | + showQuickPick<T extends IAzureQuickPickItem>(items: T[] | Thenable<T[]>, options: IAzureQuickPickOptions): Promise<T>; |
| 20 | + showInputBox(options: AzExtInputBoxOptions): Promise<string>; |
| 21 | + showWarningMessage<T extends MessageItem>(message: string, ...items: T[]): Promise<T>; |
| 22 | + showWarningMessage<T extends MessageItem>(message: string, options: IAzureMessageOptions, ...items: T[]): Promise<T>; |
| 23 | + showOpenDialog(options: AzExtOpenDialogOptions): Promise<Uri[]>; |
| 24 | + showWorkspaceFolderPick(options: AzExtWorkspaceFolderPickOptions): Promise<WorkspaceFolder>; |
| 25 | +} |
| 26 | + |
| 27 | +/** |
| 28 | + * Disposes of copilot session created by `CopilotUserInput` |
| 29 | + * Should be called after commands using `CopilotUserInput` to prevent any lingering copilot sessions |
| 30 | + */ |
| 31 | +export function disposeCopilotSession(): Promise<void>; |
| 32 | + |
| 33 | +/** |
| 34 | + * When setting the ui to `CopilotUserInput`, call this function so that the context can be properly identified |
| 35 | + * @param context The context to mark as using `CopilotUserInput` |
| 36 | + */ |
| 37 | +export function markAsCopilotUserInput(context: IActionContext, relevantContext?: string, getLoadingView?: () => vscode.WebviewPanel | undefined): void; |
| 38 | + |
| 39 | +export function createPrimaryPromptToGetSingleQuickPickInput(picks: string[], placeholder?: string): string; |
| 40 | +export function createPrimaryPromptToGetPickManyQuickPickInput(picks: string[], relevantContext?: string): string; |
| 41 | +export function createPrimaryPromptForInputBox(inputQuestion: string, relevantContext?: string): string; |
| 42 | +export function createPrimaryPromptForWarningMessage(message: string, items: MessageItem[]): string; |
| 43 | +export function createPrimaryPromptForWorkspaceFolderPick(folders: readonly vscode.WorkspaceFolder[] | undefined, relevantContext?: string): string; |
| 44 | +export function doGithubCopilotInteraction(primaryPrompt: string, relevantContext?: string): Promise<string>; |
| 45 | +export function getCopilotSession(relevantContext?: string): Promise<unknown>; |
0 commit comments