sol-merger
Version:
Merges all import files into single file.
50 lines (49 loc) • 1.58 kB
TypeScript
import { ContractLikeExportType, ExportType } from './types';
export type ExportsAnalyzerResult = ExportsAnalyzerResultContractLike | ExportsAnalyzerResultConstant | ExportsAnalyzerResultFunction | ExportsAnalyzerResultUserDefinedValueType | ExportsAnalyzerResultUsingDirective;
export interface ExportsAnalyzerResultContractLike {
abstract: boolean;
type: ContractLikeExportType;
name: string;
is: string;
body: string;
}
export interface ExportsAnalyzerResultConstant {
type: ExportType.constant;
name: string;
body: string;
typeName: string;
}
export interface ExportsAnalyzerResultFunction {
type: ExportType.function;
name: string;
body: string;
}
export interface ExportsAnalyzerResultUserDefinedValueType {
type: ExportType.userDefinedValueType;
name: string;
body: string;
}
export interface ExportsAnalyzerResultUsingDirective {
type: ExportType.usingDirective;
name: string;
body: string;
}
export declare class ExportsAnalyzer {
private contents;
constructor(contents: string);
/**
* Analyzes all the exports of the file (Contract, Interface, Library)
*
* Single export statement to process. Basically it analyzes next things:
*
* 1. Get the type of the export
* 2. Get the body of the export
* 3. Get inheritance of the specifier
*
*/
analyzeExports(): ExportsAnalyzerResult[];
private analyzeExportConstant;
private analyzeExportFunction;
private analyzeExportUserDefinedValueType;
private analyzeUsingDirective;
}