mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
feat(website): show parameter descriptions (#8519)
Co-authored-by: Noel <buechler.noel@outlook.com>
This commit is contained in:
14
packages/website/src/DocModel/comment/ParamBlock.ts
Normal file
14
packages/website/src/DocModel/comment/ParamBlock.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { ApiItem, ApiModel } from '@microsoft/api-extractor-model';
|
||||
import type { DocParamBlock } from '@microsoft/tsdoc';
|
||||
import { block, DocBlockJSON } from './CommentBlock';
|
||||
|
||||
export interface DocParamBlockJSON extends DocBlockJSON {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export function paramBlock(paramBlock: DocParamBlock, model: ApiModel, parentItem?: ApiItem): DocParamBlockJSON {
|
||||
return {
|
||||
...block(paramBlock, model, parentItem),
|
||||
name: paramBlock.parameterName,
|
||||
};
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
type DocBlock,
|
||||
DocComment,
|
||||
DocCodeSpan,
|
||||
DocParamBlock,
|
||||
} from '@microsoft/tsdoc';
|
||||
import { block } from './CommentBlock';
|
||||
import { codeSpan } from './CommentCodeSpan';
|
||||
@@ -17,6 +18,7 @@ import { node as _node } from './CommentNode';
|
||||
import { nodeContainer } from './CommentNodeContainer';
|
||||
import { fencedCode } from './FencedCodeCommentNode';
|
||||
import { linkTagNode } from './LinkTagCommentNode';
|
||||
import { paramBlock } from './ParamBlock';
|
||||
import { plainTextNode } from './PlainTextCommentNode';
|
||||
import { comment } from './RootComment';
|
||||
|
||||
@@ -35,6 +37,8 @@ export function createCommentNode(node: DocNode, model: ApiModel, parentItem?: A
|
||||
return codeSpan(node as DocCodeSpan);
|
||||
case DocNodeKind.Block:
|
||||
return block(node as DocBlock, model, parentItem);
|
||||
case DocNodeKind.ParamBlock:
|
||||
return paramBlock(node as DocParamBlock, model, parentItem);
|
||||
case DocNodeKind.Comment:
|
||||
return comment(node as DocComment, model, parentItem);
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user