A utility to generate types for other typed languages.
Currently, only typescript is supported.
cargo install cargo-tsync
Mark structs with #[tsync]
as below:
```rs /// src/main.rs
struct Book {
name: String,
chapters: Vec
struct Chapter { title: String, pages: u32 } ```
Then use the tool:
sh
cargo tsync -i **/*.rs -o types.d.ts
And voilĂ !
```ts /// types.d.ts
interface Book {
name: string
chapters: Array
interface Chapter { title: string pages: number } ```
See cargo tsync --help
for more information.
Feel free to open tickets for support or feature requests.
This tool is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.