A games launcher for GOG, Amazon and Epic Games for Linux, Windows and macOS.
TypeScript amazon-primeelectronepic-games-launcherepic-games-storeepic-storegaminggoggog-galaxyheroic-games-launcherlinuxplay-gamesprotonsteamwine
To add type safety to Electron's IPC system, we've made the following changes to what you'd usually see in an Electron app:
- Since
contextIsolationis turned on, you cannot simply useipcRenderer.send/ipcRenderer.invokein the frontend to make IPC calls to the backend. Instead, we define a helper function for each IPC channel insrc/backend/api/, which will be injected into the frontend on load. It'll then be available aswindow.api.yourFunction. See Context Isolation for more details - To make sure that the parameters passed to & value returned from the callback of an
ipcMain.on/ipcMain.handlecall are correct, every IPC channel has to be defined insrc/common/typedefs/ipcBridge.d.ts(adding new channels either toSyncIPCFunctionsorAsyncIPCFunctions). This will also result in your callback's parameters automatically getting type annotations, and your helper function insrc/backend/api/getting type-checked as well