Skip to main content

Module typescript

Module typescript 

Source
Expand description

TypeScript code generation for vox services.

This module generates TypeScript client and server code from service definitions. The generated code includes:

  • Type definitions for all named types (structs, enums)
  • Client interface and implementation for making RPC calls
  • Handler interface for implementing the service
  • A Dispatcher class that routes calls to handler methods
  • A service descriptor for runtime schema-driven encode/decode

Re-exports§

pub use phon::generate_phon_service;
pub use client::generate_client;
pub use http_client::generate_http_client;
pub use schema::generate_descriptor;
pub use schema::generate_send_schema_table;
pub use server::generate_server;
pub use types::collect_named_types;
pub use types::generate_named_types;

Modules§

client
TypeScript client generation.
http_client
TypeScript HTTP client generation.
phon
Per-service phon schema emission for the TypeScript runtime.
schema
TypeScript generation for canonical service schema tables and descriptors.
server
TypeScript server/handler generation.
types
TypeScript type generation and collection.
wire
Generate TypeScript wire protocol definitions.

Structs§

ServiceGenerationOptions

Functions§

generate_method_ids
Generate method IDs as a TypeScript constant record.
generate_phon_handshake
Generate the phon HandshakeMessage module for vox-core: the handshake message types + registry + schemaId, plus handshakeSchemaClosure (the self-describing schema-closure bytes to prepend when sending a handshake message). The handshake is phon self-describing — each message carries its own schema closure.
generate_phon_wire
Generate the phon Message wire module for @bearcove/vox-wire: the envelope type declarations, the self-describing schema-bytes, a ready registry, and the schemaId constants — produced by delegating to phon-codegen. vox-wire’s codec decodes/encodes the envelope against this registry via @bearcove/phon-engine.
generate_service
Generate a complete TypeScript module for a service.
generate_service_with_options