TypeScript - Mapped Types

preview_player
Показать описание
In this episode I talk about the Mapped Types in TypeScript.
00:05 What are Mapped Types?
01:17 Readonly Mapped Type example
02:26 Mapped Type syntax explained
03:15 Generic Readonly Mapped Type example
04:17 Generic Partial Mapped Type example
05:03 Combining Mapped Types
05:26 Generic Nullable Mapped Type example
06:42 Proxy Mapped Type example
08:04 Included Mapped Types in TypeScript

You can see all the code here:

Index Types Operators:

Learn TypeScript:
Рекомендации по теме
Комментарии
Автор

Let me know what would you like me to talk about, it can be anything as long as it is programming related

ProgramArtist
Автор

Wow! Finally found an advanced tutorial for TS. So tired of beginner ones.

undeadspez
Автор

the best typescript video ever! thank you very much for this great video!

alisawari
Автор

As far as I understand it, this is a type transform operator. Each of the "Mapped Types" would in JavaScript terminology be a function, which accepts type as argument, which is then used to create a new type, which is then returned. For example an JavaScript equivalent would look like this:
function ReadOnly(InputType) {
let NewType = {};
foreach(key in inputType) {
NewType[key] = readonly InputType[key];
}
return(NewType);
}

IMGO TypeScript goes against the usual logic of the JavaScript language ... or even TypeScript - it's a language of it's own right!

nderezic