Initial QOffice implementation
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
const { contextBridge, ipcRenderer } = require("electron");
|
||||
|
||||
ipcRenderer.on("qoffice:command", (_event, command) => {
|
||||
if (typeof command === "string") {
|
||||
window.dispatchEvent(new CustomEvent("qoffice-command", { detail: { command } }));
|
||||
}
|
||||
});
|
||||
|
||||
contextBridge.exposeInMainWorld("qoffice", {
|
||||
isDesktop: true,
|
||||
platform: process.platform,
|
||||
openOfficeFile: (kind) => ipcRenderer.invoke("qoffice:open-office-file", kind),
|
||||
saveOfficeFile: (kind, defaultFileName, base64Data) =>
|
||||
ipcRenderer.invoke("qoffice:save-office-file", {
|
||||
kind,
|
||||
defaultFileName,
|
||||
base64Data
|
||||
}),
|
||||
exportPdf: (defaultFileName) => ipcRenderer.invoke("qoffice:export-pdf", defaultFileName)
|
||||
});
|
||||
Reference in New Issue
Block a user