首页 > 解决方案 > 为什么 typedoc 会忽略我的接口声明?

问题描述

type S=string|undefined;
declare global {
    export interface String {
        /**
         * returns string between borders
         * @param   borderA - left border
         * @param   borderB - right border
         * @param aIsFirst - true if borderA is first, false if is last
         * @param bIsFirst - true if borderB is first, false if is last
         */
        between(borderA:S, borderB:S, aIsFirst:boolean, bIsFirst:boolean):S;
    }
}

typedoc 命令:typedoc --out ./documentation/ src/

它使用取自 README.md 的 HTML 生成文件夹,但在那里找不到我的界面的痕迹......

标签: typescripttypedoc

解决方案


TypeDoc 将仅记录由您的入口点之一导出的内容。如果您导出 Foo 而不是 IFoo,您将收到一个错误,指出它已使用“但未包含在文档中”...

https://github.com/TypeStrong/typedoc/issues/1739


推荐阅读