8 lines
380 B
TypeScript
8 lines
380 B
TypeScript
|
import { contextBridge, ipcRenderer } from 'electron';
|
||
|
|
||
|
contextBridge.exposeInMainWorld('electronAPI', {
|
||
|
writeFile: (filePath: string, content: string) => ipcRenderer.invoke('write-file', filePath, content),
|
||
|
readFile: (filePath: string) => ipcRenderer.invoke('read-file', filePath),
|
||
|
listFiles: (dirPath: string) => ipcRenderer.invoke('list-files', dirPath)
|
||
|
});
|