Skip to main content

Module client

Module client 

Source
Expand description

Generate TypeScript client classes and scoped client factories.

Each service gets a {Service}Client class that wraps builder/parser functions and provides typed method calls. Scoped clients (detected from nested union patterns) get their own classes with curried scope fields.

Scoped client methods call deterministic builder functions and unwrap responses through the ancestor chain, matching the Rust codegen pattern exactly.

Functionsยง

emit_bound_unary_call ๐Ÿ”’
emit_error_throw ๐Ÿ”’
Emit an error-variant check that throws an Error with the RPC error message.
generate_client
Generate the main client class and scoped client classes.
generate_scoped_client ๐Ÿ”’
Generate a scoped client class (e.g., RepositoryClient).
generate_streaming_body ๐Ÿ”’
has_streaming_in_scoped ๐Ÿ”’
has_streaming_methods
Check if any method in the schema returns StreamInfo (indicating streaming support needed).