Skip to main content

generate_ts

Function generate_ts 

Source
pub fn generate_ts(schema: &Schema) -> Result<String>
Expand description

Compile a schema to a TypeScript module of classes with toVerit / fromVerit over the pure-veritate.ts port. Like the Python emitter it supports every schema the dynamic reader does; classes map to/from the port’s st([[id, value]]) form. The embedded canonical schema + 128-bit id are the cross-language contract. Runs under Node’s type stripping (the port is imported as ./veritate.ts), so no separate compile step is needed.