Intial Version

This commit is contained in:
2025-12-03 18:00:10 -05:00
parent 43c4227da7
commit 0b86c88eb4
55 changed files with 8938 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
import { contextBridge, ipcRenderer } from 'electron';
// Expose protected methods that allow the renderer process to use
// the ipcRenderer without exposing the entire object
contextBridge.exposeInMainWorld('electron', {
ipcRenderer: {
invoke: (channel: string, ...args: any[]) => ipcRenderer.invoke(channel, ...args),
on: (channel: string, func: (...args: any[]) => void) => {
ipcRenderer.on(channel, (_event: any, ...args: any[]) => func(...args));
},
once: (channel: string, func: (...args: any[]) => void) => {
ipcRenderer.once(channel, (_event: any, ...args: any[]) => func(...args));
},
removeAllListeners: (channel: string) => {
ipcRenderer.removeAllListeners(channel);
},
},
});
// Type definitions for TypeScript
export interface IElectronAPI {
ipcRenderer: {
invoke: (channel: string, ...args: any[]) => Promise<any>;
on: (channel: string, func: (...args: any[]) => void) => void;
once: (channel: string, func: (...args: any[]) => void) => void;
removeAllListeners: (channel: string) => void;
};
}
declare global {
interface Window {
electron: IElectronAPI;
}
}