A TypeScript diagram is a drawing of two things: the shapes values can have, and the paths they take between those shapes. Read it the way you read a map — find the border first, then trace a single route — instead of trying to memorise every symbol at once.
Start with the whole shape
Before reading any label, notice the outer boundary. A single box is one type. Boxes joined by a line are a union or a composition. An arrow between boxes is a function or a transformation. The outer structure tells you what the diagram produces, which is usually the thing you came for.
If you cannot say what the diagram outputs in one sentence, you are reading details too early.
Ask what the drawing is for before asking what it contains. A diagram made to explain a data model reads differently from one made to explain a sequence of transformations, and knowing which kind you have prevents a lot of misreading.
Trace one value through the picture
Pick a concrete value, the simplest one the diagram permits, and follow it from left to right. At each arrow, ask what shape it has going in and coming out. Where a branch appears, ask what condition decides the direction.
Tracing one path successfully teaches more than staring at the whole drawing, and it exposes the places where the diagram quietly skips a step.
Treat names as claims to verify
Labels like payload, options, or result are promises made by whoever drew the diagram. Open the type definition and check the fields. Diagrams age, and a renamed property is invisible in a drawing that was correct a year ago.
When a name and a shape disagree, the shape is the truth. Rename the label in your own notes so the next reading is honest.
The patterns that keep reappearing
- Optional wrapper: a value or nothing, with a check before use.
- Tagged union: a shared tag plus a payload, narrowed by switching on the tag.
- Mapper: one shape in, another out, often typed with a record of keys.
- Builder: each method returns the same type, so calls chain.
- Adapter: an external shape converted into your own at the boundary.
Recognising five patterns covers most diagrams you will meet in library documentation, and each one becomes faster on the second sight.
When the drawing and the code disagree
The code wins. Diagrams are documentation, and documentation drifts. Check the version the drawing was made against, then decide whether the drawing is stale or the code has a bug. Both happen, and the difference matters.
To practice, take a library you use, find a function signature, and draw it yourself before reading the documentation. The gaps in your sketch are precisely the concepts you have not internalised yet, and the fifth diagram is much faster than the first.
Keep your corrected sketch beside the original for a week. The difference between the two is a fair measure of what you learned, and it is more honest than a feeling of understanding.