first commit

This commit is contained in:
2026-06-01 17:28:00 +08:00
commit 23aa61401a
35 changed files with 5810 additions and 0 deletions

16
electron/preload.js Normal file
View File

@@ -0,0 +1,16 @@
const { contextBridge, ipcRenderer } = require('electron')
contextBridge.exposeInMainWorld('tunjiAPI', {
workspace: {
select: () => ipcRenderer.invoke('workspace:select'),
get: () => ipcRenderer.invoke('workspace:get'),
set: (path) => ipcRenderer.invoke('workspace:set', path),
ensureStructure: (path) => ipcRenderer.invoke('workspace:ensure-structure', path),
},
file: {
read: (filePath) => ipcRenderer.invoke('file:read', filePath),
write: (filePath, content) => ipcRenderer.invoke('file:write', filePath, content),
list: (dirPath) => ipcRenderer.invoke('file:list', dirPath),
mkdir: (dirPath) => ipcRenderer.invoke('file:mkdir', dirPath),
},
})