
Programming TypeScript
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Other editions
Additional editions

Person
Boris Cherny is a Software Engineer at Facebook and the organizer of the San Francisco TypeScript Meetup. A longtime JavaScript programmer and functional programming evangelist Boris has started several startups, and led engineering teams in adtech and venture capital. In his free time, you can find him working on open source on Github.
Content
- Cover
- Copyright
- Table of Contents
- Preface
- How This Book Is Organized
- Style
- Conventions Used in This Book
- Using Code Examples
- O'Reilly Online Learning
- How to Contact Us
- Acknowledgments
- Chapter 1. Introduction
- Chapter 2. TypeScript: A 10_000 Foot View
- The Compiler
- The Type System
- TypeScript Versus JavaScript
- Code Editor Setup
- tsconfig.json
- tslint.json
- index.ts
- Exercises
- Chapter 3. All About Types
- Talking About Types
- The ABCs of Types
- any
- unknown
- boolean
- number
- bigint
- string
- symbol
- Objects
- Intermission: Type Aliases, Unions, and Intersections
- Arrays
- Tuples
- null, undefined, void, and never
- Enums
- Summary
- Exercises
- Chapter 4. Functions
- Declaring and Invoking Functions
- Optional and Default Parameters
- Rest Parameters
- call, apply, and bind
- Typing this
- Generator Functions
- Iterators
- Call Signatures
- Contextual Typing
- Overloaded Function Types
- Polymorphism
- When Are Generics Bound?
- Where Can You Declare Generics?
- Generic Type Inference
- Generic Type Aliases
- Bounded Polymorphism
- Generic Type Defaults
- Type-Driven Development
- Summary
- Exercises
- Chapter 5. Classes and Interfaces
- Classes and Inheritance
- super
- Using this as a Return Type
- Interfaces
- Declaration Merging
- Implementations
- Implementing Interfaces Versus Extending Abstract Classes
- Classes Are Structurally Typed
- Classes Declare Both Values and Types
- Polymorphism
- Mixins
- Decorators
- Simulating final Classes
- Design Patterns
- Factory Pattern
- Builder Pattern
- Summary
- Exercises
- Chapter 6. Advanced Types
- Relationships Between Types
- Subtypes and Supertypes
- Variance
- Assignability
- Type Widening
- Refinement
- Totality
- Advanced Object Types
- Type Operators for Object Types
- The Record Type
- Mapped Types
- Companion Object Pattern
- Advanced Function Types
- Improving Type Inference for Tuples
- User-Defined Type Guards
- Conditional Types
- Distributive Conditionals
- The infer Keyword
- Built-in Conditional Types
- Escape Hatches
- Type Assertions
- Nonnull Assertions
- Definite Assignment Assertions
- Simulating Nominal Types
- Safely Extending the Prototype
- Summary
- Exercises
- Chapter 7. Handling Errors
- Returning null
- Throwing Exceptions
- Returning Exceptions
- The Option Type
- Summary
- Exercises
- Chapter 8. Asynchronous Programming, Concurrency, and Parallelism
- JavaScript's Event Loop
- Working with Callbacks
- Regaining Sanity with Promises
- async and await
- Async Streams
- Event Emitters
- Typesafe Multithreading
- In the Browser: With Web Workers
- In NodeJS: With Child Processes
- Summary
- Exercises
- Chapter 9. Frontend and Backend Frameworks
- Frontend Frameworks
- React
- Angular
- Typesafe APIs
- Backend Frameworks
- Summary
- Chapter 10. Namespaces.Modules
- A Brief History of JavaScript Modules
- import, export
- Dynamic Imports
- Using CommonJS and AMD Code
- Module Mode Versus Script Mode
- Namespaces
- Collisions
- Compiled Output
- Declaration Merging
- Summary
- Exercise
- Chapter 11. Interoperating with JavaScript
- Type Declarations
- Ambient Variable Declarations
- Ambient Type Declarations
- Ambient Module Declarations
- Gradually Migrating from JavaScript to TypeScript
- Step 1: Add TSC
- Step 2a: Enable Typechecking for JavaScript (Optional)
- Step 2b: Add JSDoc Annotations (Optional)
- Step 3: Rename Your Files to .ts
- Step 4: Make It strict
- Type Lookup for JavaScript
- Using Third-Party JavaScript
- JavaScript That Comes with Type Declarations
- JavaScript That Has Type Declarations on DefinitelyTyped
- JavaScript That Doesn't Have Type Declarations on DefinitelyTyped
- Summary
- Chapter 12. Building and Running TypeScript
- Building Your TypeScript Project
- Project Layout
- Artifacts
- Dialing In Your Compile Target
- Enabling Source Maps
- Project References
- Error Monitoring
- Running TypeScript on the Server
- Running TypeScript in the Browser
- Publishing Your TypeScript Code to NPM
- Triple-Slash Directives
- The types Directive
- The amd-module Directive
- Summary
- Chapter 13. Conclusion
- Appendix A. Type Operators
- Appendix B. Type Utilities
- Appendix C. Scoped Declarations
- Does It Generate a Type?
- Does It Merge?
- Appendix D. Recipes for Writing Declaration Files for Third-Party JavaScript Modules
- Types of Exports
- Globals
- ES2015 Exports
- CommonJS Exports
- UMD Exports
- Extending a Module
- Globals
- Modules
- Appendix E. Triple-Slash Directives
- Internal Directives
- Deprecated Directives
- Appendix F. TSC Compiler Flags for Safety
- Appendix G. TSX
- Index
- About the Author
- Colophon
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.