@tavora/sdk / MenuEntry
Type Alias: MenuEntry
MenuEntry = {
checked?:boolean;color?:string;danger?:boolean;disabled?:boolean;hint?:string;id:string;label:string;radio?:boolean;type:"item"; } | {type:"separator"; } | {label:string;type:"heading"; } | {color?:string;disabled?:boolean;items:MenuEntry[];label:string;type:"submenu"; }
Defined in: packages/sdk/src/protocol.ts:1153
One entry of a menu drawn by Tavora (ui.showMenu). Text only; Tavora draws it in the current theme. An item list where any item sets checked keeps a column for the mark, so labels line up.
Union Members
Type Literal
{ checked?: boolean; color?: string; danger?: boolean; disabled?: boolean; hint?: string; id: string; label: string; radio?: boolean; type: "item"; }
checked?
optionalchecked?:boolean
Shows a check mark (or a dot, with radio) when true, and keeps the mark's column when false.
color?
optionalcolor?:string
A colour dot before the label, as a CSS colour: #rgb, #rrggbb, rgb(), hsl(), oklch() and the like, or transparent for an empty ring.
danger?
optionaldanger?:boolean
Red, for something that deletes or cannot be undone.
disabled?
optionaldisabled?:boolean
hint?
optionalhint?:string
Small grey text on the right, such as a shortcut ("Ctrl+D").
id
id:
string
Returned when the user picks it; unique within the menu, at most 64 characters.
label
label:
string
radio?
optionalradio?:boolean
The mark is a dot: one choice of several.
type
type:
"item"
Type Literal
{ type: "separator"; }
Type Literal
{ label: string; type: "heading"; }
Type Literal
{ color?: string; disabled?: boolean; items: MenuEntry[]; label: string; type: "submenu"; }
color?
optionalcolor?:string
disabled?
optionaldisabled?:boolean
items
items:
MenuEntry[]
Items, separators and headings; a submenu holds no further submenus.
label
label:
string
type
type:
"submenu"