improvements
This commit is contained in:
@@ -36,6 +36,10 @@ const api = {
|
||||
reveal: (path: string): void => { ipcRenderer.invoke('shell:reveal', path) },
|
||||
},
|
||||
|
||||
notes: {
|
||||
read: (): Promise<string> => ipcRenderer.invoke('notes:read'),
|
||||
write: (text: string): Promise<void> => ipcRenderer.invoke('notes:write', text),
|
||||
},
|
||||
git: {
|
||||
load: () => ipcRenderer.invoke('git:load'),
|
||||
stage: (paths: string[]) => ipcRenderer.invoke('git:stage', paths),
|
||||
@@ -110,6 +114,13 @@ const api = {
|
||||
return () => ipcRenderer.removeListener('config:changed', handler)
|
||||
},
|
||||
|
||||
/** Subscribe to the window entering/leaving fullscreen. Returns an unsubscribe. */
|
||||
onFullscreen: (cb: (on: boolean) => void): (() => void) => {
|
||||
const handler = (_e: unknown, on: boolean): void => cb(on)
|
||||
ipcRenderer.on('window:fullscreen', handler)
|
||||
return () => ipcRenderer.removeListener('window:fullscreen', handler)
|
||||
},
|
||||
|
||||
/** Subscribe to explicit ⌘R refresh requests (git + tree + viewer). Returns an unsubscribe. */
|
||||
onRefresh: (cb: () => void): (() => void) => {
|
||||
const handler = (): void => cb()
|
||||
|
||||
Reference in New Issue
Block a user