@mocanvas/editor · interface

TLMenus

interface TLMenus

The open-menu registry.


Methods · 6

addOpenMenu(id: string, contextId?: string): void

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

clearOpenMenus(contextId?: string): void

Close every menu in a context.

deleteOpenMenu(id: string, contextId?: string): void

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

getIsMenuOpen(contextId?: string): boolean

Whether any menu is open in a context.

getOpenMenus(contextId?: string): string[]

Open menu ids for a context, in the order they were opened.

isMenuOpen(id: string, contextId?: string): boolean

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.