Closed oriSomething closed 5 years ago
1. I think I was just lazy as I also wanted to expose the native methods. In hindsight, I should have done it the other way around an assigned the native methods to my own exported object. This should be fixed. Help welcome :)
I think I'll fix it in #13.
2. I never considered the TypeScript case, but you're right, that does indeed make it more awkward (see [sindresorhus/electron-better-ipc/pull/13/files#r275195838](https://github.com/sindresorhus/electron-better-ipc/pull/13/files#r275195838)). I'm inclined to change it now.
I think that exposing two different exports is the way to go. It cleanly fixes the TS case. We could also provide two different entry points ('electron-better-ipc/renderer'
and 'electron-better-ipc/main'
) but I dislike this approach due to ergonomics.
Alright. Two different exports it is then. Thanks for chiming in.
Alright. Two different exports it is then. Thanks for chiming in.
ipcRenderer
/ipcMain
? (I'm asking that as if it would be using "prototype extensions" of browser techs){ ipcRenderer, ipcMain }
instead ofipc
which changed by the environment? (It's true, it's a bit cleaner, but they're still have different shape which mean, more confusion and not allowing creating proper type definitions)