1 | import { CommandRegistry } from '../command';
|
2 | import { Disposable } from '../disposable';
|
3 | import { MenuPath } from './menu-types';
|
4 | export declare type MenuCommandArguments = [menuPath: MenuPath, command: string, ...commandArgs: unknown[]];
|
5 | export declare const MenuCommandExecutor: unique symbol;
|
6 | export interface MenuCommandExecutor {
|
7 | isVisible(...args: MenuCommandArguments): boolean;
|
8 | isEnabled(...args: MenuCommandArguments): boolean;
|
9 | isToggled(...args: MenuCommandArguments): boolean;
|
10 | executeCommand(...args: MenuCommandArguments): Promise<unknown>;
|
11 | }
|
12 | export declare const MenuCommandAdapter: unique symbol;
|
13 | export interface MenuCommandAdapter extends MenuCommandExecutor {
|
14 |
|
15 | canHandle(...args: MenuCommandArguments): number;
|
16 | }
|
17 | export declare const MenuCommandAdapterRegistry: unique symbol;
|
18 | export interface MenuCommandAdapterRegistry {
|
19 | registerAdapter(adapter: MenuCommandAdapter): Disposable;
|
20 | getAdapterFor(...args: MenuCommandArguments): MenuCommandAdapter | undefined;
|
21 | }
|
22 | export declare class MenuCommandExecutorImpl implements MenuCommandExecutor {
|
23 | protected readonly adapterRegistry: MenuCommandAdapterRegistry;
|
24 | protected readonly commandRegistry: CommandRegistry;
|
25 | executeCommand(menuPath: MenuPath, command: string, ...commandArgs: unknown[]): Promise<unknown>;
|
26 | isVisible(menuPath: MenuPath, command: string, ...commandArgs: unknown[]): boolean;
|
27 | isEnabled(menuPath: MenuPath, command: string, ...commandArgs: unknown[]): boolean;
|
28 | isToggled(menuPath: MenuPath, command: string, ...commandArgs: unknown[]): boolean;
|
29 | protected delegate<T extends keyof MenuCommandExecutor>(menuPath: MenuPath, command: string, commandArgs: unknown[], method: T): ReturnType<MenuCommandExecutor[T]>;
|
30 | }
|
31 | export declare class MenuCommandAdapterRegistryImpl implements MenuCommandAdapterRegistry {
|
32 | protected readonly adapters: MenuCommandAdapter[];
|
33 | registerAdapter(adapter: MenuCommandAdapter): Disposable;
|
34 | getAdapterFor(menuPath: MenuPath, command: string, ...commandArgs: unknown[]): MenuCommandAdapter | undefined;
|
35 | }
|
36 |
|
\ | No newline at end of file |