/** * Default time to wait for the app to respond to a request-response * message before giving up and reclaiming the channel. */ export declare const MESSAGE_RESPONSE_TIMEOUT = 30000; /** * Single implementation of origin resolution for the embedded app. * Returns the origin (scheme://host[:port]) for a ThoughtSpot host URL, * or null when it cannot be parsed. * @param thoughtSpotHost */ export declare const resolveMessageOrigin: (thoughtSpotHost: string) => string | null; /** * Validates that an inbound window message came from the embedded * ThoughtSpot app: the source window must be the embed iframe's window and, * when the expected origin is resolvable, the message origin must match it. * * Fails open (returns true) on the origin check when the expected origin * cannot be resolved, to avoid breaking unconventional-but-working setups; * a warning is logged on mismatch either way. * @param event The message event received on window. * @param iFrame The embed iframe the message should originate from. * @param thoughtSpotHost The configured ThoughtSpot host. */ export declare const isMessageFromIframe: (event: MessageEvent, iFrame: HTMLIFrameElement, thoughtSpotHost: string) => boolean; /** * Posts a one-way message to the embedded app's iframe, optionally * transferring a MessageChannel port for the response. * @param iFrame * @param message * @param thoughtSpotHost Used as the postMessage targetOrigin. * @param channel */ export declare const postMessageToIframe: (iFrame: HTMLIFrameElement, message: { type: string; data: any; context?: any; }, thoughtSpotHost: string, channel?: MessageChannel) => void; /** * Sends a request-response message to the embedded app over a dedicated * MessageChannel. Resolves with the response payload; rejects when the app * responds with an error; resolves with a timeout Error object when no * response arrives in time (historical behavior, preserved for backward * compatibility). * @param iFrame * @param message * @param thoughtSpotHost * @param timeoutMs */ export declare function sendMessageWithResponse(iFrame: HTMLIFrameElement, message: { type: string; data: any; context?: any; }, thoughtSpotHost: string, timeoutMs?: number): Promise; //# sourceMappingURL=iframe-transport.d.ts.map