Skip to content

@statesync/electron


@statesync/electron / ElectronInvoke

Type Alias: ElectronInvoke()

ts
type ElectronInvoke = (channel, ...args) => Promise<unknown>;

Defined in: types.ts:91

Function signature for invoking a main-process IPC handler from the renderer.

This is the Electron analog of TauriInvoke. It wraps ipcRenderer.invoke() and is exposed on the ElectronStateSyncBridge for use by the transport layer.

Parameters

ParameterTypeDescription
channelstringThe IPC channel name to invoke (must match an ipcMain.handle() registration).
...argsunknown[]Optional arguments forwarded to the main-process handler.

Returns

Promise<unknown>

A promise resolving to the value returned by the main-process handler.

Released under the MIT License.