There's some really old documentation in the docblock of hook_element_info().
For more information about custom element types see the explanation at http://drupal.org/node/169815.
That node is a guide to building form elements in Drupal 6 that was last edited in 2011. Surely there's something newer and more relevant we can link to here.