mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 19:13:31 +01:00
feat(website): parse tsdoc comments (#8386)
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import type { ApiEnum, ApiModel } from '@microsoft/api-extractor-model';
|
||||
import { DocItem } from './DocItem';
|
||||
import { genToken, resolveDocComment, TokenDocumentation } from '~/util/parse.server';
|
||||
import { CommentNodeContainer } from './comment/CommentNodeContainer';
|
||||
import { genToken, TokenDocumentation } from '~/util/parse.server';
|
||||
|
||||
export interface EnumMemberData {
|
||||
name: string;
|
||||
initializerTokens: TokenDocumentation[];
|
||||
summary: string | null;
|
||||
summary: ReturnType<DocItem['toJSON']>['summary'];
|
||||
}
|
||||
|
||||
export class DocEnum extends DocItem<ApiEnum> {
|
||||
@@ -17,7 +18,9 @@ export class DocEnum extends DocItem<ApiEnum> {
|
||||
this.members = item.members.map((member) => ({
|
||||
name: member.name,
|
||||
initializerTokens: member.initializerExcerpt?.spannedTokens.map((token) => genToken(this.model, token)) ?? [],
|
||||
summary: resolveDocComment(member),
|
||||
summary: member.tsdocComment
|
||||
? new CommentNodeContainer(member.tsdocComment.summarySection, model, member).toJSON()
|
||||
: null,
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user