@theia/core
Version:
Theia is a cloud & desktop IDE framework implemented in TypeScript.
55 lines • 2.37 kB
TypeScript
import * as React from 'react';
import { ReactWidget } from '../widgets';
import { ContextMenuRenderer } from '../context-menu-renderer';
import { MenuModelRegistry, MenuPath } from '../../common/menu';
import { HoverService } from '../hover-service';
import { Event, Disposable, Emitter, DisposableCollection } from '../../common';
import { ContextKeyService } from '../context-key-service';
export declare const SidebarTopMenuWidgetFactory: unique symbol;
export declare const SidebarBottomMenuWidgetFactory: unique symbol;
export interface SidebarMenu {
id: string;
iconClass: string;
title: string;
menuPath: MenuPath;
onDidBadgeChange?: Event<number>;
order: number;
}
export declare class SidebarMenuItem implements Disposable {
readonly menu: SidebarMenu;
get badge(): string;
protected readonly onDidBadgeChangeEmitter: Emitter<number>;
readonly onDidBadgeChange: Event<number>;
protected _badge: number;
protected readonly toDispose: DisposableCollection;
constructor(menu: SidebarMenu);
dispose(): void;
}
/**
* The menu widget placed on the sidebar.
*/
export declare class SidebarMenuWidget extends ReactWidget {
protected readonly items: SidebarMenuItem[];
/**
* The element that had focus when a menu rendered by this widget was activated.
*/
protected preservedContext: HTMLElement | undefined;
/**
* Flag indicating whether a context menu is open. While a context menu is open, the `preservedContext` should not be cleared.
*/
protected preservingContext: boolean;
protected readonly contextMenuRenderer: ContextMenuRenderer;
protected readonly menuRegistry: MenuModelRegistry;
protected readonly hoverService: HoverService;
protected readonly contextKeyService: ContextKeyService;
constructor();
addMenu(menu: SidebarMenu): void;
removeMenu(menuId: string): void;
protected readonly onMouseDown: () => void;
protected readonly onMouseOut: () => void;
protected readonly onMouseEnter: (event: React.MouseEvent<HTMLElement, MouseEvent>, title: string) => void;
protected onClick(e: React.MouseEvent<HTMLElement, MouseEvent>, menuPath: MenuPath): void;
protected render(): React.ReactNode;
protected renderItem(item: SidebarMenuItem): React.ReactNode;
}
//# sourceMappingURL=sidebar-menu-widget.d.ts.map