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