xref: /MusicFree/src/types/common.d.ts (revision b72437776165146f05624469023a64a2365044b4)
1bf6e62f2S猫头猫declare namespace ICommon {
20b940038S猫头猫    /** 支持搜索的媒体类型 */
375d76114S猫头猫    export type SupportMediaType =
475d76114S猫头猫        | 'music'
575d76114S猫头猫        | 'album'
675d76114S猫头猫        | 'artist'
775d76114S猫头猫        | 'sheet'
875d76114S猫头猫        | 'lyric';
90b940038S猫头猫
100b940038S猫头猫    /** 媒体定义 */
110b940038S猫头猫    export type SupportMediaItemBase = {
122d0ec5c1S猫头猫        music: IMusic.IMusicItemBase;
132d0ec5c1S猫头猫        album: IAlbum.IAlbumItemBase;
142d0ec5c1S猫头猫        artist: IArtist.IArtistItemBase;
15771839b6S猫头猫        sheet: IMusic.IMusicSheetItemBase;
1675d76114S猫头猫        lyric: ILyric.ILyricItem;
172d0ec5c1S猫头猫    };
182d0ec5c1S猫头猫
19ceb900cdS猫头猫    export type IUnique = {
20ceb900cdS猫头猫        id: string;
21ceb900cdS猫头猫        [k: string | symbol]: any;
22ceb900cdS猫头猫    };
23ceb900cdS猫头猫
242d0ec5c1S猫头猫    export type IMediaBase = {
252d0ec5c1S猫头猫        id: string;
262d0ec5c1S猫头猫        platform: string;
274060c00aS猫头猫        $?: any;
282d0ec5c1S猫头猫        [k: symbol]: any;
298b88e961S猫头猫        [k: string]: any;
302d0ec5c1S猫头猫    };
310d4e99c9S猫头猫
32242960d3S猫头猫    /** 一些额外信息 */
330d4e99c9S猫头猫    export type IMediaMeta = {
34*43eb30bfS猫头猫        /** 关联歌词信息 */
35*43eb30bfS猫头猫        associatedLrc?: IMediaBase;
36*43eb30bfS猫头猫        /** 是否下载过 TODO: 删去 */
37*43eb30bfS猫头猫        downloaded?: boolean;
38*43eb30bfS猫头猫        /** 本地下载路径 */
39*43eb30bfS猫头猫        localPath?: string;
40*43eb30bfS猫头猫        /** 补充的音乐信息 */
41*43eb30bfS猫头猫        mediaItem?: Partial<IMediaBase>;
42*43eb30bfS猫头猫        /** 歌词偏移 */
43*43eb30bfS猫头猫        lyricOffset?: number;
44*43eb30bfS猫头猫
450d4e99c9S猫头猫        lrc?: string;
46242960d3S猫头猫        headers?: Record<string, any>;
47242960d3S猫头猫        url?: string;
480d4e99c9S猫头猫        id?: string;
490d4e99c9S猫头猫        platform?: string;
50abaede57S猫头猫        qualities?: IMusic.IQuality;
518b88e961S猫头猫        $?: {
528b88e961S猫头猫            local?: {
538b88e961S猫头猫                localLrc?: string;
544060c00aS猫头猫                [k: string]: any;
554060c00aS猫头猫            };
564060c00aS猫头猫            [k: string]: any;
574060c00aS猫头猫        };
580d4e99c9S猫头猫        [k: string]: any;
590d4e99c9S猫头猫        [k: symbol]: any;
600d4e99c9S猫头猫    };
61d52aa40eS猫头猫
62d52aa40eS猫头猫    export type WithMusicList<T> = T & {
63d384662fS猫头猫        musicList?: IMusic.IMusicItem[];
64d52aa40eS猫头猫    };
65ceb900cdS猫头猫
66ceb900cdS猫头猫    export type PaginationResponse<T> = {
67ceb900cdS猫头猫        isEnd?: boolean;
68ceb900cdS猫头猫        data?: T[];
69ceb900cdS猫头猫    };
70f511aee9S猫头猫
71f511aee9S猫头猫    export interface IPoint {
72f511aee9S猫头猫        x: number;
73f511aee9S猫头猫        y: number;
74f511aee9S猫头猫    }
75bf6e62f2S猫头猫}
76