That is not right, When you compile to binaries, you do type erasure in CPP, som of the stuff can not be reconstructed or inferred, especially when using o flags.
JS -> TS is easy, you just re-anotate with `: any` everywhere.
Anyways, you are word juggling now.
Type definitions are definitely compiled with CPP. Type erasure only happens with polymorphism types. You can actually view the types with ghidra.