A Type System Built Around JavaScript
TypeScript allows developers to describe the shapes of objects, the values accepted by functions, the results returned by operations, and the relationships between different parts of an application. Developers can use types without needing to replace JavaScript's familiar programming model. For example, an application may describe a customer record with required identification fields and optional contact information. When another component attempts to access information that the type does not contain, the compiler can report a mismatch. The same approach applies to application configuration, supplier responses, transaction records, authorization contexts, and reusable services.
TypeScript also provides type inference. Developers do not need to annotate every variable because the checker can often determine its type from the surrounding code. This balance between explicit declarations and inference is important. Excessive annotations can make code harder to maintain, while insufficiently defined boundaries can allow incorrect assumptions to spread. The TypeScript everyday types documentation explains common types, inference, unions, literal values, and optional properties.


