aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-docs/src/utils
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-08-23 23:55:41 +0800
committerFabio Berger <me@fabioberger.com>2018-08-23 23:55:41 +0800
commit28f077b16f5fc5f08f95bb2ad00724e6ea89dd00 (patch)
treedba9e82409721d44ad41d7a434f3378f075486e9 /packages/react-docs/src/utils
parent3563fabe8871f69799dd7c89b83ecea19951794c (diff)
downloaddexon-sol-tools-28f077b16f5fc5f08f95bb2ad00724e6ea89dd00.tar
dexon-sol-tools-28f077b16f5fc5f08f95bb2ad00724e6ea89dd00.tar.gz
dexon-sol-tools-28f077b16f5fc5f08f95bb2ad00724e6ea89dd00.tar.bz2
dexon-sol-tools-28f077b16f5fc5f08f95bb2ad00724e6ea89dd00.tar.lz
dexon-sol-tools-28f077b16f5fc5f08f95bb2ad00724e6ea89dd00.tar.xz
dexon-sol-tools-28f077b16f5fc5f08f95bb2ad00724e6ea89dd00.tar.zst
dexon-sol-tools-28f077b16f5fc5f08f95bb2ad00724e6ea89dd00.zip
Add support for rending the Tuple type
Diffstat (limited to 'packages/react-docs/src/utils')
-rw-r--r--packages/react-docs/src/utils/typedoc_utils.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/react-docs/src/utils/typedoc_utils.ts b/packages/react-docs/src/utils/typedoc_utils.ts
index b867b51b4..67e37e82d 100644
--- a/packages/react-docs/src/utils/typedoc_utils.ts
+++ b/packages/react-docs/src/utils/typedoc_utils.ts
@@ -457,6 +457,7 @@ export class TypeDocUtils {
let indexSignatureIfExists;
let methodIfExists;
+ let tupleElementsIfExists;
const doesIndexSignatureExist =
!_.isUndefined(entity.declaration) && !_.isUndefined(entity.declaration.indexSignature);
if (doesIndexSignatureExist) {
@@ -465,6 +466,10 @@ export class TypeDocUtils {
} else if (!_.isUndefined(entity.declaration)) {
const isConstructor = false;
methodIfExists = this._convertMethod(entity.declaration, isConstructor, sectionName);
+ } else if (entity.type === TypeDocTypes.Tuple) {
+ tupleElementsIfExists = _.map(entity.elements, el => {
+ return { name: el.name, typeDocType: el.type as TypeDocTypes };
+ });
}
const elementTypeIfExists = !_.isUndefined(entity.elementType)
@@ -484,6 +489,7 @@ export class TypeDocUtils {
types,
method: methodIfExists,
indexSignature: indexSignatureIfExists,
+ tupleElements: tupleElementsIfExists,
};
const externalLinkIfExists = this._externalTypeToLink[entity.name];
if (!_.isUndefined(externalLinkIfExists)) {