Are you an LLM? You can read better optimized documentation at /documentation/api/core/type-aliases/InferClient.md for this page in Markdown format
ws-asyncapi API / core / InferClient
Type Alias: InferClient<C>
InferClient<
C> =CextendsChannel<infer Query, infer Headers, infer ClientData, infer ServerData, infer _Topics, infer Path, infer _Params, infer _Data, infer RpcMap, infer ServerRpcMap, infer StreamMap, infer AuthCredentials, infer PresenceState> ?object:never
Defined in: .api-entries/core/index.d.ts:639
Derive the typed client shape directly from a server Channel type — no codegen. Use with typeof channel:
ts
import { createClient } from "@ws-asyncapi/client";
const client = createClient<typeof chat>("ws://localhost:3000", "/chat/1");Yields { commandMap, eventMap, rpcMap, query, headers, address } — the same contract the CLI-generated WebsocketAsyncAPIMap provides, inferred instead.
Type Parameters
C
C extends AnyChannel