UNPKG

2.08 kBTypeScriptView Raw
1import { interfaces } from 'inversify';
2import { Widget } from '@phosphor/widgets';
3import { MenuModelRegistry, Command, CommandContribution, MenuContribution, CommandRegistry } from '../../common';
4import { KeybindingContribution, KeybindingRegistry } from '../keybinding';
5import { WidgetManager } from '../widget-manager';
6import { ApplicationShell } from './application-shell';
7import { QuickViewService } from '../quick-input';
8export interface OpenViewArguments extends ApplicationShell.WidgetOptions {
9 toggle?: boolean;
10 activate?: boolean;
11 reveal?: boolean;
12}
13export interface ViewContributionOptions {
14 widgetId: string;
15 viewContainerId?: string;
16 widgetName: string;
17 defaultWidgetOptions: ApplicationShell.WidgetOptions;
18 toggleCommandId?: string;
19 toggleKeybinding?: string;
20}
21export declare function bindViewContribution<T extends AbstractViewContribution<Widget>>(bind: interfaces.Bind, identifier: interfaces.Newable<T>): interfaces.BindingWhenOnSyntax<T>;
22/**
23 * An abstract superclass for frontend contributions that add a view to the application shell.
24 */
25export declare abstract class AbstractViewContribution<T extends Widget> implements CommandContribution, MenuContribution, KeybindingContribution {
26 protected readonly options: ViewContributionOptions;
27 protected readonly widgetManager: WidgetManager;
28 protected readonly shell: ApplicationShell;
29 protected readonly quickView: QuickViewService;
30 readonly toggleCommand?: Command;
31 constructor(options: ViewContributionOptions);
32 get viewId(): string;
33 get viewLabel(): string;
34 get defaultViewOptions(): ApplicationShell.WidgetOptions;
35 get widget(): Promise<T>;
36 tryGetWidget(): T | undefined;
37 openView(args?: Partial<OpenViewArguments>): Promise<T>;
38 registerCommands(commands: CommandRegistry): void;
39 closeView(): Promise<T | undefined>;
40 toggleView(): Promise<T>;
41 registerMenus(menus: MenuModelRegistry): void;
42 registerKeybindings(keybindings: KeybindingRegistry): void;
43}
44//# sourceMappingURL=view-contribution.d.ts.map
\No newline at end of file