Loading topic
string, number, boolean, arrays). It also assumes you know JavaScript objects, functions, and classes, and that you can run the compiler or use an editor that reports type errors. You should have seen interfaces in the previous c5 min readstrict mode. Two modifiers change what a property means in a shape: ? makes a property optional, and readonly makes it unassignable after the object is created. Bot4 min readkeyof and basic object types work. It covers index signatures, which describe objects whose property names are not known ahead of time.5 min read& builds a new type from several existing ones, how it compares with extends, and which errors appear when the combined types conflict. It assumes you can write basic type annotations, you know how interfaces and type aliases declare object shapes, and6 min readtsc or read editor errors. Declaration merging is one of the few places where an interface can do something a type alias cannot.5 min readimplements does, what it does not do, and the errors people hit most often.4 min readfunction identity<T>(x: T): T. Here you apply the same idea to named types.5 min readBox<T>. You do not need to know mapped types in detail. The next chapter covers them, and this one only uses them as the mechanism behind t4 min readPartial, Pick, Omit, and Readonly. Here you will build the mechanism behind those utilities: the mapped type. By the end you should be able to write your own, read t6 min readinterface and type, optional and readonly properties, unions, intersections, generics, and implements. Here the focus is on deciding which one to use, and on the cases where the choice changes behavior.5 min read