UNPKG

2.4 kBTypeScriptView Raw
1import { KeybindingRegistry } from '../keybinding';
2import { Disposable, Command, CommandRegistry, CancellationToken } from '../../common';
3import { ContextKeyService } from '../context-key-service';
4import { CorePreferences } from '../core-preferences';
5import { QuickAccessContribution, QuickAccessProvider, QuickAccessRegistry } from './quick-access';
6import { QuickPickItem, QuickPicks } from './quick-input-service';
7export declare const quickCommand: Command;
8export declare const CLEAR_COMMAND_HISTORY: Command;
9export declare const CLOSE_QUICK_OPEN: Command;
10export declare class QuickCommandService implements QuickAccessContribution, QuickAccessProvider {
11 static PREFIX: string;
12 protected readonly contextKeyService: ContextKeyService;
13 protected readonly commandRegistry: CommandRegistry;
14 protected readonly corePreferences: CorePreferences;
15 protected readonly quickAccessRegistry: QuickAccessRegistry;
16 protected readonly keybindingRegistry: KeybindingRegistry;
17 readonly exemptedCommands: Command[];
18 private recentItems;
19 private otherItems;
20 registerQuickAccessProvider(): void;
21 reset(): void;
22 getPicks(filter: string, token: CancellationToken): QuickPicks;
23 toItem(command: Command): QuickPickItem;
24 private getKeybinding;
25 private getItemIconClasses;
26 protected readonly contexts: Map<string, string[]>;
27 pushCommandContext(commandId: string, when: string): Disposable;
28 /**
29 * Get the list of valid commands.
30 *
31 * @param commands the list of raw commands.
32 * @returns the list of valid commands.
33 */
34 protected getValidCommands(raw: Command[]): Command[];
35 /**
36 * Get the list of recently used and other commands.
37 *
38 * @returns the list of recently used commands and other commands.
39 */
40 getCommands(): {
41 recent: Command[];
42 other: Command[];
43 };
44 /**
45 * Normalizes a list of commands.
46 * Normalization includes obtaining commands that have labels, are visible, and are enabled.
47 *
48 * @param commands the list of commands.
49 * @returns the list of normalized commands.
50 */
51 private normalize;
52 /**
53 * Sorts a list of commands alphabetically.
54 *
55 * @param commands the list of commands.
56 * @returns the list of sorted commands.
57 */
58 private sort;
59}
60//# sourceMappingURL=quick-command-service.d.ts.map
\No newline at end of file