import type { AsyncApiChannelObject, AsyncApiDocument, AsyncApiOperationObject, AsyncApiServerObject } from '@scalar/types/asyncapi/3.1'; import { type BuildConnectionUrlInput } from '../channel-example/build-connection-url.js'; import type { WorkspaceDocument } from '../schemas/workspace.js'; export type AsyncApiServerListOptions = { channel?: AsyncApiChannelObject | null; operation?: AsyncApiOperationObject | null; pathParameters?: Record; queryParameters?: Record; environmentVariables?: BuildConnectionUrlInput['environmentVariables']; /** When true (default), only servers with `ws` or `wss` protocol are returned. */ webSocketOnly?: boolean; }; export type AsyncApiServerEntry = { /** Key in `document.servers`. */ name: string; server: AsyncApiServerObject; host: string; protocol: string; description?: string; title?: string; /** Base URL (scheme + host + pathname) without the channel address. */ url: string; /** Full WebSocket URL when `channel` is provided in list options. */ connectionUrl?: string; /** Whether this server uses a WebSocket protocol (`ws` / `wss`). */ isWebSocket: boolean; }; /** * Collects the names of `document.servers` entries that the channel is restricted to. * * Returns `undefined` when the channel does not declare `servers`, signaling that every * top-level server is allowed. */ export declare const getChannelServerNames: (document: AsyncApiDocument, channel: AsyncApiChannelObject | null) => Set | undefined; /** * Returns a normalized list of AsyncAPI servers with computed base `url` and optional `connectionUrl`. */ export declare const getAsyncApiServers: (document: AsyncApiDocument, options?: AsyncApiServerListOptions) => AsyncApiServerEntry[]; /** * Returns the selected AsyncAPI server entry, using `x-scalar-selected-asyncapi-server` on the document. */ export declare const getSelectedAsyncApiServer: (document: WorkspaceDocument | null, servers: AsyncApiServerEntry[], _operation?: AsyncApiOperationObject | null) => AsyncApiServerEntry | null; //# sourceMappingURL=servers.d.ts.map