From f55234b4a04a3a26e6eda05a5c77a6bd984571ba Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Thu, 30 Aug 2018 11:30:43 -0400 Subject: comment public interface --- packages/sol-doc/src/solidity_doc_generator.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/sol-doc/src/solidity_doc_generator.ts b/packages/sol-doc/src/solidity_doc_generator.ts index a4eb403a8..f6bbf52ba 100644 --- a/packages/sol-doc/src/solidity_doc_generator.ts +++ b/packages/sol-doc/src/solidity_doc_generator.ts @@ -7,8 +7,16 @@ import { logUtils } from '@0xproject/utils'; import { SolidityDocFormat } from './solidity_doc_format'; +/** + * Compiles solidity files to both their ABI and devdoc outputs, and transforms + * those outputs into the types that feed into documentation generation tools. + */ export class SolidityDocGenerator { private readonly _compilerOptions: CompilerOptions; + /** + * Instantiate the generator. + * @param contractsDir the directory in which to find the contracts to be compiled + */ constructor(contractsDir: string) { // instantiate sol-compiler, passing in options to say we want abi and devdoc this._compilerOptions = { @@ -23,7 +31,11 @@ export class SolidityDocGenerator { }, }; } - /// run `contractsToCompile` through compiler, gathering output + /** + * Invoke the compiler and transform its outputs. + * @param contractsToCompile list of contracts for which to generate doc objects + * @return doc objects for use with documentation generation tools. + */ public async generateAsync(contractsToCompile: string[]): Promise { if (!_.isUndefined(contractsToCompile)) { this._compilerOptions.contracts = contractsToCompile; -- cgit v1.2.3