What would be the way to document a web component using jsdoc3
Here is an example of web component registered with x-tag.
xtag.register('x-analytics',
{
lifecycle : {
created : function(){
}
},
accessors : {
code : {
attribute : true
},
domain : {
attribute : true
}
}
});
Since X-Tag is also just JavaScript, you can simply use the corresponding annotations provided by jsdoc. So things like
@memberofetc.However, Web Components syntax can have its own kind of additional meaning. For example you probably want an annotation for
@elementor@lifecycleCallbackand stuff like this. This is not provided by jsdoc and therefore e.g. Polymer uses it's own documentation annotation usingcore-component-page.You either use what jsdoc provides and see what annotations fit best for your use case, or you use something like dgeni which lets you build a documentation tool pipe entirely from scratch, so you have full control over your annotations etc.