/// <reference types="react" />
import type { Event, Disposable } from '@difizen/mana-common';
import { DisposableCollection, Emitter } from '@difizen/mana-common';
import type { GeneralMenuItem, ActionMenuItem, MenuPath } from '@difizen/mana-core';
import { MenuItem } from '@difizen/mana-core';
import { CommandRegistry, MenuRegistry } from '@difizen/mana-core';
import type { MenuData, MenuItemState } from './menu-protocol';
export declare const MenuPathSymbol: unique symbol;
/**
 * Factory for instantiating toolbars.
 */
export declare const MenuFactory: unique symbol;
export interface MenuFactory {
    (menuPath: MenuPath): Menu;
}
/**
 * The toolbar manager, a toolbar instance should be created with view.
 */
export declare class Menu implements Disposable {
    protected toDispose: DisposableCollection;
    protected _disposed: boolean;
    get disposed(): boolean;
    protected disposedEventEmitter: Emitter<void>;
    onDisposed: Event<void>;
    current: any;
    states: Map<string, MenuItemState>;
    root: GeneralMenuItem;
    protected readonly commands: CommandRegistry;
    protected readonly menus: MenuRegistry;
    protected readonly menuPath: MenuPath;
    constructor(commands: CommandRegistry, menus: MenuRegistry, menuPath: MenuPath);
    setCurrent(current: any): void;
    sort: (left: MenuItem, right: MenuItem) => number;
    protected commandIsEnabled(command: string): boolean;
    execute(item: ActionMenuItem, data?: MenuData): Promise<unknown> | undefined;
    setState: (item: MenuItemState) => void;
    getState: (item: MenuItemState | MenuItem) => MenuItemState | undefined;
    removeItemState(key: string): void;
    protected isGroup(item: MenuItem): boolean;
    protected doRenderList(list: readonly MenuItem[]): React.ReactNode;
    renderMenuList: (list: readonly MenuItem[], inMenu?: boolean) => React.ReactNode;
    renderMenuItem(item: MenuItem, root?: boolean): string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
    dispose(): void;
    isVisible(item: MenuItem): boolean;
    isEnable(item: MenuItem): boolean;
}
//# sourceMappingURL=menu.d.ts.map