"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const electron_1 = require("electron");
electron_1.contextBridge.exposeInMainWorld('widget', {
    getData: () => electron_1.ipcRenderer.invoke('widget:get-data'),
    openDashboard: () => electron_1.ipcRenderer.invoke('widget:open-dashboard'),
    hideWindow: () => electron_1.ipcRenderer.send('widget:hide-window'),
    resizeWindow: (height) => electron_1.ipcRenderer.send('widget:resize-window', height),
    onDataUpdate: (callback) => {
        electron_1.ipcRenderer.removeAllListeners('widget:data-update');
        electron_1.ipcRenderer.on('widget:data-update', (_event, data) => callback(data));
    },
    onInstallStatus: (callback) => {
        electron_1.ipcRenderer.removeAllListeners('install:status');
        electron_1.ipcRenderer.on('install:status', (_event, status) => callback(status));
    },
    getSettings: () => electron_1.ipcRenderer.invoke('widget:get-settings'),
    saveSettings: (settings) => electron_1.ipcRenderer.invoke('widget:save-settings', settings),
    getExchangeRate: () => electron_1.ipcRenderer.invoke('widget:get-exchange-rate'),
});
