From 2897b729672b0d98bf1eb2fc843c23f5d966f6ee Mon Sep 17 00:00:00 2001
From: Brandon Millman <brandon.millman@gmail.com>
Date: Wed, 14 Feb 2018 10:16:00 -0800
Subject: Add support for intersection types in docs

---
 packages/website/ts/pages/documentation/type.tsx | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

(limited to 'packages/website/ts/pages/documentation/type.tsx')

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);
     }
-- 
cgit v1.2.3

