let sendToFocusedImpl = () => false let sendToWindowImpl = () => false let sendToAllImpl = () => false export function configureWindowMessaging({ sendToFocused, sendToWindow, sendToAll }) { if (typeof sendToFocused === 'function') { sendToFocusedImpl = sendToFocused } if (typeof sendToWindow === 'function') { sendToWindowImpl = sendToWindow } if (typeof sendToAll === 'function') { sendToAllImpl = sendToAll } } export function setMessageSender(sender) { if (typeof sender === 'function') { sendToFocusedImpl = sender } } export function sendToRenderer(channel, data) { return sendToFocusedImpl(channel, data) } export function sendToWindow(windowId, channel, data) { return sendToWindowImpl(windowId, channel, data) } export function sendToAllWindows(channel, data) { return sendToAllImpl(channel, data) }