typescript String<Min, Max> - Defining Types with Complex Properties Use a combination of phantom types, type guards and constructor functions to construct types with complex properties and encode domain logic in our type system.