mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 10:23: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
28
src/preload/discord-rpc.ts
Normal file
28
src/preload/discord-rpc.ts
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import { SetActivity } from '@xhayper/discord-rpc';
|
||||
import { ipcRenderer } from 'electron';
|
||||
|
||||
const initialize = (clientId: string) => {
|
||||
const client = ipcRenderer.invoke('discord-rpc-initialize', clientId);
|
||||
return client;
|
||||
};
|
||||
|
||||
const clearActivity = () => {
|
||||
ipcRenderer.invoke('discord-rpc-clear-activity');
|
||||
};
|
||||
|
||||
const setActivity = (activity: SetActivity) => {
|
||||
ipcRenderer.invoke('discord-rpc-set-activity', activity);
|
||||
};
|
||||
|
||||
const quit = () => {
|
||||
ipcRenderer.invoke('discord-rpc-quit');
|
||||
};
|
||||
|
||||
export const discordRpc = {
|
||||
clearActivity,
|
||||
initialize,
|
||||
quit,
|
||||
setActivity,
|
||||
};
|
||||
|
||||
export type DiscordRpc = typeof discordRpc;
|
||||
Loading…
Add table
Add a link
Reference in a new issue