ProyectoSammi/preload.js
2026-08-19 17:28:16 -04:00

19 lines
781 B
JavaScript

const { contextBridge, ipcRenderer } = require("electron");
contextBridge.exposeInMainWorld("electronAPI", {
getRanking: () => ipcRenderer.invoke("ranking:get"),
getTop10: () => ipcRenderer.invoke("ranking:getTop10"),
openFile: () => ipcRenderer.invoke("dialog:openFile"),
processExcel: (filePath) => ipcRenderer.invoke("excel:process", filePath),
getDownloadsPath: () => ipcRenderer.invoke("getDownloadsPath"),
getNonRecommended: () => ipcRenderer.invoke("nonrecommended:get"),
generatePDF: (data) => ipcRenderer.invoke("generate-pdf", data),
checkFileExists: (filePath) => ipcRenderer.invoke("fs:exists", filePath),
getAssetsPath: () => ipcRenderer.invoke("get:assetsPath"),
getAudioPath: (audioKey) => ipcRenderer.invoke("getAudioPath", audioKey)
});