Essential TypeScript
Essential TypeScript
It's JavaScript... only better.
About the Book
JavaScript is old and its dynamic nature can make it very difficult to build large applications in a maintainable way. But, add the immense power of compile-type static typing and all of the sudden you've got an enterprise-ready language that saves you from many common JavaScript issues and actually makes web development an enjoyable experience. TypeScript is a superset of JavaScript - completely compatible in every way, yet it brings the language to a whole new level.
JavaScript is the defacto language of the world. TypeScript is JavaScript, only better.
Join experienced coder, Jess Chadwick, as he explores the world of TypeScript. Starting with the basics and fundamental ECMAScript 2015 features that TypeScript expands upon, Jess shows you all the ways that TypeScript allows you to bring your JavaScript development to the next level.
Your feedback is important!
You are welcome to choose to pay any amount you wish in order to access this book. If you choose not to pay anything, please repay me with your feedback. I would love a testimontial or to hear your comments, suggestions, and criticisms. Even better: if there is a change you'd like to see, clone the GitHub repository, make the changes yourself, and submit a pull request. I will recognize anyone who provides constructive feedback or changes on a special"Contributors" page in the book itself.
Table of Contents
-
1. Preface
- What You Should Know
- Source Code Examples
- Errors, Omissions, and Contributions
-
2. Introduction
- What is TypeScript?
- Defining “JavaScript”
- Writing your first TypeScript function
-
3. Getting Started
- Choosing your TypeScript editor
- Installing TypeScript in Visual Studio
- Installing the TypeScript Command Line Interface
- Configuring the TypeScript compiler
-
4. ECMAScript 2015 Features
- Optional Parameters
- Template Strings
- Let and const
- For..of Loops
- Arrow Functions
- Destructuring
- The Spread Operator
- Computed Properties
-
5. Type Fundamentals
- Introducing JavaScript Types
- Understanding Type Inference
- Specifying JavaScript Types
- Union Types
- Function Overloads
-
6. Custom Types
- Defining custom types with Interfaces
- Using interfaces to describe functions
- Extending interface definitions
- Defining constant values with enums
- Anonymous Types
- Using interfaces to dynamically access object properties
-
7. Classes
- Understanding Prototypical Inheritance
- Defining a class
- Applying static properties
- Making properties smarter with accessors
- Inheriting behavior from a base class
- Implementing an abstract class
- Controlling visibility with access modifiers
- Implementing interfaces
-
8. Generics
- Creating generic functions
- Creating generic classes
- Creating generic constraints
-
9. Modules
- Organizing Your Code with Namespaces
- Using namespaces to encapsulate private members
- Understanding the difference between Internal and External Modules
- Switching from internal to external modules
- Importing modules using Require syntax
- Importing modules using ECMAScript 2015 syntax
- Loading External Modules
-
10. Real-World Application Development
- Converting existing JavaScript code to TypeScript
- Generating Declaration Files
- Referencing third-party libraries
- Converting to External Modules
- Debugging TypeScript with source maps
-
11. Decorators
- Implementing Class Decorators
- Implementing Property Decorators
- Implementing Decorator Factories
-
12. Appendix: Syntax Examples
- ECMAScript 6 Features
- Custom Types
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $13 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them