Class: Menu
Hierarchy
-
↳
Menu
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new Menu(options
)
Parameters
Name | Type |
---|---|
options |
IQMenuOptions |
Inherited from
Defined in
Properties
commands
• commands: Object
Index signature
▪ [s: string
]: (…args
: any
) => any
Inherited from
Defined in
description
• Optional
description: string
Inherited from
Defined in
name
• Optional
name: string
Inherited from
Defined in
Methods
keypressed
▸ keypressed(cmdkeys?
): string
Parameters
Name | Type |
---|---|
cmdkeys |
null | string |
Returns
string
Inherited from
Defined in
prompt
▸ prompt(options?
): IQMenuPromptFunctions
Will render a prompt to the screen.
example
menu.prompt({ x: 20, y: 30, text: “Feed me: “ }).command(cmdkey)
menu.prompt({ text: “Enter your command: “.color(“bright cyan”), x: 20, y: 20 }).command(cmdkey)
menu.prompt({ x: 20, y: 30, text: “Feed me: “ }).command(cmdkey, (response, error) => {
if (response.error) {
alert(errors)
}
})
Parameters
Name | Type |
---|---|
options? |
string | IQMenuPromptOptions |
Returns
Functions that can be chained to the prompt.
Inherited from
Defined in
render
▸ render(module
, options?
): void
Parameters
Name | Type |
---|---|
module |
Function |
options? |
IQMenuLoopOptions |
Returns
void