ok, not exactly the best example i could find, but have a look at this zod. It might give you a little inspiration in how you can fit type togethor.