#![allow(dead_code)] use ts_rs::TS; #[derive(TS)] #[ts(export, export_to = "lifetimes/")] struct S<'a> { s: &'a str, } #[derive(TS)] #[ts(export, export_to = "lifetimes/")] struct B<'a, T: 'a> { a: &'a T, } #[derive(TS)] #[ts(export, export_to = "lifetimes/")] struct A<'a> { a: &'a &'a &'a Vec, //Multiple References b: &'a Vec>, //Nesting c: &'a std::collections::HashMap, //Multiple type args } #[test] fn contains_borrow() { assert_eq!(S::decl(), "type S = { s: string, };") } #[test] fn contains_borrow_type_args() { assert_eq!( A::decl(), "type A = { a: Array, b: Array>, c: { [key: string]: boolean }, };" ); }