import { CYB_BROADCAST_CHANNEL } from './consts';
class BroadcastChannelListener {
    constructor(onMessage) {
        this.channel = new BroadcastChannel(CYB_BROADCAST_CHANNEL);
        if (onMessage) {
            this.channel.onmessage = (event) => onMessage(event);
        }
    }
    close() {
        this.channel.close();
    }
}
export default BroadcastChannelListener;
//# sourceMappingURL=BroadcastChannelListener.js.map