Closed xiao-e-yun closed 1 month ago
On 8.1.0, you can use
#[ts(as = "Option<Vec<String>>", optional)]
my_vec: Vec<String>
On the latest master (and soon in 9.0.0), you can then do
#[ts(as = "Option<_>", optional)]
my_vec: Vec<String>
It is by design that the TS types we generate match the type in Rust. This has been discussed at length before, see #175.
Describe the bug
ts(optional)
can't support skip_serializing_if attrTo Reproduce
optional
can only be used on an OptionExpected behavior return type