Fix 0x.js docs to include types from generated contract wrappers

This commit is contained in:
Fabio Berger
2018-03-22 20:03:42 +00:00
parent 538914aa52
commit 170e5589f9
3 changed files with 16 additions and 3 deletions

View File

@@ -88,7 +88,7 @@ export const typeDocUtils = {
const classChildren = _.filter(packageDefinitionWithMergedChildren.children, (child: TypeDocNode) => {
return child.kindString === KindString.Class;
});
if (classChildren.length > 1) {
if (classChildren.length > 1 && sectionName !== 'types') {
throw new Error('`react-docs` only supports projects with 1 exported class per file');
}
const isClassExport = packageDefinitionWithMergedChildren.children[0].kindString === KindString.Class;
@@ -183,6 +183,12 @@ export const typeDocUtils = {
}
break;
case KindString.Class:
// We currently do not support more then a single class per file
// except for the types section, where we ignore classes since we
// only want to render type definitions.
break;
default:
throw utils.spawnSwitchErr('kindString', entity.kindString);
}