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

Code Example 1

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.

Code Example 3

npm install -g typescript

Code Example 4

npx tsc index.ts

Learn ReactJs, React Native from akashmittal.com