Expand description
Generate TypeScript request builder functions.
For each request union variant, generates a function that constructs a Cap’n Proto binary message with correct wire format offsets.
Scoped clients get builder functions that construct the full chain: root → init inner struct → set scope fields → set discriminant → payload.
Functions§
- emit_
field_ 🔒setter - Emit a setter call for a field on a builder variable.
- emit_
group_ 🔒arm_ setter - Write an inline union
grouparm’s leaf fields ontobuilder_var. - emit_
option_ 🔒setter - Emit code to write an Option* wrapper struct at a pointer slot.
- emit_
struct_ 🔒init - Emit code to init a sub-struct and set its non-union fields.
- emit_
union_ 🔒element_ setter - Emit a switch statement that writes union discriminant + variant payload for a list element.
- find_
chain_ 🔒variant_ info - Find the discriminant byte offset, discriminant value, and slot offset
for the variant that leads to
chain[level]from its parent. - find_
inner_ 🔒struct_ name - Find the inner struct type name for
chain[level]. - generate_
builders - Generate all request builder functions for a service.
- generate_
plain_ 🔒struct_ builder - Generate a single builder function for a non-union struct.
- generate_
scoped_ 🔒builders - Generate builder functions for a scoped client’s methods.
- generate_
struct_ builders - Generate standalone builder functions for all structs in a schema.
- is_
service_ 🔒struct - Check if a struct is the service request or response struct (handled by generate_builders).
- value_
expr_ 🔒for_ field - Optional fields carry
T | undefined; coalesce to the capnp default so TypeScript strict mode doesn’t reject passingT | undefinedto a setter.