[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
16
17
use ts_rs::TS;

#[derive(TS)]
struct Unit;

#[derive(TS)]
struct Unit2 {}

#[derive(TS)]
struct Unit3();

#[test]
fn test() {
    assert_eq!("type Unit = null;", Unit::decl());
    assert_eq!("type Unit2 = null;", Unit2::decl());
    assert_eq!("type Unit3 = null;", Unit3::decl());
}