I ended up doing as proposed by Ryan Cavanaugh and just invoking the compiler. I used Olegs tips for creating more than one output for a template to add the generated files to the project and tt template.
I kicked off the compiler by the following code:
<#+
void CompileTypeScriptFile(string fullFileName)
{
var process = new System.Diagnostics.Process
{
StartInfo = new ProcessStartInfo
{
FileName = "tsc.exe",
Arguments = "--target ES5 \"" + fullFileName + "\""
}
};
process.Start();
process.WaitForExit();
}
#>