diff --git a/src/request.dev.js b/src/request.dev.js index 9a7ff90..13ca927 100644 --- a/src/request.dev.js +++ b/src/request.dev.js @@ -32,7 +32,10 @@ const FORMAT = ( )?.split(";")?.[0]; log(`⚠ FORMAT: ${FORMAT}`, ""); !(async () => { - // 读取设置 + /** + * 设置 + * @type {{Settings: import('./types').Settings}} + */ const { Settings, Caches, Configs } = setENV("DualSubs", "Spotify", database); log(`⚠ Settings.Switch: ${Settings?.Switch}`, ""); switch (Settings.Switch) { diff --git a/src/request.js b/src/request.js index 2e3a902..ab6b0c5 100644 --- a/src/request.js +++ b/src/request.js @@ -32,7 +32,10 @@ const FORMAT = ( )?.split(";")?.[0]; log(`⚠ FORMAT: ${FORMAT}`, ""); !(async () => { - // 读取设置 + /** + * 设置 + * @type {{Settings: import('./types').Settings}} + */ const { Settings, Caches, Configs } = setENV("DualSubs", "Spotify", database); log(`⚠ Settings.Switch: ${Settings?.Switch}`, ""); switch (Settings.Switch) { diff --git a/src/response.dev.js b/src/response.dev.js index ac633b4..23a1e26 100644 --- a/src/response.dev.js +++ b/src/response.dev.js @@ -34,7 +34,10 @@ const FORMAT = ( )?.split(";")?.[0]; log(`⚠ FORMAT: ${FORMAT}`, ""); !(async () => { - // 读取设置 + /** + * 设置 + * @type {{Settings: import('./types').Settings}} + */ const { Settings, Caches, Configs } = setENV("DualSubs", "Spotify", database); log(`⚠ Settings.Switch: ${Settings?.Switch}`, ""); switch (Settings.Switch) { diff --git a/src/response.js b/src/response.js index b81e745..9d3bbbf 100644 --- a/src/response.js +++ b/src/response.js @@ -34,7 +34,10 @@ const FORMAT = ( )?.split(";")?.[0]; log(`⚠ FORMAT: ${FORMAT}`, ""); !(async () => { - // 读取设置 + /** + * 设置 + * @type {{Settings: import('./types').Settings}} + */ const { Settings, Caches, Configs } = setENV("DualSubs", "Spotify", database); log(`⚠ Settings.Switch: ${Settings?.Switch}`, ""); switch (Settings.Switch) { diff --git a/src/types.d.ts b/src/types.d.ts new file mode 100644 index 0000000..0dc6696 --- /dev/null +++ b/src/types.d.ts @@ -0,0 +1,53 @@ +export interface Settings { + /** + * 总功能开关 + * + * 是否启用此APP修改 + * + * @defaultValue true + */ + Switch?: boolean; + /** + * [歌词]启用类型(多选) + * + * 请选择要添加的歌词选项,如果为多选,则会自动决定提供的歌词类型。 + * + * @remarks + * + * Possible values: + * - `'Translate'` - 翻译歌词(翻译器) + * - `'External'` - 外部歌词(外部源) + * + * @defaultValue ["Translate","External"] + */ + Types?: ('Translate' | 'External')[]; + /** + * [翻译器]服务商API + * + * 请选择翻译器所使用的服务商API,更多翻译选项请使用BoxJs。 + * + * @remarks + * + * Possible values: + * - `'Google'` - Google Translate + * - `'Microsoft'` - Microsoft Translator(需填写API) + * + * @defaultValue "Google" + */ + Vendor?: 'Google' | 'Microsoft'; + /** + * [歌词]服务商API + * + * 请选择外部源所使用的服务商API。 + * + * @remarks + * + * Possible values: + * - `'NeteaseMusic'` - 网易云音乐(官方) + * - `'QQMusic'` - QQ音乐(官方) + * - `'NeteaseMusicNodeJS'` - 网易云音乐 NodeJS API + * + * @defaultValue "NeteaseMusic" + */ + LrcVendor?: 'NeteaseMusic' | 'QQMusic' | 'NeteaseMusicNodeJS'; +}