tsdoc icon indicating copy to clipboard operation
tsdoc copied to clipboard

What's the proper way to use inheritDoc with a 3rd party module + path?

Open theogravity opened this issue 1 year ago • 3 comments

I tried looking at this file as a reference:

https://github.com/microsoft/tsdoc/blob/main/spec/code-snippets/DeclarationReferences.ts

And have the following code:

import type { WindowIDData } from "atop-sdk/resources/index.js";

/**
 * The window data containing window-specific information.
 */
export type WindowCreateData = WindowIDData;

I've tried:

/**
 * The window data containing window-specific information.
 * {@inheritDoc atop-sdk/resources/index.js#WindowIDData:interface}
 */
export type WindowCreateData = WindowIDData;

But that doesn't seem to be recognized by the parser I'm using (via docusaurus-plugin-typedoc which uses typedoc-plugin-markdown under the hood):

[warning] Declaration reference in @inheritDoc for WindowCreateData was not fully parsed and may resolve incorrectly
[warning] Failed to find "atop-sdk/resources/index.js#WindowIDData:interface" to inherit the comment from in the comment for WindowCreateData

May I ask what I am doing incorrectly? WindowIDData would be an interface. Not sure if it's a bug in the parser I'm using or if I'm not specifying the reference correctly.

theogravity avatar Mar 04 '25 19:03 theogravity

TypeDoc does not support the old style declaration references which you're trying to use there, docs

What that link should be is dependent on a few things. Given that you're using it for inheritDoc, TypeDoc requires that your site also include documentation for that module. It won't just go retrieve docs from undocumented modules...

Gerrit0 avatar Mar 05 '25 04:03 Gerrit0

Do you mean the 3rd party type needs to be exported from the package I'm working on for it to be recognized?

theogravity avatar Mar 05 '25 04:03 theogravity

Yes, that's correct

Gerrit0 avatar Mar 05 '25 04:03 Gerrit0