Skip to content

Generate documentation also for indirect exported Types. #1657

@tenbits

Description

@tenbits

Dear Typedoc Team,

sorry for rising this topic up again, but I'm rather sure the lack of this feature makes the documentation generator uncomplete.
Consider this valid case:

Foo.ts
import { IFoo } from './IFoo';
export class Foo {
    getFoo (params: IFoo) {
        return params.foo;
    }
}
IFoo.ts
import { Bar } from './Bar';
export interface IFoo {
    foo: string
    bar: Bar
}
 
Bar.ts
export class Bar {
    logBar () {}
}
 

Now let's say, we want to generate the documentation for the Foo class. When we specify "entryPoints": ["Foo.ts"] we will lose half of the required documentation - about what are IFoo and Bar.

The entryPoint naming is a bit misleading, as it usually means linker/compiler/generator will traverse the Tree, but it stops for the Foo class only.

As I see, there are 2 possible workarounds:

  1. To specify what Types should be generated, via multiple entryPoints, or using the plugin-not-exported - but in both cases we have manually to track all required Types for the documentation. And usually due to the nested refs this is not quit easy to do.
  2. Using the wildcard in entryPoints to generate the docs for all files - but this blows the documentation with unneeded types.

So those workarounds are almost not usable.

What is the expected behavior?

Documentation generator should track all Types accessible by the reference (in property, argument, return type) and include those in output. It should track also deeply nested refs like in example FooIFooBar

Or is there another way to output and link all Types direct or indirect accessible by Foo consumer?

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionDiscussion on large effort changes to TypeDocwontfixDeclining to implement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions