UNPKG

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