mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat(website): type parameters links, builtin doc links, default values (#10515)
* feat(website): links to type parameters, builtin doc links in api.json * feat(website): show default values for params and props in excerpt * fix: link in jsdoc --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
This commit is contained in:
@@ -29,6 +29,7 @@ export async function ParameterNode({
|
||||
{description ? <Badges node={parameter} /> : null}
|
||||
{parameter.name}
|
||||
{parameter.isOptional ? '?' : ''}: <ExcerptNode node={parameter.typeExcerpt} version={version} />
|
||||
{parameter.defaultValue ? ` = ${parameter.defaultValue}` : ''}
|
||||
</span>
|
||||
{description && parameter.description?.length ? (
|
||||
<div className="mt-4 pl-4">
|
||||
|
||||
@@ -51,7 +51,13 @@ export async function PropertyNode({
|
||||
<LinkIcon aria-hidden size={16} />
|
||||
</Link>
|
||||
{property.displayName}
|
||||
{property.isOptional ? '?' : ''} : <ExcerptNode node={property.typeExcerpt} version={version} />
|
||||
{property.isOptional ? '?' : ''} : <ExcerptNode node={property.typeExcerpt} version={version} />{' '}
|
||||
{property.summary?.defaultValueBlock.length
|
||||
? `= ${property.summary.defaultValueBlock.reduce(
|
||||
(acc: string, def: { kind: string; text: string }) => `${acc}${def.text}`,
|
||||
'',
|
||||
)}`
|
||||
: ''}
|
||||
</span>
|
||||
</h3>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user