-
Notifications
You must be signed in to change notification settings - Fork 604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[api-extractor] Error caused by using the same name for an interface and namespace #1108
Comments
Which release of API Extractor are you using? |
I am using 7.0.18 |
I confirmed that this is a bug. Thanks for providing the repro. |
@akshay-madhukar The inconsistency arises because
I guess interfaces are special because they don't correspond to an actual JavaScript object, so the export is only conceptual. This is an API Extractor bug, and we should fix it. But in the meantime as a workaround you can export the interface. If the interface is supposed to be private, very soon I'm going to implement #972 which will allow you to mark it as |
It seems that export declare namespace Test {
export type Kind = string;
/**
* Create a {@link (Test:interface)} of the given kind
*
* @param kind - The {@link (Test:namespace).Kind | kind} of the test.
*/
export function create(kind: Kind): Test;
}
/**
* A Test
*
* @public
*/
export interface Test {
kind: Test.Kind;
} Will not generate any documentation for the interface. The following warnings are also produced:
|
This issue belongs to a family of closely related issues. I've created metaissue #1308 to come up with a unified fix that tackles them all together. |
When an interface and a namespace have the same name as shown by
TestName
in this sample.d.ts
filethe following error is seen in v7.0.18
However, if the last export is omitted, and only the interface and namespace are included, the api-extractor runs with no issues. There must be at least one additional export for the error to appear.
The text was updated successfully, but these errors were encountered: