UNPKG

comlink-adapters

Version:

Implementation of comlink adapters for different application platforms

29 lines (28 loc) 855 B
import type { Endpoint } from 'comlink'; import type { IpcRenderer, IpcMain, WebContents, MessagePortMain, MessageChannelMain } from 'electron'; /** * create electron messagePortMain endpoint * @param options * @returns */ export declare function electronMessagePortMainEndpoint(port: MessagePortMain, messageChannelConstructor?: new () => MessageChannelMain): Endpoint; /** * create electron renderer endpoint * @param options * @returns */ export declare function electronRendererEndpoint(options: { ipcRenderer: IpcRenderer; channelName?: string; }): Endpoint; /** * create electron main endpoint * @param options * @returns */ export declare function electronMainEndpoint(options: { sender: WebContents; ipcMain: IpcMain; messageChannelConstructor: new () => MessageChannelMain; channelName?: string; }): Endpoint;