a simple keynote software for Markdown files – written in electron
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

21 lines
765 B

"use strict";
const {contextBridge, ipcRenderer, webFrame} = require("electron");
let fileOpenListener = null;
contextBridge.exposeInMainWorld("api", {
openFileDialog : () => ipcRenderer.send("WindowManager::openFileDialog"),
onFileOpen : callback => {
if (fileOpenListener)
ipcRenderer.off("Ation::openFile", fileOpenListener);
fileOpenListener = (_, presentation) => callback(presentation);
ipcRenderer.on("Ation::openFile", fileOpenListener);
},
openFile : filePath => ipcRenderer.send("WindowManager::openFile", filePath),
removeOnFileOpenListener : callback => ipcRenderer.off("Ation::openFile", callback),
clearCache : () => webFrame.clearCache(),
appVersion : async () => await ipcRenderer.invoke("Ation::appVersion")
});