- 基于 Electron + React + TypeScript + Vite - Fabric.js 画布编辑引擎 - Ant Design UI 组件 + Zustand 状态管理 - 支持文字添加、拖拽、字体/颜色/特效编辑 - 支持 PNG / JPEG / WebP 导出
14 lines
547 B
TypeScript
14 lines
547 B
TypeScript
import { contextBridge, ipcRenderer } from 'electron'
|
|
|
|
const api = {
|
|
readImages: (dirPath: string) => ipcRenderer.invoke('fs:readImages', dirPath),
|
|
selectDirectory: () => ipcRenderer.invoke('dialog:selectDirectory'),
|
|
saveFile: (filePath: string, base64Data: string) =>
|
|
ipcRenderer.invoke('fs:saveFile', filePath, base64Data),
|
|
selectSavePath: (defaultName: string) =>
|
|
ipcRenderer.invoke('dialog:saveFile', defaultName),
|
|
getFonts: () => ipcRenderer.invoke('system:getFonts'),
|
|
}
|
|
|
|
contextBridge.exposeInMainWorld('electronAPI', api)
|