初步实现功能
This commit is contained in:
@ -1,6 +1,9 @@
|
||||
const { contextBridge, ipcRenderer } = require('electron')
|
||||
|
||||
contextBridge.exposeInMainWorld('electronAPI', {
|
||||
playSound: (file) => ipcRenderer.send('play-sound', file),
|
||||
showTooltip: (text) => ipcRenderer.send('show-tooltip', text)
|
||||
playSound: (soundFile) => ipcRenderer.send('play-sound', soundFile),
|
||||
showTooltip: (text) => ipcRenderer.send('show-tooltip', text),
|
||||
onUpdatePosition: (callback) => {
|
||||
ipcRenderer.on('update-position', (_, position) => callback(position))
|
||||
}
|
||||
})
|
Reference in New Issue
Block a user