export interface MessageDataObject { windowId: string; type: string; payload: unknown; } export type MessageData = string | MessageDataObject; // Callback function to listen for messages from the message broker. export type MessageBrokerListener = (type: string, payload: unknown) => void; // A message broker is used to send and receive messages between the runtime and the Raydiant SDK. export interface MessageBroker { sendMessage(type: string, payload?: unknown): void; registerListener(listener: MessageBrokerListener): () => void; } // Raydiant internals is a global object set by the Electron playlist runtime. It's used to communicate // with the Raydiant SDK over IPC. export interface RaydiantInternals { sendMessage: (windowId: string, type: string, payload?: unknown) => void; receiveMessage?: (message: string) => void; }