TypeScript 4.1 comes filled with new options

by admin

The most recent model of Microsoft’s programming language TypeScript is now obtainable. TypeScript 4.1 launched various new options, resembling template literal varieties, key remapping in mapped varieties, and recursive conditional varieties.

String literal varieties enable builders to mannequin features which count on a selected set of strings. Template literal strings can be utilized to supply a brand new string literal kind. 

TypeScript 4.1 additionally introduces the power to re-map keys in mapped varieties with new “as” clause. This permits builders to make the most of options resembling template literal varieties to create property names primarily based off of outdated ones, Microsoft defined. 

This launch additionally removes sure restrictions on conditional varieties. Now they will instantly reference themselves inside their branches. This makes it simpler to put in writing recursive kind aliases, the corporate defined. 

Different new options embrace –noUncheckedIndexedAccess, paths without baseUrl, checkJs Implies allowJs, React 17 JSX Factories, and Editor Support for the JSDoc @see Tag.

Related Posts

Leave a Comment