import { Message, MessageID } from './message'; /** * Communicates with a popup window for Coinbase keys.coinbase.com (or another url) * to send and receive messages. * * This class is responsible for opening a popup window, posting messages to it, * and listening for responses. * * It also handles cleanup of event listeners and the popup window itself when necessary. */ export declare class Communicator { private readonly url; private popup; private listeners; private debug; private onDisconnectCallback?; private popupCheckInterval?; private isDisconnecting; constructor({ url, debug, onDisconnect }: { url: string; debug?: boolean; onDisconnect?: () => void; }); /** * Posts a message to the popup window */ postMessage: (message: Message) => Promise; /** * Posts a request to the popup window and waits for a response */ postRequestAndWaitForResponse: (request: Message & { id: MessageID; }) => Promise; /** * Listens for messages from the popup window that match a given predicate. */ onMessage: (predicate: (_: Partial) => boolean) => Promise; private log; /** * Starts polling to check if popup is manually closed */ private startPopupPolling; /** * Stops polling for popup closure */ private stopPopupPolling; /** * Closes the popup, rejects all requests and clears the listeners */ disconnect: () => void; /** * Waits for the popup window to fully load and then sends a version message. */ waitForPopupLoaded: () => Promise; } //# sourceMappingURL=Communicator.d.ts.map