Extension manifests
The extension manifest contains metadata about your extension. It is used to display information to the user in Moonbase, checking required dependencies, and the API level.
If your editor supports JSON Schema, a schema for the manifest is available here. You can also reference the type in the moonlight source code.
This is an example manifest, with every value filled in:
Settings
There are many settings types that you can use to configure your extension in Moonbase. The types for these are available here.
All settings types take optional displayName
and description
arguments, as well as a default
. If a default is not provided, and the user hasn’t configured the extension, the value returned from moonlight.getConfigOption
will be undefined.
Note that the type defined is purely for what component to use in Moonbase - it is up to you to ensure that you save the right type to the config file.
boolean
Displays as a simple switch.
number
Displays as a simple slider.
min?: number
- The minimum value for the slider.max?: number
- The maximum value for the slider.
string
Displays as a single line string input.
multilinestring
Displays as a multiple line string input.
select
A dropdown to pick between one of many values.
options: SelectOption[]
- The options to choose.- Either a
string
or{ value: string; label: string; }
.
- Either a
multiselect
Same as select
, but can pick multiple values.
options: string[]
- The options to choose.
list
A list of strings that the user can add or remove from.
dictionary
A dictionary (key-value pair) that the user can add or remove from.
custom
A custom component. You can use the registerConfigComponent
function in the Moonbase API to register a React component to render here.