I also wonder if you could compile TypeScript to TypeScript types? After all, you want your type manipulation code to be typesafe.