import type { ApiWebSocketConnection, ApiWebSocketLike, ApiWebSocketUpgradeServer } from "./api-websocket.js"; export declare const INTERACTION_FRAME_PROXY_PATH = "/v1/interaction/frame-proxy"; export declare const INTERACTION_FRAME_PROXY_PROTOCOL_PREFIX = "opengeni-frame-proxy."; type ProxyGrant = Readonly<{ version: 1; upstreamUrl: string; upstreamProtocols: readonly string[]; responseProtocol: string; origin: string | null; expiresAt: number; }>; export type InteractionFrameProxyAttachment = Readonly<{ url: string; protocols: readonly string[]; }>; /** Docker boxes cannot carry browserd's WebSocket subprotocol grant to the * viewer. Unsigned OpenSandbox Channel B still uses the lifecycle proxy, so * it needs the same hatch. Signed URI-mode ingress keeps native subprotocols; * `openSandboxInteractionFrameProxy` is an emergency override only. */ export declare function placementUsesInteractionFrameProxy(backend: string | null | undefined, options?: { openSandboxSignedEndpoints?: boolean; openSandboxInteractionFrameProxy?: boolean; }): boolean; /** Public origin the browser can open. TLS-terminating reverse proxies make * `requestUrl` `http://127.0.0.1` / the API container; that would mint `ws://` * and Chrome blocks it from an `https://` console. */ export declare function resolveInteractionFrameProxyRequestUrl(input: { requestUrl: string; publicBaseUrl?: string | undefined; webBaseUrl?: string | undefined; forwardedProto?: string | null | undefined; forwardedHost?: string | null | undefined; }): string; export declare function createInteractionFrameProxyAttachment(input: { requestUrl: string; publicBaseUrl?: string | undefined; webBaseUrl?: string | undefined; forwardedProto?: string | null | undefined; forwardedHost?: string | null | undefined; rootSecret: string; upstreamUrl: string; upstreamProtocols: readonly string[]; origin: string | null; expiresAt: string; }): InteractionFrameProxyAttachment; export declare class InteractionFrameProxyTransport { private readonly rootSecret; private readonly clock; constructor(rootSecret: string | undefined, clock?: () => number); handles(request: Request): boolean; upgrade(request: Request, server: ApiWebSocketUpgradeServer): Response | undefined; } export declare class InteractionFrameProxyConnection implements ApiWebSocketConnection { private readonly grant; private socket; private upstream; private upstreamOpen; private terminal; private queued; private queuedBytes; constructor(grant: ProxyGrant); attach(socket: ApiWebSocketLike): void; receive(message: string | Uint8Array | ArrayBuffer): void; transportClosed(): void; private fail; private clear; } export {};