The purpose of TypeScript
Without a doubt, the most important feature in TypeScript is the Type system. The language supports various systems that include: Boolean – simple true or false values, Floating Point Value numbers with no integers and it supports decimal, hexadecimal, binary & octal literals, String of text data, Arrays and Tuples, Enums, Arbitrary variables, Object Type which is not primitive, and Code Snippet Types among others. TypeScript types get set by inferences as well.
The interfaces of TypeScript allow the users to define their own types. Here, an interface establishes the properties of an object and all the types associated with properties. TypeScript shares its generics with object-oriented languages like Java and C#. In object-oriented programming, classes inherit functionality and act as building blocks of objects. Classes are a part of TypeScript and it uses the same syntax as JS. TypeScript has many versions until now.
TypeScript 5.0 Retools Decorators
Information shows that the decorators, an upcoming ECMAScript Feature allow for customizing classes and the associated members in a very reusable way. This is how Microsoft noted in a blog post announcing the release of TypeScript 5.0. The decorators get used on various methods, properties, getters, setters, and auto accessors. The classes get decorated for sub-classing and registration purposes.
Previously, TypeScript supported several experimental decorators, which were modeled on a much older version of the proposals for the decorators. In TypeScript 5.0, the programmers and developers have provisions to add a const modifier to a type parameter declaration. It helps to cause const-like inferences to become default ones.
The latest update allows the extends field to take multiple entries as it makes all Enums into union ones by creating a unique type for each computed member. Thus, all Enums get narrowed with their members referred or referenced as types.
Thus, overall, TypeScript 5.0 gets designed to make the language smaller, faster, and simpler as mentioned before.
A release candidate of an extension to TypeScript 5.0 is expected on February 28, 2023, followed by general availability of a production release on March 14, 2023.
Features of TypeScript 5.0