0'

Dr. Axel Rauschmayer

Tackling

TypeScript

Upgrading from JavaScript

2

Tackling TypeScript

Dr. Axel Rauschmayer

2021

Copyright ? 2021 by Dr. Axel Rauschmayer

All rights reserved. This book or any portion thereof may not be reproduced or used in

any manner whatsoever without the express written permission of the publisher except

for the use of brief quotations in a book review or scholarly journal.



Contents

I

Preliminaries

5

1

About this book

1.1 Where is the homepage of this book?

1.2 What is in this book? . . . . . . . . .

1.3 What do I get for my money? . . . .

1.4 How can I preview the content? . . .

1.5 How do I report errors? . . . . . . . .

1.6 What do the notes with icons mean? .

1.7 Acknowledgements . . . . . . . . . .

.

.

.

.

.

.

.

7

7

7

7

8

8

8

9

2

Why TypeScript?

2.1 The bene?ts of using TypeScript . . . . . . . . . . . . . . . . . . . . . . .

2.2 The downsides of using TypeScript . . . . . . . . . . . . . . . . . . . . .

2.3 TypeScript myths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11

11

13

13

3

Free resources on TypeScript

15

II

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

Getting started with TypeScript

17

4

How does TypeScript work? The birds eye view

4.1 The structure of TypeScript projects . . . . . . . . . . . . . . . . . . . . .

4.2 Programming TypeScript via an integrated development environment (IDE)

4.3 Other ?les produced by the TypeScript compiler . . . . . . . . . . . . . .

4.4 Using the TypeScript compiler for plain JavaScript ?les . . . . . . . . . .

19

19

20

21

22

5

Trying out TypeScript

5.1 The TypeScript Playground . . . . . . . . . . . . . . . . . . . . . . . . .

5.2 TS Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

23

23

23

6

Notation used in this book

6.1 Test assertions (dynamic) . . . . . . . . . . . . . . . . . . . . . . . . . . .

6.2 Type assertions (static) . . . . . . . . . . . . . . . . . . . . . . . . . . . .

25

25

26

7

The essentials of TypeScript

7.1 What youll learn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.2 Specifying the comprehensiveness of type checking . . . . . . . . . . . .

27

28

28

3

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

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

Google Online Preview   Download