You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
export class B {
b: string;
}
export class A extends B {
a: string;
}
Today, api-documenter will write two API documentation pages: one for A and one for B. It will list a under A and b under B. Notably, in the documentation page for A, there will be no indication that A inherits b (or any other additional properties/methods) other than the A extends B clause written to A's documentation page. A developer needs to "jump back and forth" between the documentation pages for A and B in order to understand A's full API.
I think we can do better. It should be possible to configure api-documenter to show a class's inherited members within its own API documentation page. The example above is for class inheritance, but all of the above applies to interface inheritance as well.
This issue was opened with the [api-documenter] tag, but we should also make a change to api-extractor-model to make it easier to find a declaration's inherited members.
There should be an indication of some kind that a member is inherited (e.g. special formatting, a badge/tag, separate section, etc). What should this look like?
Should we also show members inherited from a declaration in a separate package? Suppose in the example above, B is in a separate package. The .api.json file for A's package won't include any information about B or b. If we wanted to support this, we'd need to make a change to api-extractor as well.
Standard questions
Please answer these questions to help us investigate your issue more quickly:
Summary
Suppose we have the following class setup:
Today, api-documenter will write two API documentation pages: one for
Aand one forB. It will listaunderAandbunderB. Notably, in the documentation page forA, there will be no indication thatAinheritsb(or any other additional properties/methods) other than theA extends Bclause written toA's documentation page. A developer needs to "jump back and forth" between the documentation pages forAandBin order to understandA's full API.I think we can do better. It should be possible to configure api-documenter to show a class's inherited members within its own API documentation page. The example above is for class inheritance, but all of the above applies to interface inheritance as well.
For a live example of this feature in TypeDoc, please see https://typedoc.org/api/classes/Application.html, in particular the "Inherited" checkbox on the top-right.
Details
Implementation details:
[api-documenter]tag, but we should also make a change to api-extractor-model to make it easier to find a declaration's inherited members.Some open questions:
Bis in a separate package. The.api.jsonfile forA's package won't include any information aboutBorb. If we wanted to support this, we'd need to make a change to api-extractor as well.Standard questions
Please answer these questions to help us investigate your issue more quickly:
@microsoft/api-documenterversion?node -v)?