doc: adding example for type definitions

An example of how type definitions work would be handy