mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 18:33:33 +00:00
18 lines
409 B
TypeScript
18 lines
409 B
TypeScript
|
|
import { IpcRendererEvent, ipcRenderer } from 'electron';
|
||
|
|
import { QueueSong } from '/@/renderer/api/types';
|
||
|
|
|
||
|
|
const fetchLyrics = (song: QueueSong) => {
|
||
|
|
ipcRenderer.send('lyric-fetch', song);
|
||
|
|
};
|
||
|
|
|
||
|
|
const getLyrics = (
|
||
|
|
cb: (event: IpcRendererEvent, songName: string, source: string, lyric: string) => void,
|
||
|
|
) => {
|
||
|
|
ipcRenderer.on('lyric-get', cb);
|
||
|
|
};
|
||
|
|
|
||
|
|
export const lyrics = {
|
||
|
|
fetchLyrics,
|
||
|
|
getLyrics,
|
||
|
|
};
|