3 ms·
You only really need super complicated types to represent existing very-dynamic javascript libraries. If you're starting from scratch typescript is as easy and/
by overgard 4y ago
You only really need super complicated types to represent existing very-dynamic javascript libraries. If you're starting from scratch typescript is as easy and/or easier than javascript. If you do have incredibly complicated types, it might be a sign that you have a bad design. At work most of the typescript libraries I wrote just ended up using interfaces and enumerated strings and occasionally a union type. Sometimes I'd use "never" to prevent certain things, but I can't say the types ever had to get much more complex than that.