From 7d9c6eafbfd8434c92737a0e9edf8e610984ac90 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 11 Apr 2018 16:53:13 +0900 Subject: Add support for nested methods within type declarations. Make sure they render without a callPath. --- packages/react-docs/src/components/interface.tsx | 3 +-- packages/react-docs/src/components/type.tsx | 1 - packages/react-docs/src/utils/typedoc_utils.ts | 10 +++++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/react-docs/src/components/interface.tsx b/packages/react-docs/src/components/interface.tsx index 541e164e3..bdfdf47c4 100644 --- a/packages/react-docs/src/components/interface.tsx +++ b/packages/react-docs/src/components/interface.tsx @@ -19,7 +19,7 @@ export function Interface(props: InterfaceProps) { return ( {property.name}:{' '} - {property.type.typeDocType !== TypeDocTypes.Reflection ? ( + {property.type && property.type.typeDocType !== TypeDocTypes.Reflection ? ( ) : ( { - const childTypeIfExists = !_.isUndefined(child.type) + let childTypeIfExists = !_.isUndefined(child.type) ? typeDocUtils._convertType(child.type, sections, sectionName, docId) : undefined; + if (child.kindString === KindString.Method) { + childTypeIfExists = { + name: child.name, + typeDocType: TypeDocTypes.Reflection, + method: this._convertMethod(child, isConstructor, sections, sectionName, docId), + }; + } const c: CustomTypeChild = { name: child.name, type: childTypeIfExists, -- cgit