Typescript 4.1: Template literal types, computed property names, and more
Typescript 4.1 adds support for
template literal types
. This, along with the new utility types, unlocks computed property names, simple getter-setter interfaces and more.
typeFoo='a'|'b'|'c';// Bar = 'a-template' | 'b-template' | 'c-template'typeBar=`${Foo}-template`;
In addition, a number of new utility types have been introduced: