🎉 初始提交:TinyLabel 图像文字编辑桌面工具
- 基于 Electron + React + TypeScript + Vite - Fabric.js 画布编辑引擎 - Ant Design UI 组件 + Zustand 状态管理 - 支持文字添加、拖拽、字体/颜色/特效编辑 - 支持 PNG / JPEG / WebP 导出
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user