mirror of
https://github.com/discordjs/discord.js.git
synced 2024-08-21 03:14:43 +12:00
feat: Support @returns
(#9362)
Co-authored-by: Noel <buechler.noel@outlook.com>
This commit is contained in:
parent
733c96c255
commit
1c8567f147
2 changed files with 6 additions and 1 deletions
|
@ -36,3 +36,7 @@ export function DeprecatedBlock({ children }: PropsWithChildren): JSX.Element {
|
|||
export function SeeBlock({ children }: PropsWithChildren): JSX.Element {
|
||||
return <Block title="See Also">{children}</Block>;
|
||||
}
|
||||
|
||||
export function ReturnsBlock({ children }: PropsWithChildren): JSX.Element {
|
||||
return <Block title="Returns">{children}</Block>;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import { Fragment, useCallback, type ReactNode } from 'react';
|
|||
import { ItemLink } from '../../ItemLink';
|
||||
import { SyntaxHighlighter } from '../../SyntaxHighlighter';
|
||||
import { resolveItemURI } from '../util';
|
||||
import { DefaultValueBlock, DeprecatedBlock, ExampleBlock, RemarksBlock, SeeBlock } from './BlockComment';
|
||||
import { DefaultValueBlock, DeprecatedBlock, ExampleBlock, RemarksBlock, ReturnsBlock, SeeBlock } from './BlockComment';
|
||||
|
||||
export function TSDoc({ item, tsdoc }: { item: ApiItem; tsdoc: DocNode }): JSX.Element {
|
||||
const createNode = useCallback(
|
||||
|
@ -98,6 +98,7 @@ export function TSDoc({ item, tsdoc }: { item: ApiItem; tsdoc: DocNode }): JSX.E
|
|||
{defaultValueBlock ? (
|
||||
<DefaultValueBlock>{createNode(defaultValueBlock.content)}</DefaultValueBlock>
|
||||
) : null}
|
||||
{comment.returnsBlock ? <ReturnsBlock>{createNode(comment.returnsBlock.content)}</ReturnsBlock> : null}
|
||||
{exampleBlocks.length
|
||||
? exampleBlocks.map((block, idx) => <ExampleBlock key={idx}>{createNode(block.content)}</ExampleBlock>)
|
||||
: null}
|
||||
|
|
Loading…
Reference in a new issue