Successfully reported this slideshow.

TypeScript 101

1

Share

Upcoming SlideShare
TypeScript
TypeScript
Loading in …3
×
1 of 13
1 of 13

TypeScript 101

1

Share

Download to read offline

TypeScript 101. TypeScript is a tool that allows you to utilize object oriented programming techniques with your JavaScript code. With TypeScript you have the same sort of namespaces and classes that you use to build your business objects. TypeScript classes support both inheritance and interfaces. We’ll introduce you to these concepts and show you how to use TypeScript to manage and organize your JavaScript code.

TypeScript 101. TypeScript is a tool that allows you to utilize object oriented programming techniques with your JavaScript code. With TypeScript you have the same sort of namespaces and classes that you use to build your business objects. TypeScript classes support both inheritance and interfaces. We’ll introduce you to these concepts and show you how to use TypeScript to manage and organize your JavaScript code.

More Related Content

Related Books

Free with a 14 day trial from Scribd

See all

Related Audiobooks

Free with a 14 day trial from Scribd

See all

TypeScript 101

  1. 1. TypeScript 101 Ross Terman www.xeq.com rterman@xeq.comt ed by Ross Terman
  2. 2. What is TypeScript TypeScript is a superset of JavaScript You can enter pure JavaScript into TypeScript TypeScript gives you type safety. TypeScript gives you encapsulation. TypeScript allows you to organize your code into Modules and Classes
  3. 3. Get TypeScript www.TypeScriptLang.org http://www.typescriptlang.org/Content/TypeScript %20Language%20Specification.pdf Web Essentials
  4. 4. TypeScript Features • Standard JavaScript Code • Static Typing • Encapsulation with Modules and Classes • Classes support Constructors, Properties, Fields and Functions • Interfaces • Lambda Functions => • Intellisense and syntax checking
  5. 5. Additional Keywords and Operators  exports and imports constructor extends implements Interface public/private … Rest syntax => Arrow or lambda functions <typename> type conversion : assignment
  6. 6. Code Hierarchy Module Interface Class Fields Constructors Properties Functions
  7. 7. Types Type Inference Annotations Type Definition Files Primitive Types: Number, String, Boolean, Any, Null, Undefined Object Types
  8. 8. Functions Parameters – Required and Optional Arrow (lambda) functions Void for functions that return no value
  9. 9. Classes Class Members – Fields, Properties, Functions, Constructors Add functions to a class. Note lack of function keyword Define properties Complex Types (object types) – Instantiate with New keyword Types can be cast https://github.com/borisyankov/DefinetlyTyped Extending Types – super() function. Similar to base Immediately-invoked function expression – iffy
  10. 10. Interfaces Optional members Implementing Using an Interface as a type Extend interface
  11. 11. Modules Benefits – Separation of concern, maintainable, testable, reusable Open – Can be exposed for both Import and Export Asynchronous Module Definition - AMD
  12. 12. Resources http://www/typescriptlang.org http://www.typescriptlang.org/Content/TypeScript%20Language%20Specifica tion.pdf http://www.johnpapa.net/ http://weblogs.asp.net/dwahlin/ http://pluralsight.com/training/
  13. 13. Contact Us Ross Terman – 305-726-6925 rterman@xeq.com @xeqinfo

×