feat: save file to disk

This commit is contained in:
kangfenmao
2024-07-26 09:50:29 +08:00
parent 3aa4363f5b
commit 00a0b8df4d
8 changed files with 75 additions and 9 deletions
+1
View File
@@ -11,6 +11,7 @@ declare global {
checkForUpdate: () => void
openWebsite: (url: string) => void
setProxy: (proxy: string | undefined) => void
saveFile: (path: string, content: string) => void
}
}
}
+2 -1
View File
@@ -6,7 +6,8 @@ const api = {
getAppInfo: () => ipcRenderer.invoke('get-app-info'),
checkForUpdate: () => ipcRenderer.invoke('check-for-update'),
openWebsite: (url: string) => ipcRenderer.invoke('open-website', url),
setProxy: (proxy: string) => ipcRenderer.invoke('set-proxy', proxy)
setProxy: (proxy: string) => ipcRenderer.invoke('set-proxy', proxy),
saveFile: (path: string, content: string) => ipcRenderer.invoke('save-file', path, content)
}
// Use `contextBridge` APIs to expose Electron APIs to