const {
  contextBridge,
  ipcRenderer
} = require('electron');

// Expose protected methods that allow the renderer process to use
// the ipcRenderer without exposing the entire object
contextBridge.exposeInMainWorld(
  'bridge', {
    log: (level, ...parts) => {
      ipcRenderer.send('log', level, parts);
    },
    metrics: () => {
      ipcRenderer.send('metrics');
    },
  }
);

console.log('[PRELOADED]');
