Files
steven 08cfcb50b0 🎉 初始提交:TinyLabel 图像文字编辑桌面工具
- 基于 Electron + React + TypeScript + Vite
- Fabric.js 画布编辑引擎
- Ant Design UI 组件 + Zustand 状态管理
- 支持文字添加、拖拽、字体/颜色/特效编辑
- 支持 PNG / JPEG / WebP 导出
2026-07-15 11:49:12 +08:00

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)