DEV Community

loading...

Discussion on: My confusions about TypeScript

Collapse
abdullahdibas profile image
Abdullah Di'bas

Making this a typed language you need to expect that it makes more limitations on the code you write to help you avoid any bugs or errors at runtime. I think the first two points you mentioned are designed in Typescript to help you code in a way that doesn't violate Liskov Substitution Principle which is one of the SOLID design principles.
en.m.wikipedia.org/wiki/Liskov_sub...

Collapse
kenbellows profile image
Ken Bellows Author

The second point, absolutely. Not the first point though; what I was reaching for but couldn't find was typeof Model, as in function foo(model: typeof Model).