javascript - js-doc / google-closure-compiler how to document passed enum object itself? -
e.g.
/** * super enum * @enum {number} */ myenum = { one: 1, two: 2 }; /** * @param {what type it?} enumobj */ function showenum(enumobj) { console.log(enumobj); } //show enum definition object showenum(myenum);
how describe parameter type not value/instance of myenum
, myenum
object itself?
use !myenum
!
means "non-null".
/** * @param {!myenum} enumobj */ function showenum(enumobj) { console.log(enumobj); }
Comments
Post a Comment