import { type CommunicationPartner, type Message, type Subscriber } from "./types";
export default class {
    /**
     * @var {string} identifier this instances unique identifier
     */
    identifier: string;
    /**
     * @property {Subscriber[]} subscribers list of all current message subscribers
     */
    subscribers: Subscriber[];
    /**
     * @property {CommunicationPartner} communicationPartner communication partner currently known
     */
    communicationPartner?: CommunicationPartner;
    /**
     * @property {(evt: MessageEvent) => void} listener the post message event listener
     */
    private listener;
    constructor();
    destruct(): void;
    /**
     * adds a new communication partner to the list of known partners
     *
     * @param {CommunicationPartner} partner the communication partner to add
     */
    setCommunicationPartner(partner: CommunicationPartner): void;
    isReady(): boolean;
    /**
     * generates a unique identifier.
     * Caveat: In case no secure browser context is available, a warning is printed to the console
     * because the returned identifier will not be cryptographically sound.
     *
     * @returns {string}
     */
    generateIdentifier(): string;
    /**
     * register a new subscriber
     *
     * @see {@link unsubscribe}
     *
     * @param {Subscriber} subscriber
     */
    subscribe(subscriber: Subscriber): void;
    /**
     * unregister a previously registered subscriber
     *
     * @see {@link subscribe}
     *
     * @param {Subscriber} subscriber some description test
     */
    unsubscribe(subscriber: Subscriber): void;
    /**
     * send a message to our communication partner
     *
     * @param {Message<unknown>} message the message to send
     */
    post(message: Message<unknown>): void;
    /**
     * send a message to any given window
     *
     * @param {Message<unknown>} message
     * @param {Window} target
     */
    postToUnknown(message: Message<unknown>, target: Window): void;
    /**
     * relays a message to all interested subscribers by calling their callback
     *
     * @param {Message<unknown>} message the message to relay
     * @private the ts `private` keyword is not added since this is actually accessed in unit tests, but you should not use this
     */
    relayMessage(message: Message<unknown>): void;
}
