TLDR: type + predicate = refinement type
We have a type called T and a predicate on T ( (x: T) => boolean
) called P.
We can say that P refines T into a type PT, where PT is a subtype of T containing all values x of type T for which P(x) === true
.