import { DiffDOM } from "diff-dom"; import type { EditorView } from "prosemirror-view"; import type { Editor } from "../../types.js"; interface ToolbarBaseItem { available?: (editor: Editor) => boolean; disabled?: (editor: Editor) => boolean; order?: number; } interface ToolbarButtonItem extends ToolbarBaseItem { type: "button"; title: string; icon: string | ((editor: Editor) => string); class?: (editor: Editor) => string; selected?: (editor: Editor) => boolean; action: (editor: Editor) => boolean | void; } interface ToolbarInfoItem extends ToolbarBaseItem { type: "info"; show: (editor: Editor) => string; } interface ToolbarMenuOption extends ToolbarBaseItem { title: string; action: (editor: Editor) => boolean | void; } interface ToolbarMenuItem extends ToolbarBaseItem { type: "menu"; title: string; show: (editor: Editor) => string; open: boolean; content: ToolbarMenuOption[]; } type ToolbarItem = ToolbarButtonItem | ToolbarInfoItem | ToolbarMenuItem; interface ToolbarModel { openMore: boolean; content: ToolbarItem[]; } export declare class ToolbarView { editorView: EditorView; options: { editor: Editor; }; editor: Editor; dd: DiffDOM; sideMargins: number; availableWidth: number; openedMenu: number | false; listeners: { onclick?: (event: MouseEvent) => void; onmousedown?: (event: MouseEvent) => void; }; constructor(editorView: EditorView, options: { editor: Editor; }); removeUnavailable(menu: ToolbarModel): void; bindEvents(): void; destroy(): void; onmousedown(event: MouseEvent): void; onResize(): void; /** * The width the toolbar can occupy: the editor element's own width, not * the browser window's. The two differ whenever the editor is embedded * in a narrower host container (CMS admin pages, split views). */ availableEditorWidth(): number; onclick(event: MouseEvent): void; update(): void; getToolbarHTML(menuIndexToDrop: number | false): string; getToolbarMenuItemHTML(menuItem: ToolbarItem, _index: number): string; getMoreButtonHTML(menuIndexToDrop: number | false): string; getMoreButtonListHTML(menuIndexToDrop: number): string; getInfoHTML(menuItem: ToolbarInfoItem): string; getDropdownHTML(menuItem: ToolbarMenuItem): string; getDropdownListHTML(menuItem: ToolbarMenuItem): string; getDropdownOptionHTML(menuOption: ToolbarMenuOption): string; getButtonHTML(menuItem: ToolbarButtonItem): string; } export {}; //# sourceMappingURL=view.d.ts.map