javascript - How can I mark a parameter as containing a DOM node in JSDoc? -
i want indicate parameter should dom node, can't seem find information how indicate jsdoc. use {object}
, rather ugly. rather have {node}
or {domnode}
, can't find examples point me in direction.
so, how mark parameter expecting dom node?
from usejsdoc.org @type
annotation:
a type expression can include jsdoc namepath symbol (for example, mynamespace.myclass); built-in javascript type (for example, string); or combination of these. can use google closure compiler type expression, several other formats specific jsdoc.
[...]
each type specified providing type expression, using 1 of formats described below. appropriate, jsdoc automatically create links documentation other symbols. example, @type {myclass} link myclass documentation if symbol has been documented.
so can link symbols. htmlelement
(and inheriting objects htmlimageelement
) symbols. therefore, if follow spec, should allowed do:
@type {htmlelement}
to indicate type of htmlelement
(i.e. dom node).
my guess why isn't explicitly documented because dom node objects aren't javascript built-ins (e.g. string
or number
). added client browser, technically other symbol , make (being implemented native browser code aside), far js language spec concerned.
while haven't gotten stage of compiling our documentation (that's separate story), confirm if above accepted jsdoc, how interpret , follow particular concept work, , our standard ide (intellij) accepts it.
Comments
Post a Comment