Code generation
A conforming generator MUST produce:
- Types for every named type.
i64/u64map tobigint;timestamptoDate;bytestoUint8Array;anyto the runtime’s item type (CborItemin the reference client). - A typed proxy per service for server methods:
- unary →
(args..., opts?) => Promise<R> - server stream →
AsyncIterable<Y> - client stream → accepts an
AsyncIterable<A>and returnsPromise<R> - bidi → accepts an
AsyncIterable<A>and returnsAsyncIterable<Y> - notify →
(args...) => void - options include
signal: AbortSignal(→ CANCEL),deadline,meta.
- unary →
- A typed registration surface for client methods (handlers for calls and notifications).
- Typed channel subscriptions exposing the snapshot (§10.2), publications, presence and the recovery position.
- Typed datagram send/receive per topic.
- Typed errors:
ERRORframes surface as an error class carrying the status code, message and typed detail. - The manifest fingerprint embedded in the generated code and sent in HELLO.
From the specification: §12.4.