Files
Shuodedaoli-Deskpet/main/preload.js
2025-08-06 14:15:15 +08:00

9 lines
362 B
JavaScript

const { contextBridge, ipcRenderer } = require('electron')
contextBridge.exposeInMainWorld('electronAPI', {
playSound: (soundFile) => ipcRenderer.send('play-sound', soundFile),
showTooltip: (text) => ipcRenderer.send('show-tooltip', text),
onUpdatePosition: (callback) => {
ipcRenderer.on('update-position', (_, position) => callback(position))
}
})