UNPKG

1.44 kBTypeScriptView Raw
1import { CommandHandler } from '../../common';
2import { TabBar, Title, Widget } from '../widgets';
3import { ApplicationShell } from './application-shell';
4declare type CurrentWidgetCommandAdapterBooleanCheck = (event: Event) => boolean;
5declare type CurrentWidgetCommandHandlerBooleanCheck = (title: Title<Widget> | undefined, tabbar: TabBar<Widget> | undefined, event: Event) => boolean;
6export interface TabBarContextMenuCommandHandler extends CommandHandler {
7 execute(title: Title<Widget> | undefined, tabbar: TabBar<Widget> | undefined, event: Event): unknown;
8 isEnabled?: CurrentWidgetCommandHandlerBooleanCheck;
9 isVisible?: CurrentWidgetCommandHandlerBooleanCheck;
10 isToggled?: CurrentWidgetCommandHandlerBooleanCheck;
11}
12/**
13 * Creates a command handler that acts on either the widget targeted by a DOM event or the current widget.
14 */
15export declare class CurrentWidgetCommandAdapter implements CommandHandler {
16 execute: (event: Event) => unknown;
17 isEnabled?: CurrentWidgetCommandAdapterBooleanCheck;
18 isVisible?: CurrentWidgetCommandAdapterBooleanCheck;
19 isToggled?: CurrentWidgetCommandAdapterBooleanCheck;
20 constructor(shell: ApplicationShell, handler: TabBarContextMenuCommandHandler);
21 protected transformArguments(shell: ApplicationShell, event: Event): [Title<Widget> | undefined, TabBar<Widget> | undefined, Event];
22}
23export {};
24//# sourceMappingURL=current-widget-command-adapter.d.ts.map
\No newline at end of file