[go: up one dir, main page]

ts-rs 6.0.1

generate typescript bindings from rust types
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use ts_rs::TS;

#[test]
fn list() {
    #[derive(TS)]
    struct List {
        #[allow(dead_code)]
        data: Option<Vec<u32>>,
    }

    assert_eq!(
        List::decl(),
        "interface List { data: Array<number> | null, }"
    );
}