Decorators, an upcoming feature of ECMAScript, allow you to customize classes and their members in a reusable way. Blog post announcing the release. Decorators can be used on methods, properties, getters, setters, and automatic accessors. Classes can be decorated for subclassing and registration. TypeScript previously supported experimental decorators, but these were modeled after a much older version of the decorator proposal.
Also, in TypeScript 5.0, developers can
const A modifier to a causative type parameter declaration
consInference like t is the default. With this update,
extends Use fields to get multiple entries, create a unique type for each calculated member, and make all enums union enums. This means you can narrow down any enum and refer to its members as types.
TypeScript 5.0 Beta includes NuGet Or run the following command:
npm install typescript@beta
Also, in TypeScript 5.0:
- Improved support for ESM (ECMAScript Module) projects in Node and bundler.
–-verbatimModuleSyntaxThe feature simplifies imports and exports and allows you to maintain imports or exports.
typewhen you drop something with a modifier
- new JSDoc tags,
- Correctness changes and deprecations are provided for less frequently used flags.
- TypeScript is now a target ECMAScript 2018For Node users, this means a minimum version requirement of at least Node.js 10.
Copyright © 2023 IDG Communications, Inc.
https://www.infoworld.com/article/3686509/typescript-50-retools-decorators.html#tk.rss_all TypeScript 5.0 Rebuilds Decorators | Infoworld