UIMenuBuilder

class UIMenuBuilder abstract

Dynamic menu builder, platform dependent (abstract).

Note: Typescene provides a platform dependent implementation by default. You can implement your own menu builder by extending this class and assigning a constructor reference to UITheme.MenuBuilder.

Constructor

(): UIMenuBuilder

.clear() abstract

(): this

Remove all current menu items.

.addOption() abstract

(key: string, text: Stringable, icon?: string, hint?: Stringable, hintIcon?: string, textStyle?: Partial<TextStyle>, hintStyle?: Partial<TextStyle>): this

Add a menu option with given key, text, icon, and hint.

.addSelectionGroup() abstract

(options: { key: string; text: Stringable; }[], selectedKey?: string, textStyle?: Partial<TextStyle>): this

Add a list of selectable menu options.

.addSeparator() abstract

(): this

Add a menu separator.

.setGravity() abstract

(gravity: "start" | "stretch" | "end"): this

Set the alignment of the menu to its related component (start, stretch, or end), if applicable.

.setRevealTransition() abstract

(transition: string): this

Set the animation that plays when the menu is displayed, if applicable.

.setExitTransition() abstract

(transition: string): this

Set the animation that plays when the menu is removed, if applicable.

.build() abstract

(): UIRenderableConstructor

Build a constructor for a menu with the current options, which should emit a SelectMenuItem event (of type UIMenuItemSelectedEvent) when an item is selected, and a CloseModal event to close the menu.