1 | import URI from './uri';
|
2 | import { Event } from './event';
|
3 | import { KeySequence } from './keys';
|
4 | import { CancellationToken } from './cancellation';
|
5 | import { URI as Uri } from 'vscode-uri';
|
6 | export declare const quickPickServicePath = "/services/quickPick";
|
7 | export declare const QuickPickService: unique symbol;
|
8 | export interface QuickPickService {
|
9 | show<T extends QuickPickItem>(items: Array<T | QuickPickSeparator>, options?: QuickPickOptions<T>): Promise<T | undefined>;
|
10 | setItems<T extends QuickPickItem>(items: Array<T>): void;
|
11 | hide(): void;
|
12 | readonly onDidHide: Event<void>;
|
13 | readonly onDidAccept: Event<void>;
|
14 | readonly onDidChangeValue: Event<{
|
15 | quickPick: QuickPick<QuickPickItem>;
|
16 | filter: string;
|
17 | }>;
|
18 | readonly onDidChangeActive: Event<{
|
19 | quickPick: QuickPick<QuickPickItem>;
|
20 | activeItems: Array<QuickPickItem>;
|
21 | }>;
|
22 | readonly onDidChangeSelection: Event<{
|
23 | quickPick: QuickPick<QuickPickItem>;
|
24 | selectedItems: Array<QuickPickItem>;
|
25 | }>;
|
26 | readonly onDidTriggerButton: Event<QuickInputButtonHandle>;
|
27 | }
|
28 | export interface Match {
|
29 | start: number;
|
30 | end: number;
|
31 | }
|
32 | export interface QuickPickItemHighlights {
|
33 | label?: Match[];
|
34 | description?: Match[];
|
35 | detail?: Match[];
|
36 | }
|
37 | export interface QuickPickItem {
|
38 | type?: 'item';
|
39 | id?: string;
|
40 | label: string;
|
41 | meta?: string;
|
42 | ariaLabel?: string;
|
43 | description?: string;
|
44 | detail?: string;
|
45 | keySequence?: KeySequence;
|
46 | iconClasses?: string[];
|
47 | alwaysShow?: boolean;
|
48 | highlights?: QuickPickItemHighlights;
|
49 | buttons?: readonly QuickInputButton[];
|
50 | execute?: () => void;
|
51 | }
|
52 | export interface QuickPickSeparator {
|
53 | type: 'separator';
|
54 | label?: string;
|
55 | }
|
56 | export declare type QuickPickItemOrSeparator = QuickPickItem | QuickPickSeparator;
|
57 | export declare namespace QuickPickItem {
|
58 | function is(item: QuickPickSeparator | QuickPickItem): item is QuickPickItem;
|
59 | }
|
60 | export interface QuickPickSeparator {
|
61 | type: 'separator';
|
62 | label?: string;
|
63 | }
|
64 | export declare namespace QuickPickSeparator {
|
65 | function is(item: QuickPickItemOrSeparator): item is QuickPickSeparator;
|
66 | }
|
67 | export declare type QuickPicks = (QuickPickSeparator | QuickPickItem)[];
|
68 | export interface QuickPickValue<V> extends QuickPickItem {
|
69 | value: V;
|
70 | }
|
71 | export interface QuickInputButton {
|
72 | iconPath?: URI | Uri | {
|
73 | light?: URI | Uri;
|
74 | dark: URI | Uri;
|
75 | } | {
|
76 | id: string;
|
77 | };
|
78 | iconClass?: string;
|
79 | tooltip?: string;
|
80 | |
81 |
|
82 |
|
83 | alwaysVisible?: boolean;
|
84 | }
|
85 | export interface NormalizedQuickInputButton extends QuickInputButton {
|
86 | iconPath?: {
|
87 | light?: Uri;
|
88 | dark: Uri;
|
89 | };
|
90 | }
|
91 | export declare namespace QuickInputButton {
|
92 | function normalize(button: undefined): undefined;
|
93 | function normalize(button: QuickInputButton): NormalizedQuickInputButton;
|
94 | }
|
95 | export interface QuickInputButtonHandle extends QuickInputButton {
|
96 | index: number;
|
97 | }
|
98 | export declare enum QuickInputHideReason {
|
99 | |
100 |
|
101 |
|
102 | Blur = 1,
|
103 | |
104 |
|
105 |
|
106 | Gesture = 2,
|
107 | |
108 |
|
109 |
|
110 | Other = 3
|
111 | }
|
112 | export interface QuickInput {
|
113 | readonly onDidHide: Event<{
|
114 | reason: QuickInputHideReason;
|
115 | }>;
|
116 | readonly onDispose: Event<void>;
|
117 | title: string | undefined;
|
118 | description: string | undefined;
|
119 | step: number | undefined;
|
120 | totalSteps: number | undefined;
|
121 | enabled: boolean;
|
122 | contextKey: string | undefined;
|
123 | busy: boolean;
|
124 | ignoreFocusOut: boolean;
|
125 | show(): void;
|
126 | hide(): void;
|
127 | dispose(): void;
|
128 | }
|
129 | export interface InputBox extends QuickInput {
|
130 | value: string | undefined;
|
131 | valueSelection: Readonly<[number, number]> | undefined;
|
132 | placeholder: string | undefined;
|
133 | password: boolean;
|
134 | readonly onDidChangeValue: Event<string>;
|
135 | readonly onDidAccept: Event<void>;
|
136 | buttons: ReadonlyArray<QuickInputButton>;
|
137 | readonly onDidTriggerButton: Event<QuickInputButton>;
|
138 | prompt: string | undefined;
|
139 | validationMessage: string | undefined;
|
140 | }
|
141 | export interface QuickPick<T extends QuickPickItemOrSeparator> extends QuickInput {
|
142 | value: string;
|
143 | placeholder: string | undefined;
|
144 | items: ReadonlyArray<T | QuickPickSeparator>;
|
145 | activeItems: ReadonlyArray<T>;
|
146 | selectedItems: ReadonlyArray<T>;
|
147 | canSelectMany: boolean;
|
148 | matchOnDescription: boolean;
|
149 | matchOnDetail: boolean;
|
150 | keepScrollPosition: boolean;
|
151 | readonly onDidAccept: Event<{
|
152 | inBackground: boolean;
|
153 | } | undefined>;
|
154 | readonly onDidChangeValue: Event<string>;
|
155 | readonly onDidTriggerButton: Event<QuickInputButton>;
|
156 | readonly onDidTriggerItemButton: Event<QuickPickItemButtonEvent<T>>;
|
157 | readonly onDidChangeActive: Event<T[]>;
|
158 | readonly onDidChangeSelection: Event<T[]>;
|
159 | }
|
160 | export interface PickOptions<T extends QuickPickItem> {
|
161 | title?: string;
|
162 | placeHolder?: string;
|
163 | matchOnDescription?: boolean;
|
164 | matchOnDetail?: boolean;
|
165 | matchOnLabel?: boolean;
|
166 | autoFocusOnList?: boolean;
|
167 | ignoreFocusLost?: boolean;
|
168 | canPickMany?: boolean;
|
169 | contextKey?: string;
|
170 | activeItem?: Promise<T> | T;
|
171 | onDidFocus?: (entry: T) => void;
|
172 | }
|
173 | export interface InputOptions {
|
174 | title?: string;
|
175 | value?: string;
|
176 | valueSelection?: [number, number];
|
177 | prompt?: string;
|
178 | placeHolder?: string;
|
179 | password?: boolean;
|
180 | ignoreFocusLost?: boolean;
|
181 | validateInput?(input: string): Promise<string | {
|
182 | content: string;
|
183 | severity: number;
|
184 | } | null | undefined> | undefined;
|
185 | }
|
186 | export interface QuickPickItemButtonEvent<T extends QuickPickItemOrSeparator> {
|
187 | button: QuickInputButton;
|
188 | item: T;
|
189 | }
|
190 | export interface QuickPickItemButtonContext<T extends QuickPickItemOrSeparator> extends QuickPickItemButtonEvent<T> {
|
191 | removeItem(): void;
|
192 | }
|
193 | export interface QuickPickOptions<T extends QuickPickItemOrSeparator> {
|
194 | busy?: boolean;
|
195 | enabled?: boolean;
|
196 | title?: string;
|
197 | description?: string;
|
198 | value?: string;
|
199 | filterValue?: (value: string) => string;
|
200 | ariaLabel?: string;
|
201 | buttons?: Array<QuickInputButton>;
|
202 | placeholder?: string;
|
203 | canAcceptInBackground?: boolean;
|
204 | customButton?: boolean;
|
205 | customLabel?: string;
|
206 | customHover?: string;
|
207 | canSelectMany?: boolean;
|
208 | matchOnDescription?: boolean;
|
209 | matchOnDetail?: boolean;
|
210 | matchOnLabel?: boolean;
|
211 | sortByLabel?: boolean;
|
212 | keepScrollPosition?: boolean;
|
213 | autoFocusOnList?: boolean;
|
214 | ignoreFocusOut?: boolean;
|
215 | valueSelection?: Readonly<[number, number]>;
|
216 | validationMessage?: string;
|
217 | hideInput?: boolean;
|
218 | hideCheckAll?: boolean;
|
219 | runIfSingle?: boolean;
|
220 | contextKey?: string;
|
221 | activeItem?: T;
|
222 | step?: number;
|
223 | totalSteps?: number;
|
224 | onDidAccept?: () => void;
|
225 | onDidChangeActive?: (quickPick: QuickPick<T>, activeItems: Array<T>) => void;
|
226 | onDidChangeSelection?: (quickPick: QuickPick<T>, selectedItems: Array<T>) => void;
|
227 | onDidChangeValue?: (quickPick: QuickPick<T>, filter: string) => void;
|
228 | onDidCustom?: () => void;
|
229 | onDidHide?: () => void;
|
230 | onDidTriggerButton?: (button: QuickInputButton) => void;
|
231 | onDidTriggerItemButton?: (ItemButtonEvent: QuickPickItemButtonContext<T>) => void;
|
232 | }
|
233 | export declare const QuickInputService: unique symbol;
|
234 | export interface QuickInputService {
|
235 | readonly backButton: QuickInputButton;
|
236 | readonly onShow: Event<void>;
|
237 | readonly onHide: Event<void>;
|
238 | open(filter: string): void;
|
239 | createInputBox(): InputBox;
|
240 | input(options?: InputOptions, token?: CancellationToken): Promise<string | undefined>;
|
241 | pick<T extends QuickPickItem, O extends PickOptions<T>>(picks: Promise<T[]> | T[], options?: O, token?: CancellationToken): Promise<(O extends {
|
242 | canPickMany: true;
|
243 | } ? T[] : T) | undefined>;
|
244 | showQuickPick<T extends QuickPickItem>(items: Array<T | QuickPickSeparator>, options?: QuickPickOptions<T>): Promise<T | undefined>;
|
245 | hide(): void;
|
246 | |
247 |
|
248 |
|
249 | createQuickPick<T extends QuickPickItem>(): QuickPick<T>;
|
250 | }
|
251 |
|
252 |
|
253 |
|
254 |
|
255 |
|
256 |
|
257 |
|
258 |
|
259 |
|
260 |
|
261 |
|
262 | export declare function filterItems(items: QuickPickItemOrSeparator[], filter: string): QuickPickItemOrSeparator[];
|
263 |
|
264 |
|
265 |
|
266 |
|
267 |
|
268 |
|
269 | export declare function findMatches(word: string, pattern: string): Array<{
|
270 | start: number;
|
271 | end: number;
|
272 | }> | undefined;
|
273 |
|
\ | No newline at end of file |