Skip to content

Commit

Permalink
fix(core): add parentheses on function names in type declaration tabl…
Browse files Browse the repository at this point in the history
…e views (#696)
  • Loading branch information
tgreyuk committed Sep 30, 2024
1 parent 9c90566 commit bf130cb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/quiet-ducks-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'typedoc-plugin-markdown': patch
---

- Add parentheses on function names in type declaration table views (#696)
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,14 @@ export function typeDeclarationTable(
declarations.forEach((declaration: DeclarationReflection) => {
const row: string[] = [];

const name: string[] = [declaration.name];

if (declaration.signatures?.length) {
name.push('()');
}

const optional = declaration.flags.isOptional ? '?' : '';
row.push(`${backTicks(declaration.name)}${optional}`);
row.push(`${backTicks(name.join(''))}${optional}`);

row.push(this.partials.someType(declaration.type));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ Comments for LiteralType
| \`set accessorA\` | \`void\` | Comments for accessorA setter |
| \`get accessorB\` | \`string\` | - |
| \`set accessorB\` | \`void\` | - |
| \`someFunction\` | [\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\`any\`\\> | Comments for someFunction |
| \`someFunction()\` | [\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\`any\`\\> | Comments for someFunction |
## Source
Expand Down

0 comments on commit bf130cb

Please sign in to comment.