Typeof Keyword, and Type Level
0:00 I spoke to Gabriel Vergnaud about the experience of him building his course, which is Type-Level TypeScript, and what he learned along the way.
0:46 Show how those things map together so that other people could realize that and make this shift of perspective that will help them solve their typing issues and build a more robust mental model for the type system.
1:02 That's really interesting that you talk about the type level and the value level. That's the terms you use. Let's say we take the type of keyword in TypeScript. Is it right to say that it can take something from the value level and turn it into or bring it to the type level?
1:17 How would you explain that?
1:19 That's exactly true. Those two worlds, the world of types and the world of values, for the most part, they are separate. You can't really cross this boundary, but there is one way and one direction in which you can cross the boundary.
1:33 It's going from the value level to the type level, and that's called type inference. That's what TypeScript does all the time. You declare an object type and it has like two fields, a name and an age property, for instance, which are respectively a string and a number.
1:48 TypeScript is going to be able to infer the type of your object for you. It's going to lift this object that you created from the value level to the type level. That's what the type of keywords does.