1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::BuildState;

impl super::ToTypescript for syn::ItemType {
    fn convert_to_ts(self, state: &mut BuildState, _debug: bool, _uses_typeinterface: bool) {
        state.types.push_str("\n");
        let name = self.ident.to_string();
        let ty = crate::typescript::convert_type(&self.ty);
        let comments = crate::utils::get_comments(self.attrs);
        state.write_comments(&comments, 0);
        state
            .types
            .push_str(format!("type {name} = {ty}", name = name, ty = ty.ts_type).as_str());

        state.types.push_str("\n");
    }
}