/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { Event } from 'vs/base/common/event'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { CancellationToken } from 'vs/base/common/cancellation'; import { IQuickPickItem, IPickOptions, IInputOptions, IQuickNavigateConfiguration, IQuickPick, IQuickInputButton, IInputBox, QuickPickInput, IKeyMods } from 'vs/base/parts/quickinput/common/quickInput'; import { IQuickAccessController } from 'vs/platform/quickinput/common/quickAccess'; export * from 'vs/base/parts/quickinput/common/quickInput'; export const IQuickInputService = createDecorator('quickInputService'); export type Omit = Pick>; export interface IQuickInputService { _serviceBrand: undefined; /** * Provides access to the back button in quick input. */ readonly backButton: IQuickInputButton; /** * Provides access to the quick access providers. */ readonly quickAccess: IQuickAccessController; /** * Allows to register on the event that quick input is showing. */ readonly onShow: Event; /** * Allows to register on the event that quick input is hiding. */ readonly onHide: Event; /** * Opens the quick input box for selecting items and returns a promise * with the user selected item(s) if any. */ pick(picks: Promise[]> | QuickPickInput[], options?: IPickOptions & { canPickMany: true }, token?: CancellationToken): Promise; pick(picks: Promise[]> | QuickPickInput[], options?: IPickOptions & { canPickMany: false }, token?: CancellationToken): Promise; pick(picks: Promise[]> | QuickPickInput[], options?: Omit, 'canPickMany'>, token?: CancellationToken): Promise; /** * Opens the quick input box for text input and returns a promise with the user typed value if any. */ input(options?: IInputOptions, token?: CancellationToken): Promise; /** * Provides raw access to the quick pick controller. */ createQuickPick(): IQuickPick; /** * Provides raw access to the quick input controller. */ createInputBox(): IInputBox; /** * Moves focus into quick input. */ focus(): void; /** * Toggle the checked state of the selected item. */ toggle(): void; /** * Navigate inside the opened quick input list. */ navigate(next: boolean, quickNavigate?: IQuickNavigateConfiguration): void; /** * Navigate back in a multi-step quick input. */ back(): Promise; /** * Accept the selected item. * * @param keyMods allows to override the state of key * modifiers that should be present when invoking. */ accept(keyMods?: IKeyMods): Promise; /** * Cancels quick input and closes it. */ cancel(): Promise; // TODO@Ben remove once quick open is gone hide(focusLost?: boolean): void; }