import { IRootIncomingMessageEnvelope, IRootMessagingProvider, IRootOutgoingMessageEnvelope } from '../contracts.js'; /** * A getAgent standard compliant root messaging publisher * Listens for new app connections established with WCP Hello message * Generates a connection ID for each app that connects * Creates a MessageChannel for each app and maps it to the connection id */ export declare class DefaultRootMessagingProvider implements IRootMessagingProvider { private messageChannelFactory?; private callbacks; private messageChannels; constructor(windowRef: Window, messageChannelFactory?: (() => MessageChannel) | undefined); /** * posts the provided message on the corresponding message channel for each channel id passed in the message envelope * @param message */ publish(message: IRootOutgoingMessageEnvelope): void; subscribe(callback: (message: IRootIncomingMessageEnvelope) => void): void; /** * responds to hello messages from proxy agents that are trying to establish communication * for each hello message received a new channelId is generated and a corresponding Message channel * one port is returned to the source app. The other is added to the lookup with the channel id as the key * @param message */ private onWindowMessage; }