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

contextBridge.exposeInMainWorld('api', {
  loadCars: () => ipcRenderer.invoke('cars:load'),
  saveCars: (cars) => ipcRenderer.invoke('cars:save', cars),
  getCarsFolder: () => ipcRenderer.invoke('cars:folder:get'),
  selectCarsFolder: () => ipcRenderer.invoke('cars:folder:select'),
  resetCarsFolder: () => ipcRenderer.invoke('cars:folder:reset'),

  // Handig als je print via main wilt aanroepen:
  // print: (opts) => ipcRenderer.invoke('print', opts),
});
