Edit. TS claims to have a design goal of typing common JS patterns. The pattern in question is typeof of undeclared variable. Probably every reader used to do
typeof window !== 'undefined' at least once.It's currently possible to declare the variable globally by extending Window interface, but those declarations will be available — well — everywhere, including the modules that have nothing to do with them. Global variables, global declarations, all the globals are widely considered an antipattern for this reason.
Narrowing already makes it so that single variable can have several types in different parts of the code, but correctly typed typeof would also require dynamically changing a set of variables that are available in current scope.
It weren't us who made a decision about design goals, so the discussion on unintended consequences is under the feature request.

