User interaction - informational messages, error messages, questions and other dialogs.
Example
const Interactive = require("MuseApi.Interactive");
function main() {
Interactive.info("Quick start", "called main function")
}
Methods
(static) InteractiveApi::error(title, text)
Show error message
Parameters:
| Name | Type | Description |
|---|---|---|
title |
String | Title |
text |
String | Message |
(static) InteractiveApi::info(title, text)
Show information message
Parameters:
| Name | Type | Description |
|---|---|---|
title |
String | Title |
text |
String | Message |
(static) InteractiveApi::openUrl(url)
Open URL in external browser
Parameters:
| Name | Type | Description |
|---|---|---|
url |
String | URL |
(static) InteractiveApi::question(title, text, buttons) → {ButtonCode}
Ask a question
Parameters:
| Name | Type | Description |
|---|---|---|
title |
String | Title |
text |
String | Message |
buttons |
Array.<ButtonCode> | Code of buttons |
Returns:
- selected button
- Type
- ButtonCode
Example
let btn = api.interactive.question("My question", "Yes or No?", [ButtonCode.Yes, ButtonCode.No]);
if (btn === ButtonCode.Yes) {
...
}
(static) InteractiveApi::warning(title, text)
Show warning message
Parameters:
| Name | Type | Description |
|---|---|---|
title |
String | Title |
text |
String | Message |