You are previewing TypeScript Essentials.
O'Reilly logo
TypeScript Essentials

Book Description

Develop large scale responsive web applications with TypeScript

In Detail

Web applications work on a range of different devices, making them one of the most common ways in which users experience the web today. However, while the flexibility of web apps are great for users, for developers creating them with JavaScript, the process can be difficult, requiring more extensive and detailed coding work. TypeScript helps make the development of web apps easier, allowing you to quickly create scalable applications that will reach desktops, tablets, and mobiles. With TypeScript, your code becomes much more manageable and your work much more efficient. Its additional features, such as static typing, facilitate IDE support and further tooling.

This quick and insightful guide will provide you with an easy way into TypeScript. You will discover the features of the TypeScript language and gain hands-on experience in creating a web application with reusable components. You will explore the compiler and learn how to manipulate the resulting output to fit specific needs.

What You Will Learn

  • Set up the environment to install the TypeScript compiler and development tools
  • Explore the features of the TypeScript language such as type annotations, interfaces, classes, and modules
  • Examine the JavaScript code that has been generated by the compiler
  • Create modular code that can be reused again and again
  • Develop an interactive web application that can be easily extended
  • Integrate with common JavaScript libraries to ease development
  • Improve performance and reduce network traffic
  • Focus on creating reliable code through test-driven development
  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at If you purchased this book elsewhere, you can visit and register to have the files e-mailed directly to you.

    Table of Contents

    1. TypeScript Essentials
      1. Table of Contents
      2. TypeScript Essentials
      3. Credits
      4. About the Author
      5. About the Reviewers
        1. Support files, eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Getting Started with TypeScript
        1. The advantages of TypeScript
        2. Setting up the IDE
        3. Hello World
          1. Command-line compilation
          2. Integrating Visual Studio
          3. Creating a new project
          4. Build options
        4. Summary
      9. 2. TypeScript Basics
        1. Types
        2. Functions
        3. Interfaces
        4. Classes
          1. Definitions
        5. Interfaces
          1. Static and instance members
          2. Properties
        6. Enums
        7. Modules
          1. Internal modules
        8. Generic objects
        9. Summary
      10. 3. The TypeScript Compiler
        1. Generation of ECMAScript
          1. ECMAScript version
          2. Code manipulation
        2. Controlling compiler output
          1. JavaScript output
          2. Source maps
        3. Advanced options
        4. Summary
      11. 4. Object-oriented Programming with TypeScript
        1. The basics
          1. SOLID – object-oriented design
        2. Understanding inheritance
        3. Encapsulation
        4. Abstraction
        5. Polymorphism
          1. Method overloading
          2. Operator overloading
          3. Method overrides
        6. References
        7. Summary
      12. 5. Creating a Simple Drawing Application
        1. Setting up the project
        2. The shapes
          1. Basic shapes
          2. Drawing shapes
        3. Making the application interactive
          1. The engine
          2. Mouse events
          3. User options
        4. Summary
      13. 6. Declaration Files and Library Integrations
        1. Declaration files
        2. Third-party library integration
          1. Installing NuGet packages
          2. Integrating with jQuery
          3. Integrating with Knockout
          4. Using RequireJS
        3. Summary
      14. 7. Enhancing the Drawing Application
        1. Converting to AMD modules
        2. Binding the user controls
          1. Reusable controls
          2. Creating a ViewModel
        3. Generating a single output file
        4. Styling the application
        5. Summary
      15. 8. Debugging TypeScript
        1. Debugging
          1. Source maps
          2. Debuggers
        2. Test-driven development
          1. Unit testing
          2. Adding tests
        3. Summary
      16. Index