新增HTTP开放API服务
This commit is contained in:
Vendored
+11
@@ -619,6 +619,17 @@ declare global {
|
||||
*/
|
||||
'sync.client.host': string
|
||||
|
||||
|
||||
/**
|
||||
* 是否启用开放API服务
|
||||
*/
|
||||
'openAPI.enable': boolean
|
||||
|
||||
/**
|
||||
* 同步服务端口号
|
||||
*/
|
||||
'openAPI.port': '23333' | string
|
||||
|
||||
/**
|
||||
* 是否在离开搜索界面时自动清空搜索框
|
||||
*/
|
||||
|
||||
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
declare namespace LX {
|
||||
namespace OpenAPI {
|
||||
interface Status {
|
||||
status: boolean
|
||||
message: string
|
||||
address: string
|
||||
}
|
||||
interface EnableServer {
|
||||
enable: boolean
|
||||
port: string
|
||||
}
|
||||
|
||||
interface ActionBase <A> {
|
||||
action: A
|
||||
}
|
||||
interface ActionData<A, D> extends ActionBase<A> {
|
||||
data: D
|
||||
}
|
||||
type Action<A, D = undefined> = D extends undefined ? ActionBase<A> : ActionData<A, D>
|
||||
|
||||
type Actions = Action<'status'>
|
||||
| Action<'enable', EnableServer>
|
||||
|
||||
}
|
||||
}
|
||||
Vendored
+13
@@ -15,5 +15,18 @@ declare namespace LX {
|
||||
interface LyricInfo extends LX.Music.LyricInfo {
|
||||
rawlrcInfo: LX.Music.LyricInfo
|
||||
}
|
||||
|
||||
interface Status {
|
||||
status: 'playing' | 'paused' | 'error' | 'stoped'
|
||||
name: string
|
||||
singer: string
|
||||
albumName: string
|
||||
picUrl: string
|
||||
progress: number
|
||||
duration: number
|
||||
lyricLineText: string
|
||||
lyric: string
|
||||
collect: boolean
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user