Best common type When a type inference is made from several expressions, the types of those expressions are used to calculate a “best common
Dependencies All dependencies are managed by npm. Make sure all the declaration packages you depend on are marked appropriately in the
Polymorphic this types A polymorphic this type represents a type that is the subtype of the containing class
Write some code Let’s write our first TypeScript file using React. First, create a file named Hello.tsx in src/components
Private and protected members in classes Private and protected members in a class affect their compatibility. When an instance of a class is
Using Modules Just like namespaces, modules can contain both code and declarations. The main difference is that modules declare their
Functions with overloads When a function has overloads, each overload in the source type must be matched by a compatible signature on the target
Decorator Composition Multiple decorators can be applied to a declaration, as in the following examples:
typeof type guards Let’s go back and write the code for the version of padLeft that uses union types. We could write
Add a CopyFiles target to the build Finally, we need to make sure that the Angular files are copied as part of the build. To do this, edit the
Page 14 of 29