// Preload (Isolated World)
const { contextBridge, ipcRenderer } = require('electron')

contextBridge.exposeInMainWorld(
  'electron',
  { 
    send: (eventName, message) => {
      ipcRenderer.send(eventName, message)
    },
    receive: (eventName, callback) => {
      ipcRenderer.on(eventName, (event, ...args) => callback(...args));
    }
  }
)