(apiName, args)
| 17 | * 主进程 throw 的错误会被 Electron 包裹,这里去除前缀后重新抛出 |
| 18 | */ |
| 19 | const ipcInvoke = async (apiName, args) => { |
| 20 | try { |
| 21 | return await electron.ipcRenderer.invoke('plugin.api', apiName, args) |
| 22 | } catch (e) { |
| 23 | throw new Error(e.message.replace(/^.*?Error:/, '').trim()) |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * 单向 IPC 发送 - 通过 plugin.api 通道发送消息,不等待返回值 |
no outgoing calls
no test coverage detected