/** * Iframe Communication Manager for Tronic SDK * * Handles bidirectional communication with the iframe app to avoid CORS issues. * Delegates recommendation requests to the iframe. */ import type { CommunicationManager } from './communication-types'; export declare class IframeCommunicationManager implements CommunicationManager { private iframe; private isIframeReady; private pendingRequests; private messageListener; private requestCounter; private readonly REQUEST_TIMEOUT; private readonly DEBUG_ENABLED; constructor(iframe?: HTMLIFrameElement); /** * Set or update the iframe reference */ setIframe(iframe: HTMLIFrameElement): void; /** * Check if the communication manager is ready to send messages */ isReady(): boolean; /** * Request recommendation from iframe */ requestRecommendation(pageUrl: string, keywords: string[], context?: Record): Promise; /** * Send message to iframe and wait for response */ private sendMessageWithResponse; /** * Setup message listener for iframe responses */ private setupMessageListener; /** * Handle recommendation response */ private handleRecommendationResponse; /** * Handle user data updated message from iframe */ private handleUserDataUpdated; /** * Check if iframe is ready to receive messages */ private checkIframeReady; /** * Check if message origin is trusted */ private isMessageFromTrustedOrigin; /** * Generate unique request ID */ private generateRequestId; /** * Debug logging */ private debugLog; /** * Cleanup resources */ private cleanup; /** * Destroy the communication manager */ destroy(): void; } /** * Get or create the global communication manager instance */ export declare function getCommunicationManager(iframe?: HTMLIFrameElement): IframeCommunicationManager;