Skip to content

IPC API

Trevor Sears edited this page Feb 23, 2020 · 5 revisions

Readying the API exposed by the main process

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.

How the API Docs will be structured

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)

API Documentation

Clone this wiki locally