API reference / @chanx-js/codegen
@chanx-js/codegen
Generate typed channel descriptors for the @chanx-js/client WebSocket client from a chanx AsyncAPI 3 schema.
Point it at a running server, Node or Python, and get the client's types, including what each request is answered with.
Documentation · Getting started · Why chanx-js?
bash
npm install -D @chanx-js/codegen
npx chanx-codegen http://localhost:8000/asyncapi.json -o src/generated- TypeScript output by default, or JavaScript with
.d.tsvia--emit js. - Optional zod validators with
--validation zod. - Reuse types you already have with
--reuse-from, and check they still match the schema with--reuse-strict.
MIT licensed.
Interfaces
- AsyncAPIDocument
- ChannelEmitOptions
- ChannelInfo
- ChannelObject
- ConnectionInfo
- GenerateOptions
- GenerateResult
- JsonSchema
- OperationObject
- Reply
- ReuseOptions
- ReuseResolution