import type { AsyncApiChannelObject, AsyncApiOperationObject, AsyncApiServerObject, AsyncApiWsBindingObject } from '@scalar/types/asyncapi/3.1'; /** AsyncAPI server protocols supported for WebSocket connections in the API client MVP. */ export declare const ASYNCAPI_WEBSOCKET_PROTOCOLS: readonly ["ws", "wss"]; export type AsyncApiWebSocketProtocol = (typeof ASYNCAPI_WEBSOCKET_PROTOCOLS)[number]; export type BuildConnectionUrlInput = { server: AsyncApiServerObject; channel: AsyncApiChannelObject; operation?: AsyncApiOperationObject | null; pathParameters?: Record; queryParameters?: Record; environmentVariables?: Record | ((key: string) => string | null); }; /** * Extracts default values of variables defined on an AsyncAPI Server Object. */ export declare const getAsyncApiServerVariables: (server: AsyncApiServerObject | null) => Record; /** * Normalizes an AsyncAPI `protocol` for comparison: trimmed and lowercased. * * Returns `undefined` when the protocol is missing or blank, so callers can treat * "no protocol" distinctly instead of comparing against an empty string. */ export declare const normalizeProtocol: (protocol: string | undefined) => string | undefined; /** Maps AsyncAPI `server.protocol` to a URL scheme (MVP: ws and wss). */ export declare const getUrlSchemeFromProtocol: (protocol: string) => string; export declare const isWebSocketProtocol: (protocol: string) => protocol is AsyncApiWebSocketProtocol; /** * Builds the server base URL: scheme, host, and optional pathname (no channel address). */ export declare const buildAsyncApiServerBaseUrl: (server: AsyncApiServerObject, environmentVariables?: BuildConnectionUrlInput["environmentVariables"]) => string; /** Merges channel and operation WebSocket bindings; operation fields override channel. */ export declare const mergeWsBindings: (channel: AsyncApiChannelObject, operation?: AsyncApiOperationObject | null) => AsyncApiWsBindingObject | undefined; /** * Builds handshake query parameters from merged `bindings.ws.query` schema defaults, * then applies explicit overrides. */ export declare const buildWsQueryParams: (wsBinding: AsyncApiWsBindingObject | undefined, queryParameters?: Record) => URLSearchParams; /** * Builds a WebSocket connection URL from a resolved server, channel, and optional operation. * * Composition (AsyncAPI 3.x): * 1. `server.protocol` → URL scheme * 2. `server.host` (+ variables and environment substitution) * 3. Optional `server.pathname` * 4. Channel `address` (+ path parameter substitution) * 5. Query string from merged `bindings.ws.query` (channel + operation) with schema defaults */ export declare const buildConnectionUrl: ({ server, channel, operation, pathParameters, queryParameters, environmentVariables, }: BuildConnectionUrlInput) => string; //# sourceMappingURL=build-connection-url.d.ts.map