import type { MenuItem as MenuItemOriginal, Menu as MenuOriginal, MenuPositionDef as MenuPositionDefOriginal } from 'obsidian'; import { Component } from './Component.mjs'; import { MenuItem } from './MenuItem.mjs'; import { MenuSeparator } from './MenuSeparator.mjs'; /** * A section's submenu, as recorded by the bridged `Menu.setSectionSubmenu`. */ export interface SectionSubmenu__ { readonly icon: string; readonly title: string; } export declare class Menu extends Component { dom__: HTMLElement; items__: (MenuItem | MenuSeparator)[]; sectionSubmenus__: Map; /** * The added items, separators excluded. * * `items__` mirrors the real `Menu.items` and so holds both kinds. Nearly every reader wants only the * items — it is reading `title__` or `submenu__`, which a separator does not have — so this saves * narrowing at each read. Use `items__` when the separators themselves matter (asserting on their * positions, or on a count that has to match what Obsidian reports). */ get menuItems__(): MenuItem[]; private onHideCallback; protected constructor(); static create2__(): Menu; static forEvent(_event: MouseEvent | PointerEvent): Menu; static fromOriginalType2__(value: MenuOriginal): Menu; addItem(callback: (item: MenuItemOriginal) => unknown): this; addSeparator(): this; asOriginalType2__(): MenuOriginal; close(): void; constructor2__(): void; hide(): this; onHide(callback: () => unknown): void; setNoIcon(): this; setParentElement(_el: HTMLElement): this; setUseNativeMenu(_useNativeMenu: boolean): this; showAtMouseEvent(_event: MouseEvent): this; showAtPosition(_position: MenuPositionDefOriginal, _doc?: Document): this; }