lit.dev icon indicating copy to clipboard operation
lit.dev copied to clipboard

[docs/api] Directives documentations start with the ancestor class' description.

Open Totati opened this issue 1 year ago • 1 comments

Directives which extend Directive class has the same

Base class for creating custom directives. Users should extend this class, implement render and/or update, and then pass their subclass to directive.

description.

Directives which extend AsyncDirective class has the same

An abstract Directive base class whose disconnected method will be called when the part containing the directive is cleared as a result of re-rendering, or when the user calls part.setConnected(false) on a part that was previously rendered containing the directive (as happens when e.g. a LitElement disconnects from the DOM).

description

Directives page

Totati avatar Jan 10 '24 12:01 Totati

Ah.. thanks for the report.

Looks like these might be caused by the export of the directive implementation classes, but since the classes themselves don't have jsdoc, they somehow go all the way down to the base class that does have jsdoc?

Listing all the class API of the directive implementations seems of dubious value since it's really just the directive that is meant to be pubic facing and used. I believe the class or the type of it is exported only to allow typescript to resolve the return type of the directive call. Perhaps this was always the intention too, as the table of contents of the directives API page never list those classes either.

We probably want to just filter those out during API doc generation.

augustjk avatar Jan 11 '24 01:01 augustjk