use specta::{ResolvedTypes, Type};
use specta_typescript::{JSDoc, Typescript};
#[derive(Type)]
pub struct TypeOne {
pub field1: String,
pub field2: TypeTwo,
}
#[derive(Type)]
#[deprecated = "bruh"]
pub struct TypeTwo {
#[deprecated]
pub my_field: String,
pub bruh: another::TypeThree,
}
#[derive(Type)]
pub struct ImGeneric<T> {
pub my_field: T,
}
mod another {
#[derive(specta::Type)]
pub struct TypeThree {
pub my_field: String,
}
}
fn main() {
let resolved_types = ResolvedTypes::from_resolved_types(specta::collect());
Typescript::default()
.layout(specta_typescript::Layout::Files)
.export_to("./bindings", &resolved_types)
.unwrap();
JSDoc::default()
.layout(specta_typescript::Layout::Files)
.export_to("./bindings2", &resolved_types)
.unwrap();
}