Skip to content

Methods returning this are documented as returning the class #2458

Closed
@pjeby

Description

@pjeby

Search terms

Methods with "return this" are documented as returning the class; method chaining.

Question

I have just started using typedoc on a project and am noticing that the output is imprecise regarding methods that return this. In VSCode's hints, these methods are identified as such, but typedoc lists them as returning an arbitrary instance of the class. This makes it challenging to tell from the documentation which methods are returning the same instance rather than a new one. (As I have a class with both kinds of methods.)

(It does this even if I explicitly declare the method as returning this - i.e. someMethod(): this {...}, let alone implicitly.)

Is this intentional, an oversight, or something else? Is there any way to force the output to show this for such methods? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionQuestion about functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions