Home > Software design >  why TypeScript doesn't support Type.property in addtion to Type['property']
why TypeScript doesn't support Type.property in addtion to Type['property']

Time:07-08

why TypeScript doesn't support Type.property in addtion to lookup types like Type['property']

I find the former much more readable, but I guess there must be a reason why it's not supported.


for reference, here are two issues in which this is discussed

the TLDR version is that it would conflict with namespaces

it's real shame both issues have been closed.

CodePudding user response:

According to Typescript maintainer Ryan Cavanaugh, this is working as intended.

See this GitHub issue: https://github.com/microsoft/TypeScript/issues/30815

  • Related