Table of Contents - React, etc

[Pages:334] Table of Contents

Introduction Getting Started

Why TypeScript JavaScript

Equality References Null vs. Undefined this Closure Number Future JavaScript Now Classes

Classes Emit Arrow Functions Rest Parameters let const Destructuring Spread Operator for...of Iterators Template Strings Promise Generators Async Await Project Compilation Context

tsconfig.json Which Files? Declaration Spaces

1.1 1.2 1.2.1 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.4 1.4.1 1.4.1.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.4.10 1.4.11 1.4.12 1.4.13 1.5 1.5.1 1.5.1.1 1.5.1.2 1.5.2

2

Modules File Module Details globals.d.ts

Namespaces Dynamic Import Expressions Node.js QuickStart Browser QuickStart TypeScript's Type System JS Migration Guide @types Ambient Declarations

Declaration Files Variables Interfaces Enums lib.d.ts Functions Callable Type Assertion Freshness Type Guard Literal Types Readonly Generics Type Inference Type Compatibility Never Type Discriminated Unions Index Signatures Moving Types Exception Handling Mixins JSX Options

1.5.3 1.5.3.1 1.5.3.2

1.5.4 1.5.5

1.6 1.7 1.8 1.8.1 1.8.2 1.8.3 1.8.3.1 1.8.3.2 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.8.10 1.8.11 1.8.12 1.8.13 1.8.14 1.8.15 1.8.16 1.8.17 1.8.18 1.8.19 1.8.20 1.8.21 1.8.22 1.9 1.10

3

noImplicitAny strictNullChecks Testing Jest TIPs String Based Enums Nominal Typing Stateful Functions Bind is Bad Currying Type Instantiation Lazy Object Literal Initialization Classes are Useful Avoid Export Default Limit Property Setters null is bad outFile caution JQuery tips static constructors singleton pattern Function parameters Truthy Build Toggles Barrel Create Arrays Typesafe Event Emitter StyleGuide Common Errors TypeScript Compiler Internals Program AST

TIP: Visit Children TIP: SyntaxKind enum

1.10.1 1.10.2

1.11 1.11.1

1.12 1.12.1 1.12.2 1.12.3 1.12.4 1.12.5 1.12.6 1.12.7 1.12.8 1.12.9 1.12.10 1.12.11 1.12.12 1.12.13 1.12.14 1.12.15 1.12.16 1.12.17 1.12.18 1.12.19 1.12.20 1.12.21

1.13 1.14 1.15 1.15.1 1.15.2 1.15.2.1 1.15.2.2

4

Trivia Scanner Parser

Parser Functions Binder

Binder Functions Binder Declarations Binder Container Binder SymbolTable Binder Error Reporting Checker Checker Diagnostics Checker Error Reporting Emitter Emitter Functions Emitter SourceMaps Contributing

1.15.2.3 1.15.3 1.15.4

1.15.4.1 1.15.5

1.15.5.1 1.15.5.2 1.15.5.3 1.15.5.4 1.15.5.5

1.15.6 1.15.6.1 1.15.6.2

1.15.7 1.15.7.1 1.15.7.2

1.15.8

5

Introduction

TypeScript Deep Dive

I've been looking at the issues that turn up commonly when people start using TypeScript. This is based on the lessons from Stack Overflow / DefinitelyTyped and general engagement with the TypeScript community. You can follow for updates and don't forget to on GitHub

Reviews

Thanks for the wonderful book. Learned a lot from it. (link) Its probably the Best TypeScript book out there. Good Job (link) Love how precise and clear the examples and explanations are! (link) For the low, low price of free, you get pages of pure awesomeness. Chock full of source code examples and clear, concise explanations, TypeScript Deep Dive will help you learn TypeScript development. (link) Just a big thank you! Best TypeScript 2 detailed explanation! (link) This gitbook got my project going pronto. Fluent easy read 5 stars. (link) I recommend the online #typescript book by @basarat you'll love it.(link) I've always found this by @basarat really helpful. (link) We must highlight TypeScript Deep Dive, an open source book.(link) Great online resource for learning. (link) Thank you for putting this book together, and for all your hard work within the TypeScript community. (link) TypeScript Deep Dive is one of the best technical texts I've read in a while. (link) Thanks @basarat for the TypeScript Deep Dive Book. Help me a lot with my first TypeScript project. (link) Thanks to @basarat for this great #typescript learning resource. (link) Guyz excellent book on Typescript(@typescriptlang) by @basarat (link) Leaning on the legendary @basarat's "TypeScript Deep Dive" book heavily at the moment (link) numTimesPointedPeopleToBasaratsTypeScriptBook++; (link) A book not only for typescript, a good one for deeper javascript knowledge as well. link In my new job, we're using @typescriptlang, which I am new to. This is insanely helpful huge thanks, @basarat! link Thank you for writing TypeScript Deep Dive. I have learned so much. link Loving @basarat's @typescriptlang online book basarat.gitbooks.io/typescript/# loaded with great recipes! link Microsoft doc is great already, but if want to "dig deeper" into TypeScript I find this book

6

Introduction of great value link Thanks, this is a great book link Deep dive to typescript is awesome in so many levels. i find it very insightful. Thanks link @basarat's intro to @typescriptlang is still one of the best going (if not THE best) link

Get Started

If you are here to read the book online get started.

Other Options

You can also download one of the following: EPUB for iPad, iPhone, Mac PDF for Windows and others MOBI for Kindle

Special Thanks

All the amazing contributors

Share

Share URL:

7

Getting Started

Getting Started with TypeScript TypeScript Version

Getting Started With TypeScript

TypeScript compiles into JavaScript. JavaScript is what you are actually going to execute (either in the browser or on the server). So you are going to need the following:

TypeScript compiler (OSS available in source and on NPM) A TypeScript editor (you can use notepad if you want but I use alm IDES support it as well)

. Also lots of other

TypeScript Version

Instead of using the stable TypeScript compiler we will be presenting a lot of new stuff in this book that may not be associated with a version number yet. I generally recommend people to use the nightly version because the compiler test suite only catches more bugs over time. You can install it on the command line as

npm install -g typescript@next

8

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download