Reference machines
menu
interface 3 type 4 function 2
# MenuEvent
MenuEvent = { type: "OPEN"; } | { type: "CLOSE"; } | { type: "TOGGLE"; } | { type: "ESCAPE"; } | { id: string; type: "ACTIVATE"; } | { id: string | null; type: "HIGHLIGHT"; } | { direction: NavigateDirection; type: "NAVIGATE"; } | { char: string; type: "TYPEAHEAD"; } | { type: "TYPEAHEAD.RESET"; } | { items: ReadonlyArray<MenuItem>; type: "SET.ITEMS"; }# MenuItemKind
MenuItemKind = "item" | "separator"# MenuMachine
MenuMachine = Machine<MenuContext, MenuEvent, MenuState># MenuState
MenuState = "closed" | "open"# createMenuMachine ( )
createMenuMachine(input): MenuMachineConstruct a fresh Menu machine.
Parameters
inputCreateMenuInput
Returns
MenuMachine# lastEnabledId ( )
lastEnabledId(items): string | nullParameters
itemsreadonly MenuItem[]
Returns
string | null