diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-02-15 02:16:00 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-02-15 02:16:00 +0800 |
commit | 2897b729672b0d98bf1eb2fc843c23f5d966f6ee (patch) | |
tree | 66f90473ba5acdf0c606c6328acf0d5cb08f427c /packages/website/ts/pages/documentation | |
parent | 3510985cf472690e12e07e350f1a27bfb263b3bc (diff) | |
download | dexon-sol-tools-2897b729672b0d98bf1eb2fc843c23f5d966f6ee.tar.gz dexon-sol-tools-2897b729672b0d98bf1eb2fc843c23f5d966f6ee.tar.zst dexon-sol-tools-2897b729672b0d98bf1eb2fc843c23f5d966f6ee.zip |
Add support for intersection types in docs
Diffstat (limited to 'packages/website/ts/pages/documentation')
-rw-r--r-- | packages/website/ts/pages/documentation/type.tsx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/website/ts/pages/documentation/type.tsx b/packages/website/ts/pages/documentation/type.tsx index e989e7129..b306fa053 100644 --- a/packages/website/ts/pages/documentation/type.tsx +++ b/packages/website/ts/pages/documentation/type.tsx @@ -118,6 +118,23 @@ export function Type(props: TypeProps): any { typeName = type.name; break; + case TypeDocTypes.Intersection: + const intersectionsTypes = _.map(type.types, t => { + return ( + <Type + key={`type-${t.name}-${t.value}-${t.typeDocType}`} + type={t} + sectionName={props.sectionName} + typeDefinitionByName={props.typeDefinitionByName} + docsInfo={props.docsInfo} + /> + ); + }); + typeName = _.reduce(intersectionsTypes, (prev: React.ReactNode, curr: React.ReactNode) => { + return [prev, '&', curr]; + }); + break; + default: throw utils.spawnSwitchErr('type.typeDocType', type.typeDocType); } |