https://github.com/dimfeld/rust-types-to-typescript-example
Generating Typescript types from Rust source code
https://github.com/dimfeld/rust-types-to-typescript-example
Last synced: 12 months ago
JSON representation
Generating Typescript types from Rust source code
- Host: GitHub
- URL: https://github.com/dimfeld/rust-types-to-typescript-example
- Owner: dimfeld
- License: mit
- Created: 2021-07-12T07:37:11.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-13T07:21:51.000Z (about 5 years ago)
- Last Synced: 2025-05-30T16:28:06.633Z (about 1 year ago)
- Language: JavaScript
- Size: 14.6 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE_MIT
Awesome Lists containing this project
README
This example code generates Typescript types from types in Rust source code,
written for my [blog post on the subject](https://imfeld.dev/writing/generating_typescript_types_from_rust).
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.