Skip to content

Commit

Permalink
docs: types.d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
VirgilClyne committed Oct 22, 2024
1 parent 477c6fa commit 10d8a62
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/request.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 4 additions & 1 deletion src/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 4 additions & 1 deletion src/response.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 4 additions & 1 deletion src/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
53 changes: 53 additions & 0 deletions src/types.d.ts
Original file line number Diff line number Diff line change
@@ -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';
}

0 comments on commit 10d8a62

Please sign in to comment.