Testing
This commit is contained in:
16
electron/preload.js
Normal file
16
electron/preload.js
Normal file
@@ -0,0 +1,16 @@
|
||||
const { contextBridge, ipcRenderer, webUtils } = require("electron");
|
||||
|
||||
contextBridge.exposeInMainWorld("libraryAPI", {
|
||||
load: () => ipcRenderer.invoke("library:load"),
|
||||
save: (data) => ipcRenderer.invoke("library:save", data),
|
||||
settings: () => ipcRenderer.invoke("settings:load"),
|
||||
openVault: () => ipcRenderer.invoke("vault:open"),
|
||||
createVault: (name) => ipcRenderer.invoke("vault:create", name),
|
||||
switchVault: (id) => ipcRenderer.invoke("vault:switch", id),
|
||||
removeVault: (id) => ipcRenderer.invoke("vault:remove", id),
|
||||
importPdfs: (existingNames) => ipcRenderer.invoke("pdf:import", existingNames),
|
||||
importPdfPaths: (filePaths, existingNames) =>
|
||||
ipcRenderer.invoke("pdf:importPaths", filePaths, existingNames),
|
||||
openPdf: (pdfPath) => ipcRenderer.invoke("pdf:open", pdfPath),
|
||||
pathForFile: (file) => webUtils.getPathForFile(file),
|
||||
});
|
||||
Reference in New Issue
Block a user