From 19e17ba12859a9cc94ce480fc6b29e28c711321e Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 14 Aug 2018 16:34:48 -0700 Subject: Add ability to hide specific class constructors --- .../src/utils/doc_generate_and_upload_utils.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts b/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts index dfaaf1c07..187358421 100644 --- a/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts +++ b/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts @@ -28,6 +28,16 @@ const EXTERNAL_TYPE_TO_LINK: { [externalType: string]: string } = { 'solc.CompilerSettings': 'https://solidity.readthedocs.io/en/v0.4.24/using-the-compiler.html#input-description', }; +const CLASSES_WITH_HIDDEN_CONSTRUCTORS: string[] = [ + 'ERC20ProxyWrapper', + 'ERC20TokenWrapper', + 'ERC721ProxyWrapper', + 'ERC721TokenWrapper', + 'EtherTokenWrapper', + 'ExchangeWrapper', + 'ForwarderWrapper', +]; + export async function generateAndUploadDocsAsync(packageName: string, isStaging: boolean): Promise { const monorepoPackages = utils.getPackages(constants.monorepoRootPath); const pkg = _.find(monorepoPackages, monorepoPackage => { @@ -146,6 +156,17 @@ export async function generateAndUploadDocsAsync(packageName: string, isStaging: if (!_.includes(exportItems, child.name)) { delete finalTypeDocOutput.children[i].children[j]; } + if (child.kindString === 'Class' && _.includes(CLASSES_WITH_HIDDEN_CONSTRUCTORS, child.name)) { + const classChildren = typedocOutput.children[i].children[j].children; + _.each(classChildren, (classChild, k) => { + if (classChild.kindString === 'Constructor') { + delete finalTypeDocOutput.children[i].children[j].children[k]; + finalTypeDocOutput.children[i].children[j].children = _.compact( + finalTypeDocOutput.children[i].children[j].children, + ); + } + }); + } }); finalTypeDocOutput.children[i].children = _.compact(finalTypeDocOutput.children[i].children); }); -- cgit v1.2.3