10 lines
367 B
JavaScript
10 lines
367 B
JavaScript
|
|
import { contextBridge, ipcRenderer } from 'electron';
|
||
|
|
|
||
|
|
contextBridge.exposeInMainWorld('electronAPI', {
|
||
|
|
selectFolder: () => ipcRenderer.invoke('select-folder'),
|
||
|
|
getDocsPath: () => ipcRenderer.invoke('get-docs-path'),
|
||
|
|
onDocsPathChanged: (callback: (path: string) => void) => {
|
||
|
|
ipcRenderer.on('docs-path-changed', (_event, path) => callback(path));
|
||
|
|
},
|
||
|
|
});
|