-
Playing with naturals in TypeScript -
Introduction of Template Literal Types in TypeScript 4.1 makes the type system even more interesting. They are like template literals, but on the type level (a template literal type with a placeholder), so we can write code like this: ```typescript type SizeUnit = ‘px’ | ‘pt’ | ‘em’ | ‘rem’
-
Programming in TypeScript types with tuples -
The TypeScript type system has become increasingly powerful, allowing us to create very complex types today. In fact it’s already shown to be Turing complete. Many advanced utilities, including manipulation of object, list and function types can be found in the ts-toolbelt library. Here I make a quick recap of some of the more advanced TypeScript features and then give a little introduction on how to use them to manipulate tuples like array values, but on the type level.