feishin/src/main/preload/lyrics.ts

24 lines
642 B
TypeScript
Raw Normal View History

2023-06-09 02:36:38 -07:00
import { ipcRenderer } from 'electron';
import { LyricSearchQuery, QueueSong } from '/@/renderer/api/types';
2023-06-09 02:36:38 -07:00
const getRemoteLyricsBySong = (song: QueueSong) => {
2023-07-01 19:10:05 -07:00
const result = ipcRenderer.invoke('lyric-by-song', song);
return result;
};
2023-06-08 03:40:34 -07:00
const searchRemoteLyrics = (params: LyricSearchQuery) => {
2023-07-01 19:10:05 -07:00
const result = ipcRenderer.invoke('lyric-search', params);
return result;
2023-06-08 03:40:34 -07:00
};
2023-06-09 02:36:38 -07:00
const getRemoteLyricsByRemoteId = (id: string) => {
2023-07-01 19:10:05 -07:00
const result = ipcRenderer.invoke('lyric-by-remote-id', id);
return result;
};
export const lyrics = {
2023-07-01 19:10:05 -07:00
getRemoteLyricsByRemoteId,
getRemoteLyricsBySong,
searchRemoteLyrics,
};