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