This is surprising. I, being a beginner in TypeScript thought that types were implicitly tied with the classes I defined. I thought types worked similar to Java where one imports a class also imports the type implicitly. Thanks for pointing out the "secret" in typescript.
Your assumption is not wrong though! If a class has been declared in TypeScript, its value and its type do implicitly exist under the same name, therefore they're also imported together
But this is a rather special case for classes, most (all?) other entities do not create an implicit type alongside them.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is surprising. I, being a beginner in TypeScript thought that types were implicitly tied with the classes I defined. I thought types worked similar to Java where one imports a class also imports the type implicitly. Thanks for pointing out the "secret" in typescript.
Your assumption is not wrong though! If a class has been declared in TypeScript, its value and its type do implicitly exist under the same name, therefore they're also imported together
But this is a rather special case for classes, most (all?) other entities do not create an implicit type alongside them.