ts-rs 12.0.1

generate typescript bindings from rust types
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#![allow(dead_code)]
use ts_rs::{Config, TS};

#[derive(TS)]
#[ts(export, export_to = "list/")]
struct List {
    data: Option<Vec<u32>>,
}

#[test]
fn list() {
    let cfg = Config::from_env();
    assert_eq!(List::decl(&cfg), "type List = { data: Array<number> | null, };");
}