Skip to content

@statesync/electron


@statesync/electron / ElectronIpcMainHandle

Type Alias: ElectronIpcMainHandle()

ts
type ElectronIpcMainHandle = (channel, listener) => void;

Defined in: types.ts:179

Structural type matching ipcMain.handle() from Electron.

Registers an asynchronous handler for ipcRenderer.invoke() calls on the given channel. Only one handler can be registered per channel.

Process context: main process only.

Parameters

ParameterTypeDescription
channelstringThe IPC channel name to handle.
listener(event, ...args) => unknownAsync handler invoked when a renderer calls ipcRenderer.invoke(channel). The first argument is the Electron IpcMainInvokeEvent (typed as unknown for structural compatibility), followed by any arguments from the renderer.

Returns

void

Released under the MIT License.