TypeScript: Use Sum Types To Your Advantage When Modelling Data