Book description
Broaden your skill set by learning TypeScript and applying your knowledge to build real-world applications
Key Features
- Quickly get started writing TypeScript code with hands-on exercises and activities
- Develop new skills that can be applied at work or in your own side projects
- Build your understanding, boost your confidence, and advance your programming career
Book Description
By learning TypeScript, you can start writing cleaner, more readable code that's easier to understand and less likely to contain bugs. What's not to like?
It's certainly an appealing prospect, but learning a new language can be challenging, and it's not always easy to know where to begin. This book is the perfect place to start. It provides the ideal platform for JavaScript programmers to practice writing eloquent, productive TypeScript code.
Unlike many theory-heavy books, The TypeScript Workshop balances clear explanations with opportunities for hands-on practice. You'll quickly be up and running building functional websites, without having to wade through pages and pages of history and dull, dry fluff. Guided exercises clearly demonstrate how key concepts are used in the real world, and each chapter is rounded off with an activity that challenges you to apply your new knowledge in the context of a realistic scenario.
Whether you're a hobbyist eager to get cracking on your next project, or a professional developer looking to unlock your next promotion, pick up a copy and make a start! Whatever your motivation, by the end of this book, you'll have the confidence and understanding to make it happen with TypeScript.
What you will learn
- Configure a professional TypeScript development environment
- Explore how to use primitive and complex data types
- Incorporate types into popular npm (Node package manager) libraries
- Design systems that use asynchronous behavior
- Implement object-oriented programming to model real-world scenarios
- Get to grips with modern UI design by combining React with TypeScript
Who this book is for
The TypeScript Workshop is for software developers who want to broaden their skill set by learning the TypeScript programming language. To get the most from this TypeScript book, you should have basic knowledge of JavaScript or experience using another similar programming language.
Table of contents
- The TypeScript Workshop
- Preface
- 1. TypeScript Fundamentals
- 2. Declaration Files
- 3. Functions
- 4. Classes and Objects
-
5. Interfaces and Inheritance
- Introduction
-
Interfaces
- Case Study – Writing Your First Interface
- Exercise 5.01: Implementing Interfaces
- Exercise 5.02: Implementing Interfaces – Creating a Prototype Blogging Application
- Exercise 5.03: Creating Interfaces for a Function for Updating a User Database
- Activity 5.01: Building a User Management Component Using Interfaces
- TypeScript Inheritance
- Summary
- 6. Advanced Types
-
7. Decorators
- Introduction
- Reflection
- Importance of Decorators
- Decorators and Decorator Factories
- Class Decorators
- Method and Accessor Decorators
- Activity 7.01: Creating Decorators for Call Counting
- Using Metadata in Decorators
- Property Decorators
- Parameter Decorators
- Application of Multiple Decorators on a Single Target
- Summary
- 8. Dependency Injection in TypeScript
- 9. Generics and Conditional Types
- 10. Event Loop and Asynchronous Behavior
- 11. Higher-Order Functions and Callbacks
-
12. Guide to Promises in TypeScript
- Introduction
- The Evolution of and Motivation for Promises
- Anatomy of a Promise
- Enhancing Promises with Types
- Libraries and Native Promises — Third-Party Libraries, Q, and Bluebird
- Promisify
- Asynchronous FileSystem
- Working with Databases
- Developing with REST
- Putting It All Together – Building a Promise App
- Summary
- 13. Async/Await in TypeScript
- 14. TypeScript and React
-
Appendix
- 1. TypeScript Fundamentals
- 2. Declaration Files
- 3. Functions
- 4. Classes and Objects
- 5. Interfaces and Inheritance
- 6. Advanced Types
- 7. Decorator
- 8. Dependency Injection in TypeScript
- 9. Generics and Conditional Types
- 10. Event Loop and Asynchronous Behavior
- 11. Higher-Order Functions and Callbacks
- 12. Guide to Promises in TypeScript
- 13. Async/Await in TypeScript
- 14. TypeScript and React
Product information
- Title: The TypeScript Workshop
- Author(s):
- Release date: July 2021
- Publisher(s): Packt Publishing
- ISBN: 9781838828493
You might also like
book
TypeScript Quickly
TypeScript is JavaScript with an important upgrade! By adding a strong type system to JavaScript, TypeScript …
video
TypeScript for Beginners
TypeScript makes the life of developers easy by simplifying code. It follows programming conventions that make …
book
Angular Development with TypeScript, Second Edition
Angular Development with TypeScript, Second Edition is an intermediate-level tutorial that introduces Angular and TypeScript to …
book
Effective TypeScript
TypeScript is a typed superset of JavaScript with the potential to solve many of the headaches …