Doesn't fit with the Typescript philosophy though: It should be possible to gradually add Typecript annotations to existing JavaScript code. It wouldn't work with 3rd party libraries either.
If you want something like this you might as well use a completely different language.
Still wouldn't work, since there is no way for the compiler to distinguish between a pure function and an impure function which just don't have an annotation - e.g. a third-party library written before "impure" was introduced to the language.
If pure functions were explicitly marked as "pure" the compiler could just conservatively assume all other functions were impure. But the opposite does not work.
If you want something like this you might as well use a completely different language.