···3333 };
34343535export type BooleanSettingType = {
3636+ /**
3737+ * Displays as a simple switch.
3838+ */
3639 type: ExtensionSettingType.Boolean;
3740 default?: boolean;
3841};
39424043export type NumberSettingType = {
4444+ /**
4545+ * Displays as a simple slider.
4646+ */
4147 type: ExtensionSettingType.Number;
4248 default?: number;
4349 min?: number;
···4551};
46524753export type StringSettingType = {
5454+ /**
5555+ * Displays as a single line string input.
5656+ */
4857 type: ExtensionSettingType.String;
4958 default?: string;
5059};
51605261export type MultilineTextInputSettingType = {
6262+ /**
6363+ * Displays as a multiple line string input.
6464+ */
5365 type: ExtensionSettingType.MultilineString;
5466 default?: string;
5567};
56685769export type SelectSettingType = {
7070+ /**
7171+ * A dropdown to pick between one of many values.
7272+ */
5873 type: ExtensionSettingType.Select;
5974 options: SelectOption[];
6075 default?: string;
6176};
62776378export type MultiSelectSettingType = {
7979+ /**
8080+ * A dropdown to pick multiple values.
8181+ */
6482 type: ExtensionSettingType.MultiSelect;
6583 options: string[];
6684 default?: string[];
6785};
68866987export type ListSettingType = {
8888+ /**
8989+ * A list of strings that the user can add or remove from.
9090+ */
7091 type: ExtensionSettingType.List;
7192 default?: string[];
7293};
73947495export type DictionarySettingType = {
9696+ /**
9797+ * A dictionary (key-value pair) that the user can add or remove from.
9898+ */
7599 type: ExtensionSettingType.Dictionary;
76100 default?: Record<string, string>;
77101};
7810279103export type CustomSettingType = {
104104+ /**
105105+ * A custom component.
106106+ * You can use the registerConfigComponent function in the Moonbase API to register a React component to render here.
107107+ */
80108 type: ExtensionSettingType.Custom;
81109 default?: any;
82110};
···88116}
8911790118export type ExtensionSettingsManifest = {
119119+ /**
120120+ * A human friendly name for the setting.
121121+ */
91122 displayName?: string;
123123+124124+ /**
125125+ * A longer description for the setting.
126126+ * Markdown is not supported.
127127+ */
92128 description?: string;
129129+130130+ /**
131131+ * The "advice" to give upon changing this setting.
132132+ * Can be configured to reload the client, restart the client, or do nothing.
133133+ */
93134 advice?: ExtensionSettingsAdvice;
94135} & (
95136 | BooleanSettingType
+90-1
packages/types/src/extension.ts
···2828 };
29293030export type ExtensionManifest = {
3131+ $schema?: string;
3232+3333+ /**
3434+ * A unique identifier for your extension.
3535+ */
3136 id: string;
3737+3838+ /**
3939+ * A version string for your extension - doesn't need to follow a specific format. Required for publishing.
4040+ */
3241 version?: string;
4242+4343+ /**
4444+ * The API level this extension targets. If it does not match the current version, the extension will not be loaded.
4545+ */
3346 apiLevel?: number;
4747+4848+ /**
4949+ * Which environment this extension is capable of running in.
5050+ */
3451 environment?: ExtensionEnvironment;
35525353+ /**
5454+ * Metadata about your extension for use in Moonbase.
5555+ */
3656 meta?: {
5757+ /**
5858+ * A human friendly name for your extension as a proper noun.
5959+ */
3760 name?: string;
6161+6262+ /**
6363+ * A short tagline that appears below the name.
6464+ */
3865 tagline?: string;
6666+6767+ /**
6868+ * A longer description that can use Markdown.
6969+ */
3970 description?: string;
7171+7272+ /**
7373+ * List of authors that worked on this extension - accepts string or object with ID.
7474+ */
4075 authors?: ExtensionAuthor[];
4141- deprecated?: boolean;
7676+7777+ /**
7878+ * A list of tags that are relevant to the extension.
7979+ */
4280 tags?: ExtensionTag[];
8181+8282+ /**
8383+ * The URL to the source repository.
8484+ */
4385 source?: string;
8686+8787+ /**
8888+ * A changelog to show in Moonbase.
8989+ * Moonbase will show the changelog for the latest version, even if it is not installed.
9090+ */
4491 changelog?: string;
9292+9393+ /**
9494+ * Whether the extension is deprecated and no longer receiving updates.
9595+ */
9696+ deprecated?: boolean;
4597 };
46989999+ /**
100100+ * A list of extension IDs that are required for the extension to load.
101101+ */
47102 dependencies?: string[];
103103+104104+ /**
105105+ * A list of extension IDs that the user may want to install.
106106+ */
48107 suggested?: string[];
108108+109109+ /**
110110+ * A list of extension IDs that the extension is incompatible with.
111111+ * If two incompatible extensions are enabled, one of them will not load.
112112+ */
49113 incompatible?: string[];
50114115115+ /**
116116+ * A list of settings for your extension, where the key is the settings ID.
117117+ */
51118 settings?: Record<string, ExtensionSettingsManifest>;
52119120120+ /**
121121+ * A list of URLs to bypass CORS for.
122122+ * This is implemented by checking if the start of the URL matches.
123123+ * @example https://moonlight-mod.github.io/
124124+ */
53125 cors?: string[];
126126+127127+ /**
128128+ * A list of URLs to block all requests to.
129129+ * This is implemented by checking if the start of the URL matches.
130130+ * @example https://moonlight-mod.github.io/
131131+ */
54132 blocked?: string[];
55133};
5613457135export enum ExtensionEnvironment {
136136+ /**
137137+ * The extension will run on both platforms, the host/native modules MAY be loaded
138138+ */
58139 Both = "both",
140140+141141+ /**
142142+ * Extension will run on desktop only, the host/native modules are guaranteed to load
143143+ */
59144 Desktop = "desktop",
145145+146146+ /**
147147+ * Currently equivalent to Both
148148+ */
60149 Web = "web"
61150}
62151