import { EditorState, Plugin, PluginView } from "prosemirror-state"; import { EditorView } from "prosemirror-view"; import { EditorType } from "../view"; import { MenuBlock } from "./helpers"; /** * PluginView that creates, tracks and changes the state of all menu items * @internal */ export declare class MenuView implements PluginView { dom: HTMLDivElement; private blocks; private view; private readonly; private editorType; static activeClass: string; static invisibleClass: string; constructor(blocks: MenuBlock[], view: EditorView, editorType: EditorType); update(view: EditorView, prevState: EditorState): void; destroy(): void; /** * Checks if the given menu command is visible/active for the current state and updates its dom to match * @param entry The menu command entry to check * @param isReadonly Whether the editor is readonly * @param isFocused Whether the editor currently has focus */ private checkAndUpdateMenuCommandState; /** Creates the element that a block's child entries' doms are placed into */ private makeBlockContainer; /** * Simplifies all menu items, standardizing their properties for consistent use * @param entries the menu items to simplify */ private standardizeMenuItems; /** Helper method to get the right command from an item for the current editor type */ private command; /** Builds a dropdown menu button with its dropdown */ private buildMenuDropdown; /** Helper method to convert a MenuItem's command to a standard type */ private expandCommand; } /** * Creates a menu plugin with the passed in entries * @param blocks The entries to use on the generated menu * @param containerFn A function that returns the container element for the menu * @internal */ export declare function createMenuPlugin(blocks: MenuBlock[], containerFn: (view: EditorView) => Node, editorType: EditorType): Plugin;