Check out example codes for "install typescript mac". It will help you in understanding the concepts better.

Code Example 1

$ sudo npm install -g typescript

Code Example 2

TypeScript is an open-source programming language developed and maintained
by Microsoft.

It is a strict syntactical superset of JavaScript, and adds optional static
typing to the language. 

TypeScript is designed for development of large applications and transcompiles
to JavaScript.

Learn ReactJs, React Native from