Framework
Ipc
Variable: Ipc
const Ipc: {
emit: (type, data, options?) => string;
getState: () => IpcState | null;
isCapable: (type) => boolean;
};Robo IPC Protocol for host-app communication.
Type declaration
| Name | Type |
|---|---|
emit | (type, data, options?) => string |
getState | () => IpcState | null |
isCapable | (type) => boolean |
Example
import { Ipc } from 'robo.js/ipc'
if (Ipc.isCapable('open:url')) {
Ipc.emit('open:url', { url: 'https://example.com' })
}
const state = Ipc.getState()
console.log(state?.env.type)