Skip to content

Commit

Permalink
fix: resolve ipcRenderer no returns
Browse files Browse the repository at this point in the history
  • Loading branch information
badspider7 committed Mar 28, 2024
1 parent c7e5fd7 commit 59d20f9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions electron/preload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ import { ipcRenderer, contextBridge } from 'electron'
contextBridge.exposeInMainWorld('ipcRenderer', {
on(...args: Parameters<typeof ipcRenderer.on>) {
const [channel, listener] = args
ipcRenderer.on(channel, (event, ...args) => listener(event, ...args))
return ipcRenderer.on(channel, (event, ...args) => listener(event, ...args))
},
off(...args: Parameters<typeof ipcRenderer.off>) {
const [channel, ...omit] = args
ipcRenderer.off(channel, ...omit)
return ipcRenderer.off(channel, ...omit)
},
send(...args: Parameters<typeof ipcRenderer.send>) {
const [channel, ...omit] = args
ipcRenderer.send(channel, ...omit)
return ipcRenderer.send(channel, ...omit)
},
invoke(...args: Parameters<typeof ipcRenderer.invoke>) {
const [channel, ...omit] = args
ipcRenderer.invoke(channel, ...omit)
return ipcRenderer.invoke(channel, ...omit)
},

// You can expose other APTs you need here.
Expand Down

0 comments on commit 59d20f9

Please sign in to comment.