Programming TypeScript : Making Your JavaScript Applications Scale

個数:

Programming TypeScript : Making Your JavaScript Applications Scale

  • 提携先の海外書籍取次会社に在庫がございます。通常2週間で発送いたします。
    重要ご説明事項
    1. 納期遅延や、ご入手不能となる場合が若干ございます。
    2. 複数冊ご注文の場合、分割発送となる場合がございます。
    3. 美品のご指定は承りかねます。

  • 提携先の海外書籍取次会社に在庫がございます。通常約2週間で発送いたします。
    重要ご説明事項
    1. 納期遅延や、ご入手不能となる場合が若干ございます。
    2. 複数冊ご注文の場合、分割発送となる場合がございます。
    3. 美品のご指定は承りかねます。
  • 【重要:入荷遅延について】
    各国での新型コロナウィルス感染拡大により、洋書・洋古書の入荷が不安定になっています。
    弊社サイト内で表示している標準的な納期よりもお届けまでに日数がかかる見込みでございます。
    申し訳ございませんが、あらかじめご了承くださいますようお願い申し上げます。

  • 製本 Paperback:紙装版/ペーパーバック版/ページ数 302 p.
  • 言語 ENG
  • 商品コード 9781492037651
  • DDC分類 005.2762

Full Description


Any programmer working in a dynamically typed language will tell you how hard it is to scale that language to more lines of code and to more engineers. That's why Facebook, Google, and Microsoft invented gradual static type layers for their dynamically typed JavaScript and Python code. TypeScript is one such type layer, and does something unique among them: it makes programming fun with its powerful, modern, static type system. With this book, programmers who understand JavaScript at an intermediate level will learn how to master the TypeScript language. You'll understand how TypeScript can help you get rid of bugs in your code, scale your code across 10x more engineers, and make programming fun again.

Table of Contents

Preface                                            xi
1 Introduction 1 (4)
2 TypeScript: A 10_000 Foot View 5 (12)
The Compiler 5 (2)
The Type System 7 (4)
TypeScript Versus JavaScript 8 (3)
Code Editor Setup 11 (2)
Tsconfig.json 11 (2)
Tslint.json 13 (1)
Index.ts 13 (2)
Exercises 15 (2)
3 All About Types 17 (28)
Talking About Types 18 (1)
The ABCs of Types 19 (24)
Any 19 (1)
Unknown 20 (1)
Boolean 21 (1)
Number 22 (1)
Bigint 23 (1)
String 23 (1)
Symbol 24 (1)
Objects 25 (5)
Intermission: Type Aliases, Unions, and 30 (3)
Intersections
Arrays 33 (2)
Tuples 35 (2)
Null, undefined, void, and never 37 (2)
Enums 39 (4)
Summary 43 (1)
Exercises 44 (1)
4 Functions 45 (38)
Declaring and Invoking Functions 45 (20)
Optional and Default Parameters 47 (1)
Rest Parameters 48 (2)
Call, apply, and bind 50 (1)
Typing this 50 (2)
Generator Functions 52 (1)
Iterators 53 (2)
Call Signatures 55 (3)
Contextual Typing 58 (1)
Overloaded Function Types 59 (6)
Polymorphism 65 (15)
When Are Generics Bound? 69 (1)
Where Can You Declare Generics? 70 (2)
Generic Type Inference 72 (1)
Generic Type Aliases 73 (2)
Bounded Polymorphism 75 (4)
Generic Type Defaults 79 (1)
Type-Driven Development 80 (1)
Summary 81 (1)
Exercises 82 (1)
5 Classes and Interfaces 83 (30)
Classes and Inheritance 83 (6)
Super 89 (1)
Using this as a Return Type 89 (2)
Interfaces 91 (6)
Declaration Merging 93 (1)
Implementations 94 (2)
Implementing Interfaces Versus 96 (1)
Extending Abstract Classes
Classes Are Structurally Typed 97 (1)
Classes Declare Both Values and Types 98 (2)
Polymorphism 100(1)
Mixins 101(3)
Decorators 104(3)
Simulating final Classes 107(1)
Design Patterns 108(2)
Factory Pattern 108(1)
Builder Pattern 109(1)
Summary 110(1)
Exercises 111(2)
6 Advanced Types 113(46)
Relationships Between Types 114(16)
Subtypes and Supertypes 114(1)
Variance 115(6)
Assignability 121(1)
Type Widening 122(4)
Refinement 126(4)
Totality 130(2)
Advanced Object Types 132(9)
Type Operators for Object Types 132(5)
The Record Type 137(1)
Mapped Types 137(3)
Companion Object Pattern 140(1)
Advanced Function Types 141(2)
Improving Type Inference for Tuples 141(1)
User-Defined Type Guards 142(1)
Conditional Types 143(4)
Distributive Conditionals 144(1)
The infer Keyword 145(1)
Built-in Conditional Types 146(1)
Escape Hatches 147(5)
Type Assertions 148(1)
Nonnull Assertions 149(2)
Definite Assignment Assertions 151(1)
Simulating Nominal Types 152(2)
Safely Extending the Prototype 154(2)
Summary 156(1)
Exercises 157(2)
7 Handling Errors 159(14)
Returning null 160(1)
Throwing Exceptions 161(2)
Returning Exceptions 163(2)
The Option Type 165(6)
Summary 171(1)
Exercises 172(1)
8 Asynchronous Programming, Concurrency, 173(26)
and Parallelism
JavaScript's Event Loop 174(2)
Working with Callbacks 176(2)
Regaining Sanity with Promises 178(5)
Async and await 183(1)
Async Streams 184(3)
Event Emitters 184(3)
Typesafe Multithreading 187(10)
In the Browser: With Web Workers 187(9)
In NodeJS: With Child Processes 196(1)
Summary 197(1)
Exercises 198(1)
9 Frontend and Backend Frameworks 199(16)
Frontend Frameworks 199(11)
React 201(6)
Angular 6/7 207(3)
Typesafe APIs 210(2)
Backend Frameworks 212(1)
Summary 213(2)
10 Namespaces.Modules 215(14)
A Brief History of JavaScript Modules 216(2)
Import, export 218(4)
Dynamic Imports 219(2)
Using CommonJS and AMD Code 221(1)
Module Mode Versus Script Mode 222(1)
Namespaces 222(4)
Collisions 225(1)
Compiled Output 225(1)
Declaration Merging 226(2)
Summary 228(1)
Exercise 228(1)
11 Interoperating with JavaScript 229(20)
Type Declarations 230(6)
Ambient Variable Declarations 233(1)
Ambient Type Declarations 234(1)
Ambient Module Declarations 235(1)
Gradually Migrating from JavaScript to 236(6)
TypeScript
Step 1 Add TSC 237(1)
Step 2a Enable Typechecking for 238(1)
JavaScript (Optional)
Step 2b Add JSDoc Annotations (Optional) 239(1)
Step 3 Rename Your Files to .ts 240(1)
Step 4 Make It strict 241(1)
Type Lookup for JavaScript 242(2)
Using Third-Party JavaScript 244(3)
JavaScript That Comes with Type 245(1)
Declarations
JavaScript That Has Type Declarations 245(1)
on DefinitelyTyped
JavaScript That Doesn't Have Type 246(1)
Declarations on DefinitelyTyped
Summary 247(2)
12 Building and Running TypeScript 249(18)
Building Your TypeScript Project 249(9)
Project Layout 249(1)
Artifacts 250(1)
Dialing In Your Compile Target 251(4)
Enabling Source Maps 255(1)
Project References 255(3)
Error Monitoring 258(1)
Running TypeScript on the Server 258(1)
Running TypeScript in the Browser 259(2)
Publishing Your TypeScript Code to NPM 261(1)
Triple-Slash Directives 262(3)
The types Directive 262(2)
The amd-module Directive 264(1)
Summary 265(2)
13 Conclusion 267(24)
A Type Operators 269(2)
B Type Utilities 271(2)
C Scoped Declarations 273(2)
D Recipes for Writing Declaration Files 275(8)
for Third-Party JavaScript Modules
E Triple-Slash Directives 283(2)
F TSC Compiler Flags for Safety 285(2)
G TSX 287(4)
Index 291