[TS] Resolve locally-defined structs in other structs, create index.mts