notes API cleanup

This commit is contained in:
nicwands
2026-02-23 14:19:07 -05:00
parent 7a670aab92
commit 9ac9d73b0a
8 changed files with 48 additions and 64 deletions

View File

@@ -5,18 +5,18 @@ const api = {
openNoteWindow: (noteId) => {
ipcRenderer.send('open-note-window', noteId)
},
listNotes: () => ipcRenderer.invoke('notes:list'),
createNote: (path, content) =>
ipcRenderer.invoke('notes:create', { path, content }),
createNoteDir: (path) => ipcRenderer.invoke('notes:createDir', path),
readNote: (path) => ipcRenderer.invoke('notes:read', path),
updateNote: (path, content) =>
ipcRenderer.invoke('notes:update', { path, content }),
}
// Implement notes API
const notesAPI = {
call: (method, ...args) =>
ipcRenderer.invoke('notesAPI:call', method, args),
}
if (process.contextIsolated) {
try {
contextBridge.exposeInMainWorld('api', api)
contextBridge.exposeInMainWorld('notesAPI', notesAPI)
} catch (error) {
console.error(error)
}