Looking at the JSDoc @typdef docs page cited below, I do not think
this will be of great use to the Drupal project for use in PHP
documentation. We would tend to define an interface or a class if we
have standard properties to document/use.
And I personally think this would lead to documentation that is less
human-readable. For instance, the JSDoc example defines
* @typedef {(number|string)} NumberLike
and then uses NumberLike in other documentation, such as
* @param NumberLike param_name
I'm not sure what the scope of the @typedef tag is, but it seems like
if it was global rather than local to a file, that in some other file
if you encountered NumberLike, you'd be saying "Huh? What is that?"
(on an API docs display site, presumably it would turn into a link or
have hover properties or something to clue you in).
That said... if other projects have need for it, I don't see a reason
not to add it to the standards, aside from the necessity of docs
parsers supporting it. On the other hand, PSR-5 doesn't seem inclined
to adopt tags that I've suggested that we use a lot in the Drupal
project, so maybe projects that need this could just define their own
custom tag, as we'll have to if we ever adopt PSR-5?
--Jennifer
--
Jennifer Hodgdon * Poplar ProductivityWare
www.poplarware.com
Drupal web sites and custom Drupal modules