💄 native menu items

This commit is contained in:
2026-03-03 20:46:23 +10:00
parent ac49c3df72
commit 63842b8805
7 changed files with 206 additions and 8 deletions

View File

@@ -90,5 +90,11 @@ contextBridge.exposeInMainWorld('api', {
ipcRenderer.invoke('fs:openStoryBible'),
writeStoryBible: (content: string): Promise<string> =>
ipcRenderer.invoke('fs:writeStoryBible', content)
ipcRenderer.invoke('fs:writeStoryBible', content),
onMenuAction: (handler: (action: string) => void): (() => void) => {
const listener = (_: Electron.IpcRendererEvent, action: string): void => handler(action)
ipcRenderer.on('menu:action', listener)
return () => ipcRenderer.removeListener('menu:action', listener)
}
})