-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreload.js
More file actions
14 lines (13 loc) · 801 Bytes
/
Copy pathpreload.js
File metadata and controls
14 lines (13 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const { contextBridge, ipcRenderer } = require('electron');
contextBridge.exposeInMainWorld('notesApi', {
loadNotes: () => ipcRenderer.invoke('notes:load'),
saveNotes: appState => ipcRenderer.invoke('notes:save', appState),
saveImage: dataUrl => ipcRenderer.invoke('notes:saveImage', dataUrl),
exportNoteMarkdown: note => ipcRenderer.invoke('notes:exportMarkdown', note),
exportAllMarkdown: notes => ipcRenderer.invoke('notes:exportAllMarkdown', notes),
backupNotes: appState => ipcRenderer.invoke('notes:backup', appState),
restoreBackup: () => ipcRenderer.invoke('notes:restoreBackup'),
importMarkdownFiles: () => ipcRenderer.invoke('notes:importMarkdownFiles'),
exportPdf: payload => ipcRenderer.invoke('notes:exportPdf', payload),
printCurrentWindow: () => window.print()
});