UNPKG

1.61 kBTypeScriptView Raw
1import * as React from 'react';
2import { ReactWidget } from '../widgets';
3import { ContextMenuRenderer } from '../context-menu-renderer';
4import { MenuPath } from '../../common/menu';
5import { HoverService } from '../hover-service';
6export declare const SidebarTopMenuWidgetFactory: unique symbol;
7export declare const SidebarBottomMenuWidgetFactory: unique symbol;
8export interface SidebarMenu {
9 id: string;
10 iconClass: string;
11 title: string;
12 menuPath: MenuPath;
13 order: number;
14}
15/**
16 * The menu widget placed on the sidebar.
17 */
18export declare class SidebarMenuWidget extends ReactWidget {
19 protected readonly menus: SidebarMenu[];
20 /**
21 * The element that had focus when a menu rendered by this widget was activated.
22 */
23 protected preservedContext: HTMLElement | undefined;
24 /**
25 * Flag indicating whether a context menu is open. While a context menu is open, the `preservedContext` should not be cleared.
26 */
27 protected preservingContext: boolean;
28 protected readonly contextMenuRenderer: ContextMenuRenderer;
29 protected readonly hoverService: HoverService;
30 constructor();
31 addMenu(menu: SidebarMenu): void;
32 removeMenu(menuId: string): void;
33 protected readonly onMouseDown: () => void;
34 protected readonly onMouseOut: () => void;
35 protected readonly onMouseEnter: (event: React.MouseEvent<HTMLElement, MouseEvent>, title: string) => void;
36 protected onClick(e: React.MouseEvent<HTMLElement, MouseEvent>, menuPath: MenuPath): void;
37 protected render(): React.ReactNode;
38}
39//# sourceMappingURL=sidebar-menu-widget.d.ts.map
\No newline at end of file