mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-25 07:16:51 +00:00
新的提交
This commit is contained in:
23
src/services/ipc.ts
Normal file
23
src/services/ipc.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
// Electron IPC 通信封装
|
||||
|
||||
// 配置
|
||||
export const config = {
|
||||
get: (key: string) => window.electronAPI.config.get(key),
|
||||
set: (key: string, value: unknown) => window.electronAPI.config.set(key, value),
|
||||
clear: () => window.electronAPI.config.clear()
|
||||
}
|
||||
|
||||
// 对话框
|
||||
export const dialog = {
|
||||
openFile: (options?: Electron.OpenDialogOptions) =>
|
||||
window.electronAPI.dialog.openFile(options),
|
||||
saveFile: (options?: Electron.SaveDialogOptions) =>
|
||||
window.electronAPI.dialog.saveFile(options)
|
||||
}
|
||||
|
||||
// 窗口控制
|
||||
export const windowControl = {
|
||||
minimize: () => window.electronAPI.window.minimize(),
|
||||
maximize: () => window.electronAPI.window.maximize(),
|
||||
close: () => window.electronAPI.window.close()
|
||||
}
|
||||
Reference in New Issue
Block a user