aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-docs/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/react-docs/src')
-rw-r--r--packages/react-docs/src/types.ts1
-rw-r--r--packages/react-docs/src/utils/typedoc_utils.ts6
2 files changed, 7 insertions, 0 deletions
diff --git a/packages/react-docs/src/types.ts b/packages/react-docs/src/types.ts
index 3b4a57ad5..f4e61edc9 100644
--- a/packages/react-docs/src/types.ts
+++ b/packages/react-docs/src/types.ts
@@ -94,6 +94,7 @@ export enum KindString {
Method = 'Method',
Interface = 'Interface',
TypeAlias = 'Type alias',
+ ObjectLiteral = 'Object literal',
Variable = 'Variable',
Function = 'Function',
Enumeration = 'Enumeration',
diff --git a/packages/react-docs/src/utils/typedoc_utils.ts b/packages/react-docs/src/utils/typedoc_utils.ts
index 9c89b135a..0c7803a04 100644
--- a/packages/react-docs/src/utils/typedoc_utils.ts
+++ b/packages/react-docs/src/utils/typedoc_utils.ts
@@ -93,10 +93,16 @@ export const typeDocUtils = {
throw new Error('`react-docs` only supports projects with 1 exported class per file');
}
const isClassExport = packageDefinitionWithMergedChildren.children[0].kindString === KindString.Class;
+ const isObjectLiteralExport =
+ packageDefinitionWithMergedChildren.children[0].kindString === KindString.ObjectLiteral;
if (isClassExport) {
entities = packageDefinitionWithMergedChildren.children[0].children;
const commentObj = packageDefinitionWithMergedChildren.children[0].comment;
packageComment = !_.isUndefined(commentObj) ? commentObj.shortText : packageComment;
+ } else if (isObjectLiteralExport) {
+ entities = packageDefinitionWithMergedChildren.children[0].children;
+ const commentObj = packageDefinitionWithMergedChildren.children[0].comment;
+ packageComment = !_.isUndefined(commentObj) ? commentObj.shortText : packageComment;
} else {
entities = packageDefinitionWithMergedChildren.children;
}