I wrote a game using coffeescript but I would have preferred to write it in typescript. The brute force way to resolve this is to convert the code by hand. But I'm wondering if there's a way to take the coffeescript or the javascript generated by coffeescript and convert it into typescript automatically. A man can dream.
JavaScript code is already TypeScript code. Although it may have type errors, the compiler will still output a file (when it says 'error' it really means 'warning' unless the error occurred during parsing, which shouldn't be the case for JS that actually runs).
In terms of converting idiomatic JavaScript class/module-like structures into TypeScript classes or modules, there aren't any tools for that (yet). The TFS Team wrote an internal bespoke tool for their codebase to do this, but that was only really possible because their JS was written under very strict rules to begin with.