Skip to content

Allow documenting callable objects as being variables of their declared type (rather than a function+namespace with duplicated docs and no type declaration/link) #2881

Closed
@pjeby

Description

@pjeby

Search Terms

functions, variables, callable objects

Problem

I'm currently working on documenting a library that exports instances of this type. The type includes two call signatures, which causes typedoc to process exports of this type through convertVariableAsFunction, stripping the type information and copying all the documentation from the (external) type to the other project's output. This generates tons of duplicate documentation that also entirely obscures the fact the export is a Signal<Whatever>. So I'd like them to be rendered as variables, not functions with extra properties and methods.

Suggested Solution

Don't convertVariableAsFunction if a variable's type is an interface, type alias, class, etc. It should only be used where the type is implicit (and therefore a one-off), since an explicit declaration means the signature or property/method docs have a common definition that can be linked to (instead of inlining copies of the docs).

Another possibility would be to add a new tag, e.g. @variable, or perhaps overload the meaning of another tag, like @useDeclaredType.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions