UNPKG

1.93 kBTypeScriptView Raw
1import { CancellationToken, Disposable } from '../../common';
2import { QuickPicks } from './quick-input-service';
3export declare const QuickAccessContribution: unique symbol;
4/**
5 * Bind this contribution in order to register quick access providers with the
6 * QuickAccessRegistry at startup
7 */
8export interface QuickAccessContribution {
9 registerQuickAccessProvider(): void;
10}
11export interface QuickAccessProvider {
12 getPicks(filter: string, token: CancellationToken): QuickPicks | Promise<QuickPicks>;
13 reset?(): void;
14}
15export interface QuickAccessProviderHelp {
16 prefix?: string;
17 description: string;
18 needsEditor: boolean;
19}
20export interface QuickAccessProviderDescriptor {
21 /**
22 * return an instance of QuickAccessProvider. Implementers are free to return that same instance multiple times
23 */
24 readonly getInstance: () => QuickAccessProvider;
25 /**
26 * The prefix for quick access picker to use the provider for.
27 */
28 readonly prefix: string;
29 /**
30 * A placeholder to use for the input field when the provider is active.
31 * This will also be read out by screen readers and thus helps for
32 * accessibility.
33 */
34 readonly placeholder?: string;
35 /**
36 * Help entries for this quick access provider
37 */
38 readonly helpEntries: QuickAccessProviderHelp[];
39 /**
40 * A context key that will be set automatically when this quick access is being shown
41 */
42 readonly contextKey?: string;
43}
44export declare const QuickAccessRegistry: unique symbol;
45/**
46 * A registry for quick access providers.
47 */
48export interface QuickAccessRegistry {
49 registerQuickAccessProvider(provider: QuickAccessProviderDescriptor): Disposable;
50 getQuickAccessProviders(): QuickAccessProviderDescriptor[];
51 getQuickAccessProvider(prefix: string): QuickAccessProviderDescriptor | undefined;
52 clear(): void;
53}
54//# sourceMappingURL=quick-access.d.ts.map
\No newline at end of file