如何使用Typedoc链接到另一个模块

时间:2019-10-17 09:53:25

标签: typescript typedoc

在Typedoc中,您可以使用以下方法链接到另一个类:

  • [[ClassName]]
  • {@link ClassName}

该类甚至可以属于另一个模块。

但是我不知道如何链接

  • 另一个模块
  • 从另一个模块导出的功能

因此,假设您有2个d.ts文件:

Foo.d.ts

/**
 * I want to link to:
 * the [[Bar]] module //does not work
 * the {@link Bar} module //does not work
 * the [[Bar.foobar]] function //does not work
 * the {@link Bar.foobar]] function //does not work
 */
export class Foo{}

bar.d.ts

export function foobar(): string;

执行此操作的正确语法是什么?还是Typedoc不支持此功能?

1 个答案:

答案 0 :(得分:0)

看起来像Typedoc的缺点。 创建了pull request来解决这个问题。

如果接受了此拉取请求,则应该可以使用{@link "modulename"}链接到只有一个定义文件的模块(是的,需要使用引号)。

相关问题