Skip to content

Show members of a type alias #2260

Closed
Closed
@cefn

Description

@cefn

Search Terms

Expand type members/properties
Inherited type members/properties

Feature request

Can we add a configuration or comment directive that would cause typedoc to show the members of a type alias? Typescript is able to detect they are there, but currently Typedoc doesn't show them.

Problem

I composed Store - the core type of my library through distinct interfaces and types which can be reasoned about, documented and tested independently. However, the result of using interface inheritance and type aliases to compose Store is that Typedoc gives it no visible members at all in its documentation, making the API documentation from typedoc of very limited value for this case.

You can see the generated documentation for Store at https://cefn.com/lauf/api/types/_lauf_store.Store.html . The documentation omits the crucial watch, read and write methods from WatchableState.

Store Hierarchy

  • Watchable<T> defines a subscription method (watch()) for tracking a T
  • WatchableState<T> extends Watchable<T> with read() and write() methods to set and get a T
  • Immutable<T> is a recursive-applied Readonly<T>

A Store<T> is composed as the type alias WatchableState<Immutable<T>>

Existing Features

The Typescript compiler can resolve what members Store has, which is demonstrated during auto-completion...

image

I don't think following the typedoc links to the separate interfaces Watchable, WatchableState, Immutable helps the average person work out what the methods of Store<T> are, once they have lost context and are looking at a different type.

I can't identify any configuration that causes types to have the detail of their members exhaustively listed. There doesn't seem to be anything that can be added to a type's header comments to trigger this either.

I have tried to exhaustively understand all the options available but none seems to cover this case.

I tried to establish if typedoc-plugin-expand-object-like-types would show the members. However that plugin is pinned to an older typedoc version, and I have just finished refactoring all my documentation to align with the requirements of typedoc 0.24.x. Rolling back to 0.23.x raises a lot of warnings of unresolved and broken links now. I force-installed the plugin against 0.24.x, but this didn't have the desired effect of adding visible members to the Store definition..

Thanks for considering my feature request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions