MasteringTypeScript - (EPUB全文下载)
文件大小:4.37 mb。
文件格式:epub 格式。
书籍内容:
Mastering TypeScript
Table of Contents
Mastering TypeScript
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. TypeScript – Tools and Framework Options
What is TypeScript?
EcmaScript
The benefits of TypeScript
Compiling
Strong Typing
TypeScript's "syntactic sugar"
Type definitions for popular JavaScript libraries
Definitely Typed
Encapsulation
TypeScript classes generate closures
Public and private accessors
TypeScript IDEs
Visual Studio 2013
Creating a Visual Studio Project
Default project settings
Debugging in Visual Studio
WebStorm
Creating a WebStorm project
Default files
Running the web page in Chrome
Debugging in Chrome
Brackets
Installing Brackets
Creating a Brackets project
Using Brackets live preview
Creating a TypeScript file
Compiling our TypeScript
Using Grunt
Debugging in Chrome
Summary
2. Types, Variables and Function Techniques
Basic types
JavaScript is not strongly typed
TypeScript is strongly typed
Type syntax
Inferred typing
Duck-typing
Arrays
The any type
Explicit casting
Enums
Const enums
Functions
Anonymous functions
Optional parameters
Default parameters
The arguments variable
Function callbacks
Function signatures
Function callbacks and scope
Function overloads
Union types
Type guards
Type aliases
Summary
3. Interfaces, Classes and Generics
Interfaces
Classes
Class constructors
Class functions
Interface function definitions
Inheritance
Interface inheritance
Class inheritance
Function and constructor overloading with super
JavaScript closures
The Factory Design Pattern
Business requirements
What the Factory Design Pattern does
The IPerson interface and the Person base class
Specialist classes
The Factory class
Using the Factory class
Class modifiers
Constructor access modifiers
Class property accessors
Static functions
Static properties
Generics
Generic syntax
Instantiating generic classes
Using the type T
Constraining the type of T
Generic interfaces
Creating new objects within generics
Runtime type checking
Reflection
Checking an object for a function
Interface checking with generics
Summary
4. Writing and Using Declaration Files
Global variables
Using JavaScript code blocks in HTML
Struc ............
书籍插图:
以上为书籍内容预览,如需阅读全文内容请下载EPUB源文件,祝您阅读愉快。
书云 Open E-Library » MasteringTypeScript - (EPUB全文下载)