import type { EmbedToHostMessage, HostRequestPayload, HostToEmbedMessage } from './messages'; /** * Sends correlated requests to the embedded dashboard and settles each one * against its reply. * * Correlation ids are an implementation detail: `request` mints one, attaches it * to the outbound message, and `onMessage` consumes it, so callers only ever see * a promise. A timeout guards against an embed that dies mid-request. */ export declare class EmbedRequestChannel { private pending; private counter; private readonly send; private readonly timeoutMs; /** * @param send - Delivers a fully-formed message to the embed. Injected so the * channel stays independent of how the frame is addressed (and testable * without one). * @param timeoutMs - How long to wait for a reply before rejecting. */ constructor(send: (message: HostToEmbedMessage) => void, timeoutMs?: number); /** * Sends a request and resolves with the embed's reply. * * `T` is a caller-side annotation describing what the matching response * carries; it is not validated at runtime, since the payload crosses a * postMessage boundary. * * @returns A promise settled by the matching reply, or rejected on timeout, * error reply, or teardown. */ request(payload: HostRequestPayload): Promise; /** * Settles the request a reply correlates to. Messages that carry no * correlation id, or whose id is unknown (already settled, timed out, or from * another channel), are ignored. * * @returns Whether the message settled a pending request. */ onMessage(message: EmbedToHostMessage): boolean; /** Rejects all outstanding requests (e.g. on destroy). */ rejectAll(reason: unknown): void; } //# sourceMappingURL=EmbedRequestChannel.d.ts.map