[go: up one dir, main page]

ts-rs 2.1.3

generate typescript bindings from rust types
Documentation
#![allow(dead_code)]

use ts_rs::TS;

#[derive(TS)]
enum SimpleEnum {
    #[ts(rename = "asdf")]
    A,
    B,
    C,
}

#[test]
fn test_simple_enum() {
    assert_eq!(
        SimpleEnum::decl(),
        r#"export type SimpleEnum = "asdf" | "B" | "C";"#
    )
}