admin管理员组文章数量:1356378
I have two files, file A and file B. File A uses a class from file B. My goal is to reference the TypeDoc output for a class used in file B in the TypeDoc output for file A. I can't seem to do this.
I know you can reference a symbol contained in the same file with TypeDoc with double brackets, like [[Foo]]
, but this didn't work for an external type like this.
/** Trying to reference [[FileB.InnerClass]] like this doesn't work. */
// This here is what I want to include
export type InnerClass = FileB.InnerClass;
// More code...
Is this possible to achieve?
I have two files, file A and file B. File A uses a class from file B. My goal is to reference the TypeDoc output for a class used in file B in the TypeDoc output for file A. I can't seem to do this.
I know you can reference a symbol contained in the same file with TypeDoc with double brackets, like [[Foo]]
, but this didn't work for an external type like this.
/** Trying to reference [[FileB.InnerClass]] like this doesn't work. */
// This here is what I want to include
export type InnerClass = FileB.InnerClass;
// More code...
Is this possible to achieve?
Share Improve this question edited Jul 26, 2019 at 21:25 Frank van Puffelen 600k85 gold badges890 silver badges860 bronze badges asked Jul 25, 2019 at 23:40 Erik MacikErik Macik 1818 bronze badges1 Answer
Reset to default 11 +100yes, it's possible.
- correct the ment.
- You don't have to enter the file name but you have to import object from file using
import
import { InnerClass } from './FileB';
/**
* See the [[InnerClass]] for more details.
*/
export type innerClass = InnerClass;
- To generate docs, run the following mand.
when typedef
it's global use this mand:
typedoc --out ./docs --target ES6 ./src/
or this when it's local:
npx typedoc --out ./docs --target ES6 ./src/
./docs
is folder where generate documentation../src/
is folder where your code is.--target ES6
version of JavaScript.
If you want to show only classes without different modules, use this flag --mode file
:
npx typedoc --out ./docs --mode file --target ES6 ./src/
for more info, see documentation.
本文标签: javascriptDocumenting external types with TypeDocStack Overflow
版权声明:本文标题:javascript - Documenting external types with TypeDoc - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743999227a2573550.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论