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

contextBridge.exposeInMainWorld('rexrHost', {
  launchLibraryItem(item) {
    return ipcRenderer.invoke('library:launch', item);
  },
  clearActiveCapture() {
    return ipcRenderer.invoke('library:clear-active');
  },
  getSteamLibrary() {
    return ipcRenderer.invoke('steam:get-state');
  },
  rescanSteamLibrary() {
    return ipcRenderer.invoke('steam:rescan');
  },
  toggleFullscreen() {
    return ipcRenderer.invoke('window:toggle-fullscreen');
  },
  setFullscreen(enabled) {
    return ipcRenderer.invoke('window:set-fullscreen', enabled);
  },
  minimizeWindow() {
    return ipcRenderer.invoke('window:minimize');
  },
  closeWindow() {
    return ipcRenderer.invoke('window:close');
  },
});
