Class: IQMenu
Core.IQMenu
Hierarchy
-
IQMenu
↳
Menu
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new IQMenu(options
)
Parameters
Name | Type |
---|---|
options |
IQMenuOptions |
Defined in
Properties
commands
• commands: Object
Index signature
▪ [s: string
]: (…args
: any
) => any
Defined in
description
• Optional
description: string
Defined in
name
• Optional
name: string
Defined in
Methods
keypressed
▸ keypressed(cmdkeys?
): string
Parameters
Name | Type |
---|---|
cmdkeys |
null | string |
Returns
string
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.
Defined in
render
▸ render(module
, options?
): void
Parameters
Name | Type |
---|---|
module |
Function |
options? |
IQMenuLoopOptions |
Returns
void