xref: /MusicFree/src/types/common.d.ts (revision 428a07232c590a64f321e5de380e0b764e4a2b5e)
1declare namespace ICommon {
2    /** 支持搜索的媒体类型 */
3    export type SupportMediaType =
4        | 'music'
5        | 'album'
6        | 'artist'
7        | 'sheet'
8        | 'lyric';
9
10    /** 媒体定义 */
11    export type SupportMediaItemBase = {
12        music: IMusic.IMusicItemBase;
13        album: IAlbum.IAlbumItemBase;
14        artist: IArtist.IArtistItemBase;
15        sheet: IMusic.IMusicSheetItemBase;
16        lyric: ILyric.ILyricItem;
17    };
18
19    export type IUnique = {
20        id: string;
21        [k: string | symbol]: any;
22    };
23
24    export type IMediaBase = {
25        id: string;
26        platform: string;
27        $?: any;
28        [k: symbol]: any;
29        [k: string]: any;
30    };
31
32    /** 一些额外信息 */
33    export type IMediaMeta = {
34        lrc?: string;
35        associatedLrc?: IMediaBase;
36        headers?: Record<string, any>;
37        url?: string;
38        id?: string;
39        platform?: string;
40        qualities?: IMusic.IQuality;
41        $?: {
42            local?: {
43                localLrc?: string;
44                [k: string]: any;
45            };
46            [k: string]: any;
47        };
48        [k: string]: any;
49        [k: symbol]: any;
50    };
51
52    export type WithMusicList<T> = T & {
53        musicList?: IMusic.IMusicItem[];
54    };
55
56    export type PaginationResponse<T> = {
57        isEnd?: boolean;
58        data?: T[];
59    };
60}
61