No Result
View All Result
CloudReports
  • Home
  • Linux
  • Web development
  • Javascript
  • SQL
  • Ant Design tutorial
  • QR Code Scanner
  • Home
  • Linux
  • Web development
  • Javascript
  • SQL
  • Ant Design tutorial
  • QR Code Scanner
No Result
View All Result
CloudReports
No Result
View All Result
Home Javascript

TypeScript 4.1 adopts literal template types

npn by npn
December 15, 2020
in Javascript
Reading Time: 3 mins read
0
TypeScript 4.1 adopts literal template types
0
SHARES
128
VIEWS
Share on FacebookShare on Twitter

Contents

  • 1 READ ALSO
  • 2 Configuring VS Code for Node/JavaScript Development
  • 3 How does Nodejs solve the problem of high concurrency?
  • 4 Other features
Rate this post

The template literal type or “template literals” has the same syntax as string literal types in JavaScript, except that it is used in type positions.

READ ALSO

Configuring VS Code for Node/JavaScript Development

Configuring VS Code for Node/JavaScript Development

August 2, 2021
809
How does Nodejs solve the problem of high concurrency?

How does Nodejs solve the problem of high concurrency?

July 18, 2021
888
TypeScript in version 14 provides literal types of templates. 
(Photo credit: TypeScript)

Now available in production, the TypeScript 4.1 update to Microsoft’s open-source language adds types to JavaScript. This latest version is enriched with literal types of templates and brings a large number of other improvements.

The type literal of the template has the same syntax as the type literal strings in JavaScript, except that it is used in such positions. When used with concrete literal types, a new string literal type s is produced by the concatenation of contents.

In addition to adding the literal types of templates, TypeScript 4.1 allows developers to rearrange the keys in the mapped types with a new as a clause. This new clause allows developers to take advantage of features like literal types in templates to create new property names based on the old ones. Keys can be filtered by producing never, which eliminates the need for developers to use an additional Omit helper type in some cases.

TypeScript 4.0, the current major release, was released in August.

ADVERTISEMENT

Other features

Other features of TypeScript 4.1 include  :

– L was able to use conditional recursive types  : some restrictions are eased for conditional types e t these can now be referenced immediately in their branches, which facilitates writing aliases recursive types. Microsoft specifies that recursive types should be used responsibly and sparingly. 

– A new flag – noUncheckedIndexedAccess provides a node where every property access or indexed access is considered potentially undefined. This flag can detect out-of-range errors but can create noise in a large number of codes. It is not automatically enabled by the –strict flag. 

– The paths option can be used without baseUrl , to avoid a problem created by bad paths used by auto-imports. 

– checkJs now implies allowJs , correcting a situation where starting a verified JavaScript project required both allowJs and checkJs , which caused friction.  

– The functions default jsx and jsxs the framework React 17 are supported by two new options to the s options react-jsx and react-jsxdev the compiler jsx . 

– JSDoc @ see tag now offers better editor support for JavaScript and TypeScript . 

– In a breaking change, members marked as abstract can no longer be marked as asynchronous. In another breakthrough change, the resolution settings are no longer optional in Promise.

TypeScript 4.1 is accessible via NuGet or via the NPM command  : npm install typescript . 

Paul Krill / IDG (adaptation Jean Elyan)

Tags: TypeScript
ShareTweetShare
Previous Post

51 free videos to learn JavaScript

Next Post

The story of migrating 70,000 lines of JavaScript code to TypeScript

npn

npn

Related Posts

Configuring VS Code for Node/JavaScript Development
Javascript

Configuring VS Code for Node/JavaScript Development

August 2, 2021
809
How does Nodejs solve the problem of high concurrency?
Javascript

How does Nodejs solve the problem of high concurrency?

July 18, 2021
888
Npm module: a backdoor and ambush questions
Javascript

Npm module: a backdoor and ambush questions

December 16, 2020
191
NPM: three packets contained malicious code
Javascript

NPM: three packets contained malicious code

December 16, 2020
73
25 years of JavaScript: the programming language that makes the world go round
Javascript

25 years of JavaScript: the programming language that makes the world go round

December 16, 2020
226
The story of migrating 70,000 lines of JavaScript code to TypeScript
Javascript

The story of migrating 70,000 lines of JavaScript code to TypeScript

December 15, 2020
280
Next Post
The story of migrating 70,000 lines of JavaScript code to TypeScript

The story of migrating 70,000 lines of JavaScript code to TypeScript

Discussion about this post

No Result
View All Result

Categories

  • Android (1)
  • Ant Design tutorial (7)
  • App/Game (2)
  • Javascript (16)
  • Layout and Routing (2)
  • Linux (9)
  • PC & LAPTOP (6)
  • PERSONAL FINANCES (1)
  • React (13)
  • SQL (2)
  • TECHNOLOGY & DIGITAL (7)
  • The Basics (5)
  • Web development (37)

Search

No Result
View All Result

Categories

  • Android (1)
  • Ant Design tutorial (7)
  • App/Game (2)
  • Javascript (16)
  • Layout and Routing (2)
  • Linux (9)
  • PC & LAPTOP (6)
  • PERSONAL FINANCES (1)
  • React (13)
  • SQL (2)
  • TECHNOLOGY & DIGITAL (7)
  • The Basics (5)
  • Web development (37)
No Result
View All Result
  • Home
  • Linux
  • Web development
  • Javascript
  • SQL
  • Ant Design tutorial
  • QR Code Scanner