Skip to content

Commit

Permalink
fix: Add comments for function type properties (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgreyuk committed Jan 9, 2022
1 parent df83765 commit d3441f2
Showing 1 changed file with 6 additions and 1 deletion.
@@ -1,5 +1,5 @@
import * as Handlebars from 'handlebars';
import { DeclarationReflection } from 'typedoc';
import { DeclarationReflection, ReflectionType } from 'typedoc';
import { escapeChars, stripLineBreaks } from '../../utils';

export default function () {
Expand Down Expand Up @@ -113,6 +113,11 @@ function getName(property: DeclarationReflection) {
}

function getComments(property: DeclarationReflection) {
if (property.type instanceof ReflectionType) {
if (property.type?.declaration?.signatures) {
return property.type?.declaration.signatures[0].comment;
}
}
if (property.signatures) {
return property.signatures[0].comment;
}
Expand Down

0 comments on commit d3441f2

Please sign in to comment.