This commit is contained in:
rosetta
2026-01-30 05:01:05 +02:00
commit 83f38dc63f
327 changed files with 18725 additions and 0 deletions

18
lib/preload/api.ts Normal file
View File

@@ -0,0 +1,18 @@
import { ipcRenderer } from 'electron';
const api = {
send: (channel: string, ...args: any[]) => {
ipcRenderer.send(channel, ...args);
},
receive: (channel: string, func: (...args: any[]) => void) => {
ipcRenderer.on(channel, (_, ...args) => func(...args));
},
invoke: (channel: string, ...args: any[]) => {
return ipcRenderer.invoke(channel, ...args);
},
removeAllListeners: (channel: string) => {
ipcRenderer.removeAllListeners(channel);
},
};
export default api;