diff options
author | F. Eugene Aumson <gene@aumson.org> | 2018-08-24 21:18:33 +0800 |
---|---|---|
committer | F. Eugene Aumson <gene@aumson.org> | 2018-08-29 20:51:01 +0800 |
commit | a1959df911741d0424a952fa4a63c5dcc1135524 (patch) | |
tree | 61a9682aa21143a98f00a67c98558a6a3f962f74 /packages/ethereum-types | |
parent | 775d1efd4607a4097704fe3c4f7ae1156b2c1a6f (diff) | |
download | dexon-0x-contracts-a1959df911741d0424a952fa4a63c5dcc1135524.tar.gz dexon-0x-contracts-a1959df911741d0424a952fa4a63c5dcc1135524.tar.zst dexon-0x-contracts-a1959df911741d0424a952fa4a63c5dcc1135524.zip |
add devdoc support to solc typings, and use it
Diffstat (limited to 'packages/ethereum-types')
-rw-r--r-- | packages/ethereum-types/src/index.ts | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/packages/ethereum-types/src/index.ts b/packages/ethereum-types/src/index.ts index 3b6fdc77b..993306a43 100644 --- a/packages/ethereum-types/src/index.ts +++ b/packages/ethereum-types/src/index.ts @@ -324,9 +324,56 @@ export interface ContractNetworkData { constructorArgs: string; } +export type ParamDescription = string; + export interface StandardContractOutput { abi: ContractAbi; evm: EvmOutput; + devdoc?: DevdocOutput; +} + +export interface StandardOutput { + errors: SolcError[]; + sources: { + [fileName: string]: { + id: number; + ast?: object; + legacyAST?: object; + }; + }; + contracts: { + [fileName: string]: { + [contractName: string]: StandardContractOutput; + }; + }; +} + +export type ErrorType = + | 'JSONError' + | 'IOError' + | 'ParserError' + | 'DocstringParsingError' + | 'SyntaxError' + | 'DeclarationError' + | 'TypeError' + | 'UnimplementedFeatureError' + | 'InternalCompilerError' + | 'Exception' + | 'CompilerError' + | 'FatalError' + | 'Warning'; +export type ErrorSeverity = 'error' | 'warning'; +export interface SolcError { + sourceLocation?: { + file: string; + start: number; + end: number; + }; + type: ErrorType; + component: 'general' | 'ewasm'; + severity: ErrorSeverity; + message: string; + formattedMessage?: string; } export interface EvmOutput { @@ -339,6 +386,20 @@ export interface EvmBytecodeOutput { sourceMap: string; } +export interface DevdocOutput { + title: string; + author: string; + methods: { + [signature: string]: { + details: string; + params: { + [name: string]: ParamDescription; + }; + return?: string; + }; + }; +} + export interface ContractVersionData { compiler: CompilerOpts; sources: { @@ -415,6 +476,7 @@ export interface Source { id: number; } +// TODO: move the following into the sol-compiler package. /** * Options you can specify (as flags or in a compiler.json file) when invoking sol-compiler * contractsDir: Directory containing your project's Solidity contracts. Can contain nested directories. |