@mocanvas/editor · class

MenuManager

declare class MenuManager

The set of menus that are open, kept in the instance session record so it survives tool changes, is visible to anything reading the store, and is reactive: reading getOpenMenus() inside a signal re-runs it on every change.

Ids are opaque strings owned by the UI; nothing here interprets them.


Methods · 6

addOpenMenu(id: string): this

Mark a menu as open. Opening an already-open menu changes nothing.

clearOpenMenus(): this

Close every open menu.

constructor(editor: Editor)
getOpenMenus(): string[]

The open menu ids, in the order they were opened.

isMenuOpen(id: string): boolean
removeOpenMenu(id: string): this

Mark a menu as closed. Closing a menu that is not open changes nothing.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.