feat(sdk): 新增咪咕/千千/JOOX/哔哩哔哩/5sing/Apple Music 六平台
平台注册表由 9 个扩到 15 个,同时补齐 sdk/types.ts 的类型与 OpenAPI 文档里的能力位声明。 - migu:命中 Z3D/I3D 加密候选时不返回直链,改由服务端解密代理出流, SDK 侧只负责登记票据,避免客户端拿到无法播放的密文 - apple:只提供 preview 试听片段(完整曲为 DRM),标 noAggregate 排除在跨平台精确匹配之外,防止用它顶掉其它平台的可播结果 - 其余平台按既有 PlatformModule 约定实现搜索/专辑/歌单/歌词 为什么合并成一次提交:六平台共用同一份注册表与能力位声明, 拆开会产生互相引用、单独无法通过类型检查的中间态。
This commit is contained in:
1 parent
47ce651f46
commit
33b96f92c4
54 files changed
+6161
-5
No files matched your search
+14
-5
@@ -2,7 +2,10 @@
|
||||
// 所有平台模块与根模块的类型锚点。类型只描述实际返回的数据形状,不改变运行时行为。
|
||||
|
||||
/** 音乐平台标识 */
|
||||
export type Source = 'kw' | 'kg' | 'tx' | 'wy' | 'qs' | 'xm' | 'me' | 'qt' | 'lr'
|
||||
export type Source =
|
||||
| 'kw' | 'kg' | 'tx' | 'wy' | 'qs'
|
||||
| 'migu' | 'qian' | 'joox' | 'bili' | '5sing' | 'apple'
|
||||
| 'xm' | 'me' | 'qt' | 'lr'
|
||||
|
||||
/** 音质标识(wav 仅部分接口声明使用) */
|
||||
export type Quality = '128k' | '320k' | 'flac' | 'flac24bit' | 'wav'
|
||||
@@ -71,6 +74,12 @@ export interface RequestObj<T> {
|
||||
cancelHttp(): void
|
||||
}
|
||||
|
||||
/** 请求句柄的宽松形态:SDK 内 promise 会在 .then() 中改写为对应结果类型 */
|
||||
export interface AnyRequestObj {
|
||||
promise: Promise<any>
|
||||
cancelHttp(): void
|
||||
}
|
||||
|
||||
/** 取流结果 */
|
||||
export interface MusicUrlResult {
|
||||
type: string
|
||||
@@ -136,10 +145,10 @@ export interface PlatformModule {
|
||||
songList?: any
|
||||
hotSearch?: HotSearchModule
|
||||
comment?: CommentModule
|
||||
getMusicUrl?(songInfo: SongInfo, type: Quality): HttpRequestObject
|
||||
getLyric?(songInfo: SongInfo, ...rest: unknown[]): HttpRequestObject
|
||||
getPic?(songInfo: SongInfo, ...rest: unknown[]): HttpRequestObject | Promise<any>
|
||||
getMusicInfo?(songInfo: SongInfo): HttpRequestObject | Promise<any>
|
||||
getMusicUrl?(songInfo: SongInfo, type: Quality): AnyRequestObj | Promise<any>
|
||||
getLyric?(songInfo: SongInfo, ...rest: unknown[]): AnyRequestObj
|
||||
getPic?(songInfo: SongInfo, ...rest: unknown[]): AnyRequestObj | Promise<any>
|
||||
getMusicInfo?(songInfo: SongInfo): AnyRequestObj | Promise<any>
|
||||
getMusicDetailPageUrl?(songInfo: SongInfo): string
|
||||
[key: string]: any
|
||||
}
|
||||
Reference in new issue
Block a user