I just had to help convert an old undocumented JS project to TS too. Fortunately had some help from 2 other devs but it was still a nightmare. Tons of intertwined code responsibilities that we shaped up back into lanes, and broke out a metric ton of interfaces from.
It’s much better now and has comments everywhere. It’s also earned the company record profits recently, so now I can point to it for the C-suite.