1

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
        }
    }
});
krampstudio
  • 3,519
  • 2
  • 43
  • 63

1 Answers1

0

Since X-Tag is also just JavaScript, you can simply use the corresponding annotations provided by jsdoc. So things like @memberof etc.

However, Web Components syntax can have its own kind of additional meaning. For example you probably want an annotation for @element or @lifecycleCallback and stuff like this. This is not provided by jsdoc and therefore e.g. Polymer uses it's own documentation annotation using core-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.

Pascal Precht
  • 8,803
  • 7
  • 41
  • 53