Class: menuCore

menuCore(functions, options)

A helper class for creating menus

Constructor

Parameters:
Name Type Description
functions Object
Properties
Name Type Description
dualFunction The functions for each object, the option being named after the property name. Multiple of these are to be used.
options Object
Properties
Name Type Attributes Default Description
up string <optional>
"up" the key to use for scrolling up in the menu
down string <optional>
"down" the key to use for scrolling down in the menu
confirmKey string <optional>
"return" the key that is listened for selecting options
updateMode string <optional>
"internal" the mode to use for updating hovered elements, either internal (process inside the class), event (emit an event), function (run a custom function)
modifier function | string <optional>
"\x1b[7m" the modifier for selected text. when mode is internal, this can for example be a color code. If it is set to function, this will be the function that gets called
instance Container <optional>
the container to use for modifying text if mode is set to internal. Else this is not necessary to be provided.
Source:

Extends

  • multiline

Methods

enable() → {module:events.EventEmitter.EventEmitter}

Enable the menu. Will disable once an option is selected, and will emit hover update events if set to this mode in constructor, else the return can be ignored.
Source:
Returns:
Type
module:events.EventEmitter.EventEmitter