DEV Community

Discussion on: My confusions about TypeScript

Collapse
 
jwp profile image
John Peters • Edited

Very good question. When moving to Typescript and the concept of the Classes and ability to extend a base class, one rule must be absolutely followed. The is-a relationship is paramount. The parent must be a type of base.

Base classes don't really return anything (other than hosting properties and funtions) rather, they morph all things public to be a part of the parent.

This is where intellisense shines because no API is needed as the editor discovers all props and functions as you type.