Typescript to the rescue!
First classes. The syntax is pretty easy
This short snipped of code shows off a lot of different features of the classes. First we see a class level property in the description. Next there is a constructor fo the class. Youâ€™ll notice that the propertyÂ publicationDate is prefaced by the keyword public. Â This is a great little shortcut which turnsÂ publicationDate into a public property on the class. It is the same as if we had created a property like description then assigned a value to it in the constructor. Finally we see the use of the this keyword to denote that we are accessing a class level variable.
Now if we wanted to move this class into a namespace we would use the module directive