TypeScript is a superset of JavaScript that adds optional static typing and class-based object-oriented programming. It adds additional features like interfaces and modules to JavaScript to allow code to scale. The document provides an introduction to TypeScript, explaining what it is, why to use it, its basic types, annotations, functions, interfaces, classes, generics, modules, and compiling. It also provides references for further reading.
5. Why TypeScript?
› Slow iteration of new features by JavaScript
› Many more features than defined in ECMAScript
› Very fast adoption rate so rowing community
7. “TypeScript is a strongly-typed
superset of JavaScript, which
means it adds some syntactical
benefits to the language while
still letting you write normal
JavaScript if you want to”
8. What is TypeScript?
› Starts with JavaScript and ends with JavaScript.
TypeScript is JavaScript.
› Run on any browser, any host, any OS.
› Open source project under Apache License 2.0.
› Adds numerous additional features like Class, Module
etc.
› Developed by Anders Hejlsberg, who also created C#
and Delphi.
› Heavily influenced by ES6.
16. TypeScript Interfaces
› Used at design time to provide auto completion and compile
time checking
› Optional Properties
› Function Types
› Indexable Types
› Class Types
› Extending Interfaces
› Hybrid Types
22. TypeScript Modules
› Encapsulates variables, classes and interfaces.
› Splitting across files.
› One file can contain multiple modules.
› Can be defined as internal or external.
› Can define Alias to Module.