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

Code Example 1

interface LabelledValue {
  label: string;
}

function printLabel(labelledObj: LabelledValue) {
  console.log(labelledObj.label);
}

let myObj = {size: 10, label: "Size 10 Object"};
printLabel(myObj);

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

Starts and ends with JavaScript
TypeScript starts from the same syntax and semantics that millions of JavaScript developers know today. Use existing JavaScript code, incorporate popular JavaScript libraries, and call TypeScript code from JavaScript.

TypeScript compiles to clean, simple JavaScript code which runs on any browser, in Node.js, or in any JavaScript engine that supports ECMAScript 3 (or newer).

Code Example 4

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 5

JavacScript on steroids.

Learn ReactJs, React Native from akashmittal.com