TypeScript 5.2 officially released

TypeScript 5.2 has been officially released.

5.2 New Features

TypeScript 5.2 implements an upcoming ECMAScript feature called decorator metadata. The key idea of ​​this feature is to make it easy for a decorator to create and use metadata on any class it uses.

Whenever decorator functions are used, they now have access to new  metadata properties of their context object. metadata Properties just contain a simple object. Since JavaScript allows us to add properties arbitrarily, it can be used as a dictionary that is updated by each decorator.

Alternatively, since each  metadata object is the same for each decorated part of the class, it can be used as  Map a key for . After all decorators on or in the class have run,  Symbol.metadata the object can be accessed via on the class.

Since the TypeScript 5.2 RC release, the documentation has added Copying Array Methods , symbols as WeakMap, WeakSetKeys  and  Clickable Inlay Parameter Hintsnamespace , as well as  an important change about always hinting keywords in declaration files  .

See the release announcement for details .

Guess you like

Origin www.oschina.net/news/255407/typescript-5-2