Variable: ScriptConfiguration
ScriptConfiguration: {
Checkbox
: (options
) =>boolean
;Number
: (options
) =>number
;Text
: (options
) =>string
; }
The ScriptConfiguration module provides a way to define configuration options for scripts. Developers can define configuration options for their scripts so that users can customize the behavior of the script.
The configuration options can be of type Checkbox, Number, or Text. (More types may be added in the future)
Usage example:
import { ScriptConfiguration } from 'unibot-api/ScriptConfiguration';
const myCheckbox = ScriptConfiguration.Checkbox({ label: 'My Checkbox' });
const myNumber = ScriptConfiguration.Number({ label: 'My Number' });
const myText = ScriptConfiguration.Text({ label: 'My Text', multiline: false });
console.log(myCheckbox, myNumber, myText);
Type declaration
Checkbox()
Checkbox: (
options
) =>boolean
Creates a Checkbox configuration option. The configuration option will be displayed as a checkbox in the script configuration UI.
Parameters
• options
• options.label: string
Returns
boolean
boolean representing the isChecked state of the checkbox. This is a getter/setter property that dynamically changes based on the user interaction with the checkbox.
Number()
Number: (
options
) =>number
Creates a Number configuration option. The configuration option will be displayed as a number input in the script configuration UI.
Parameters
• options
• options.label: string
Returns
number
number representing the selected value of the number input. This is a getter/setter property that dynamically changes based on the user interaction with the number input.
Text()
Text: (
options
) =>string
Creates a Text configuration option. The configuration option will be displayed as a text input in the script configuration UI.
Parameters
• options
• options.label: string
• options.multiline: boolean
Returns
string
string representing the text value of the text input. This is a getter/setter property that dynamically changes based on the user interaction with the text input.