-
Notifications
You must be signed in to change notification settings - Fork 0
IPC API
Trevor Sears edited this page Feb 23, 2020
·
5 revisions
To register the various IPC handlers (the API, effectively) after each program start, just import registerHandlers
from main/api/ipc-handler
and call it:
import { registerHandlers } from "main/api/ipc-handler";
registerHandlers(); // Handlers are now ready to go.
For each 'method' available over the IPC (inter-process communication), there is a 'function name', a parameter type, and a return type. In effect, using a given 'endpoint' on the main process's IPC API would look something like:
let parameter: ParameterType = /* something */;
let result: ReturnType = ipcRenderer.invoke("function name", parameter)