更新时间:2021-07-02 12:44:06
coverpage
Title Page
Copyright and Credits
Mastering TypeScript 3 Third Edition
About Packt
Why subscribe?
Packt.com
Contributors
About the author
About the reviewers
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
TypeScript Tools and Framework Options
What is TypeScript?
JavaScript and the ECMAScript Standard
The benefits of TypeScript
Compiling
Strong typing
TypeScript's syntactic sugar
Type definitions for popular JavaScript libraries
DefinitelyTyped
Encapsulation
TypeScript classes generate closures
Public and private accessors
TypeScript IDEs
Node-based compilation
Creating a tsconfig.json file
Localized messages
Visual Studio Code
Installing VSCode
Exploring VSCode
Creating a tasks.json file
Building the project
Creating a launch.json file
Setting breakpoints
Debugging web pages
Microsoft Visual Studio
Creating a Visual Studio project
Default project settings
Debugging in Visual Studio
WebStorm
Creating a WebStorm project
Default files
Building a simple HTML application
Running the web page in Chrome
Other editors
Using --watch and Grunt
Summary
Types Variables and Function Techniques
Basic types
JavaScript typing
TypeScript typing
Type syntax
Inferred typing
Duck typing
Template strings
Arrays
for...in and for...of
The any type
Explicit casting
Enums
Const enums
String enums
Enum implementation
Const values
The let keyword
Definite assignment
Dotted property types
Numeric separators
Functions
Function return types
Anonymous functions
Optional parameters
Default parameters
Rest parameters
Function callbacks
Function signatures
Function overrides
Try catch
Advanced types
Union types
Type guards
Type aliases
Null and undefined
Null operands
Never
Unknown
Object rest and spread
Spread precedence
Rest and spread with arrays
Tuples
Tuple destructuring