gpt4 book ai didi

javascript - TypeDoc 创建空文档

转载 作者:行者123 更新时间:2023-11-28 05:35:46 25 4
gpt4 key购买 nike

我有一个 gulp 任务,该任务应该获取我的文件并为它们创建文档。任务如下所示:

var gulp = require('gulp');
var gulptypedoc = require('gulp-typedoc');

gulp.task('typedoc-gamesmart', function () {
return gulp.src([
'./src/util/Config.ts',
'./src/util/Http.ts',
'./typings/crypto-js/crypto-js.d.ts',
'./src/gamesmart/GameSmart.ts',
'./src/gamesmart/apis/Client.ts',
'./src/gamesmart/apis/Data.ts',
'./src/gamesmart/apis/Game.ts',
'./src/gamesmart/apis/Score.ts',
'./src/gamesmart/apis/Store.ts',
'./src/gamesmart/apis/User.ts',
'./src/gamesmart/main.ts',
]).pipe(gulptypedoc({
// module: 'system',
target: 'es5',
out: 'docs/gamesmart/',
name: 'GameSmart SDK',
excludeNotExported: true,
mode: 'file',
version: true
}));
});

完成后,我得到空文档。

Empty Docs

以下是类结构的示例:

class Score extends GameSmart {

/**
* Saves a score for the game
*
* @param {number} score The score to be saved.
* @param {Function} callback The callback to run once complete.
* @returns
*/
public save(options: { score?: number } = {}, callback: Function = null, obj: Object = null): void {
if ((options.score || 0) <= 0) { return; }
this.makeRequest('/save', HttpMethod.Post, options, callback, obj);
}

}

如您所见,我没有使用模块,因此正如文档所说使用 mode: 'file' 所以我这样做了,但我没有得到任何东西。

如果我使用模式:'模块',我会得到类列表,但没有文档:

Empty Doc Modules

我是不是做错了什么?

最佳答案

重申@Sven所说的,如果您在不导出任何符号的情况下使用excludedNotExported功能,则不会生成任何文档。更改此标志以记录整个项目。

{ // TypeDoc config
target: 'es5',
out: 'docs/gamesmart/',
name: 'GameSmart SDK',
excludeNotExported: false,
mode: 'file',
version: true
}

关于javascript - TypeDoc 创建空文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39373691/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com