import { ContractDescription, TypeResolver } from './internal'; export declare enum CompileErrorType { SyntaxError = "SyntaxError", SemanticError = "SemanticError", InternalError = "InternalError", Warning = "Warning" } export declare enum BuildType { Debug = "debug", Release = "release" } export interface RelatedInformation { filePath: string; position: [{ line: number; column: number; }, { line: number; column: number; }?]; message: string; } export interface CompileErrorBase { type: string; filePath: string; position: [{ line: number; column: number; }, { line: number; column: number; }?]; message: string; relatedInformation: RelatedInformation[]; } export interface SyntaxError extends CompileErrorBase { type: CompileErrorType.SyntaxError; unexpected: string; expecting: string; } export interface SemanticError extends CompileErrorBase { type: CompileErrorType.SemanticError; } export interface InternalError extends CompileErrorBase { type: CompileErrorType.InternalError; } export interface Warning extends CompileErrorBase { type: CompileErrorType.Warning; } export declare type CompileError = SyntaxError | SemanticError | InternalError | Warning; export interface CompileResult { asm?: OpCode[]; hex?: string; ast?: Record; dependencyAsts?: Record; abi?: Array; stateProps?: Array; errors: CompileError[]; warnings: Warning[]; compilerVersion?: string; contract?: string; md5?: string; structs?: Array; library?: Array; alias?: Array; file?: string; buildType?: string; autoTypedVars?: AutoTypedVar[]; statics?: Array; } export declare enum DebugModeTag { FuncStart = "F0", FuncEnd = "F1", LoopStart = "L0" } export interface DebugInfo { tag: DebugModeTag; contract: string; func: string; context: string; } export interface Pos { file: string; line: number; endLine: number; column: number; endColumn: number; } export interface OpCode { opcode: string; stack?: string[]; topVars?: string[]; pos?: Pos; debugInfo?: DebugInfo; } export interface AutoTypedVar { name: string; pos: Pos; type: string; } export interface ABI { contract: string; abi: Array; } export declare enum ABIEntityType { FUNCTION = "function", CONSTRUCTOR = "constructor" } export declare type ParamEntity = { name: string; type: string; }; export interface ABIEntity { type: ABIEntityType; name?: string; params: Array; index?: number; } export interface StructEntity { name: string; params: Array; } export interface LibraryEntity extends StructEntity { properties: Array; genericTypes: Array; } export interface AliasEntity { name: string; type: string; } export interface StaticEntity { name: string; type: string; const: boolean; value?: any; } export declare function compile(source: { path: string; content?: string; }, settings: { ast?: boolean; asm?: boolean; hex?: boolean; debug?: boolean; desc?: boolean; outputDir?: string; outputToFiles?: boolean; cwd?: string; cmdPrefix?: string; cmdArgs?: string; buildType?: string; timeout?: number; }): CompileResult; export declare function compilerVersion(cwd: string): string | undefined; export declare function getContractName(astRoot: any): string; /** * * @param astRoot AST root node after main contract compilation * @param typeResolver a Type Resolver * @returns All function ABIs defined by the main contract, including constructors */ export declare function getABIDeclaration(astRoot: any, typeResolver: TypeResolver): ABI; /** * * @param astRoot AST root node after main contract compilation * @param dependencyAsts AST root node after all dependency contract compilation * @returns all defined structures of the main contract and dependent contracts */ export declare function getStructDeclaration(astRoot: any, dependencyAsts: any): Array; /** * * @param astRoot AST root node after main contract compilation * @param dependencyAsts AST root node after all dependency contract compilation * @returns all defined Library of the main contract and dependent contracts */ export declare function getLibraryDeclaration(astRoot: any, dependencyAsts: any): Array; /** * * @param astRoot AST root node after main contract compilation * @param dependencyAsts AST root node after all dependency contract compilation * @returns all defined type aliaes of the main contract and dependent contracts */ export declare function getAliasDeclaration(astRoot: any, dependencyAsts: any): Array; /** * * @param astRoot AST root node after main contract compilation * @param dependencyAsts AST root node after all dependency contract compilation * @returns all defined static const int literal of the main contract and dependent contracts */ export declare function getStaticDeclaration(astRoot: any, dependencyAsts: any): Array; /** * Convert the JSON object of the contract description file to CompileResult, and fill in the default values for the partially missing fields * @param description Contract description JSON object * @returns CompileResult */ export declare function desc2CompileResult(description: ContractDescription): CompileResult;