import { CancellationToken, Event, IMarkdownString, IThemeColor, MaybePromise, MessageType } from '@opensumi/ide-core-common'; import { QuickInputOptions, QuickPickItem, QuickPickOptions, QuickTitleButton } from '@opensumi/ide-quick-open'; import { Severity } from './enums'; import * as types from './ext-types'; import { QuickInputButton, UriComponents } from './ext-types'; import { IExtensionDescription } from './extension'; import type vscode from 'vscode'; export interface IMainThreadMessage { $showMessage(type: MessageType, message: string, options: vscode.MessageOptions, actions: string[], from?: string): Promise; } export interface IExtHostMessage { showMessage(type: MessageType, message: string, optionsOrFirstItem?: vscode.MessageOptions | string | vscode.MessageItem, from?: string, ...rest: (string | vscode.MessageItem)[]): Promise; } export interface IMainThreadQuickOpen { $showQuickPick(session: number, items: QuickPickItem[], options?: QuickPickOptions): Promise; $hideQuickPick(): void; $showQuickInput(options: QuickInputOptions, validateInput: boolean): Promise; $hideQuickInput(): void; $updateQuickPick(options: QuickPickOptions): void; $createOrUpdateInputBox(id: number, options: QuickInputOptions): void; $hideInputBox(id: number): void; $disposeInputBox(id: number): void; } type VSCodeQuickPickItem = string | vscode.QuickPickItem; export interface IExtHostQuickOpen { $onDidTriggerButton(handler: number): void; $onDidTriggerItemButton(itemHandler: number, buttonHandler: number): void; $onItemSelected(handler: number): void; showQuickPick(promiseOrItems: vscode.QuickPickItem[] | Promise, options?: vscode.QuickPickOptions, token?: CancellationToken): Promise; showQuickPick(promiseOrItems: vscode.QuickPickItem[] | Promise, options?: vscode.QuickPickOptions & { canSelectMany: true; }, token?: CancellationToken): Promise; showQuickPick(promiseOrItems: string[] | Promise, options?: QuickPickOptions, token?: CancellationToken): Promise; showQuickPick(itemsOrItemsPromise: VSCodeQuickPickItem[] | Promise, options?: vscode.QuickPickOptions, token?: vscode.CancellationToken): Promise; showWorkspaceFolderPick(options: vscode.WorkspaceFolderPickOptions, token?: CancellationToken): Promise; createQuickPick(): vscode.QuickPick; createInputBox(): vscode.InputBox; hideQuickPick(): void; showInputBox(options?: vscode.InputBoxOptions, token?: CancellationToken): PromiseLike; hideInputBox(): void; $validateInput(input: string): MaybePromise; $onDidChangeValue(sessionId: number, value: string): void; $onCreatedInputBoxDidChangeValue(sessionId: number, value: string): void; $onCreatedInputBoxDidAccept(sessionId: number): void; $onCreatedInputBoxDidHide(sessionId: number): void; $onCreatedInputBoxDidTriggerButton(sessionId: number, btnHandler: number): void; } export interface QuickInputTitleButtonHandle extends QuickTitleButton { index: number; } export interface ITransferQuickInput { quickInputIndex: number; title: string | undefined; step: number | undefined; totalSteps: number | undefined; enabled: boolean; busy: boolean; ignoreFocusOut: boolean; } export interface ITransferInputBox extends ITransferQuickInput { value: string; placeholder: string | undefined; password: boolean; buttons: ReadonlyArray; prompt: string | undefined; validationMessage: string | undefined; validateInput(value: string): MaybePromise; } export interface ITransferQuickPick extends ITransferQuickInput { value: string; placeholder: string | undefined; buttons: ReadonlyArray; items: PickOpenItem[]; canSelectMany: boolean; matchOnDescription: boolean; matchOnDetail: boolean; activeItems: ReadonlyArray; selectedItems: ReadonlyArray; } export interface QuickPickValue { label: string; value: T; description?: string; detail?: string; iconClass?: string; } export interface PickOpenItem { handle: number; id?: string; label: string; description?: string; detail?: string; picked?: boolean; } export interface IMainThreadStatusBar { $setStatusBarMessage(text: string): void; $dispose(entryId?: string): void; $createStatusBarItem(entryId: string, id: string, alignment: number, priority: number): void; $setMessage(entryId: string, id: string, name: string, text: string | undefined, priority: number, alignment: number, color: IThemeColor | string | undefined, backgroundColor: IThemeColor | string | undefined, tooltip: string | IMarkdownString | undefined, accessibilityInformation: vscode.AccessibilityInformation | undefined, command: string | undefined, commandArgs: any[] | undefined): Promise; } export interface IExtHostStatusBar { setStatusBarMessage(text: string, arg?: number | Thenable): vscode.Disposable; createStatusBarItem(extension: IExtensionDescription, id?: string, alignment?: types.StatusBarAlignment, priority?: number): vscode.StatusBarItem; } export interface IMainThreadOutput { $append(channelName: string, value: string): PromiseLike; $appendLine(channelName: string, value: string): PromiseLike; $replace(channelName: string, value: string): PromiseLike; $clear(channelName: string): PromiseLike; $dispose(channelName: string): PromiseLike; $reveal(channelName: string, preserveFocus: boolean): PromiseLike; $close(channelName: string): PromiseLike; $setLanguageId(channelName: string, languageId: string): PromiseLike; } export interface ICreateOutputChannelOptions { log?: boolean; languageId?: string; } export interface IExtHostOutput { createOutputChannel(name: string, optionsOrLanguageId: string | ICreateOutputChannelOptions | undefined): types.OutputChannel | types.LogOutputChannel; } export interface IExtHostWindowState { $onDidChangeWindowFocus(focused: boolean): any; $onDidChangeWindowActive(active: boolean): any; readonly state: types.WindowState; onDidChangeWindowState: Event; } export interface IExtHostWindow { $onOpenDialogResult(id: string, result: UriComponents[] | undefined): void; $onSaveDialogResult(id: string, result: UriComponents | undefined): void; } export interface IMainThreadWindow { $showOpenDialog(id: string, options: IExtOpenDialogOptions): void; $showSaveDialog(id: string, options: IExtSaveDialogOptions): void; } export interface IExtDialogOptions { defaultUri?: UriComponents; filters?: { [name: string]: string[]; }; } export interface IExtSaveDialogOptions extends IExtDialogOptions { saveLabel?: string; } export interface IExtOpenDialogOptions extends IExtDialogOptions { canSelectFiles?: boolean; canSelectFolders?: boolean; canSelectMany?: boolean; openLabel?: string; title?: string; } export {}; //# sourceMappingURL=window.d.ts.map