Map of message channels to their handler function signatures (WITHOUT sender)
Map of invoke channels to their handler function signatures (WITHOUT sender)
Union of allowed identifier strings for type-safe identifier usage
Note: When listening to events from TMessageMap or TInvokeMap, the listener signature will automatically include 'sender: DirectIpcTarget' as the first parameter.
ReadonlylocalLocal event emitter for lifecycle events
ReadonlythrottledThrottled message sending/receiving for high-frequency updates. Use this for lossy communication where only the latest value matters.
Clean up all pending invokes (useful for testing or shutdown)
Close all cached ports
Get the current default timeout
Get the current array of all registered target processes
Get this process's identifier
The identifier string or undefined if not set
Register a handler for invoke calls on a specific channel
Invoke a handler on a remote renderer using a TargetSelector Note: Only single-target selectors are supported (not allIdentifiers/allUrls)
// Invoke on specific webContentsId
const result = await directIpc.invoke({ webContentsId: 123 }, 'get-data', arg1, arg2)
// Invoke on identifier (throws if multiple matches)
const result = await directIpc.invoke({ identifier: 'output' }, 'get-data', arg1, arg2)
// Invoke on URL pattern (throws if multiple matches)
const result = await directIpc.invoke({ url: /^https://example/ }, 'get-data', arg1, arg2)
// With timeout option
const result = await directIpc.invoke({ identifier: 'output' }, 'get-data', arg1, { timeout: 5000 })
Manually refresh the map from main process
Optionalevent: ERemove a handler for a specific channel
Resolve a target to its webContentsId using the local map
Send a message to target renderer(s) using a TargetSelector
// Send to specific webContentsId
await directIpc.send({ webContentsId: 123 }, 'my-message', arg1, arg2)
// Send to single identifier (throws if multiple matches)
await directIpc.send({ identifier: 'output' }, 'my-message', arg1, arg2)
// Send to single URL pattern (throws if multiple matches)
await directIpc.send({ url: /^https://example/ }, 'my-message', arg1, arg2)
// Send to all matching identifiers
await directIpc.send({ allIdentifiers: /^output/ }, 'my-message', arg1, arg2)
// Send to all matching URLs
await directIpc.send({ allUrls: 'https://example.com' }, 'my-message', arg1, arg2)
Set the default timeout for invoke calls
Set or update this renderer's identifier
The identifier string to set (must be one of TIdentifierStrings)
StaticinstanceGet the singleton instance If identifier is provided, sets/updates the identifier
Map of message channels to their handler function signatures
Map of invoke channels to their handler function signatures
Union of allowed identifier strings for type-safe identifier usage
Optionaloptions: DirectIpcRendererOptions<TProcessIdentifier>
Renderer process DirectIpc client Provides type-safe direct communication between renderer processes