/rust-types-to-typescript-example

Generating Typescript types from Rust source code

Primary LanguageRustMIT LicenseMIT

This example code generates Typescript types from types in Rust source code, written for my blog post on the subject. This can be useful when you have a server written in Rust, but want to automatically synchronize types with frontend Typescript code.

It generates JSON schema files from the Rust source, and then Typescript types from that.

This example assumes that you have the cargo-watch crate installed globally. cargo install cargo-watch will install it if you haven't it already.