mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-02 02:43:33 +00:00
restructure files onto electron-vite boilerplate
This commit is contained in:
parent
91ce2cd8a1
commit
1cf587bc8f
457 changed files with 9927 additions and 11705 deletions
33
src/preload/lyrics.ts
Normal file
33
src/preload/lyrics.ts
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { ipcRenderer } from 'electron';
|
||||
|
||||
import {
|
||||
InternetProviderLyricSearchResponse,
|
||||
LyricGetQuery,
|
||||
LyricSearchQuery,
|
||||
LyricSource,
|
||||
} from '../main/features/core/lyrics';
|
||||
|
||||
const getRemoteLyricsBySong = (song: QueueSong) => {
|
||||
const result = ipcRenderer.invoke('lyric-by-song', song);
|
||||
return result;
|
||||
};
|
||||
|
||||
const searchRemoteLyrics = (
|
||||
params: LyricSearchQuery,
|
||||
): Promise<Record<LyricSource, InternetProviderLyricSearchResponse[]>> => {
|
||||
const result = ipcRenderer.invoke('lyric-search', params);
|
||||
return result;
|
||||
};
|
||||
|
||||
const getRemoteLyricsByRemoteId = (id: LyricGetQuery) => {
|
||||
const result = ipcRenderer.invoke('lyric-by-remote-id', id);
|
||||
return result;
|
||||
};
|
||||
|
||||
export const lyrics = {
|
||||
getRemoteLyricsByRemoteId,
|
||||
getRemoteLyricsBySong,
|
||||
searchRemoteLyrics,
|
||||
};
|
||||
|
||||
export type Lyrics = typeof lyrics;
|
||||
Loading…
Add table
Add a link
Reference in a new issue