UNPKG

hardhat-output-validator

Version:

Zero-config Hardhat plugin to check the build output of Solidity contracts

145 lines 3.75 kB
import { CompilerOutputContract } from 'hardhat/types'; import { HardhatUserConfig } from 'hardhat/types/config'; export interface HardhatUserConfigExtended extends HardhatUserConfig { outputValidator: PluginConfig; } export interface PluginConfig { include: string[]; exclude: string[]; runOnCompile: boolean; errorMode: boolean; strict: boolean; checks: Checks; } export interface Checks { title?: Severity; details?: Severity; compilationWarnings?: Severity; missingUserDoc?: Severity; missingDevDoc?: Severity; events?: Severity; functions?: Severity; variables?: Severity; params?: Severity; returns?: Severity; ctor?: Severity; devDoc?: DocChecks; userDoc?: UserDocChecks; } export interface DocChecks { events?: Severity; functions?: Severity; variables?: Severity; ctor?: Severity; } export interface UserDocChecks extends DocChecks { } export declare type SeverityLevel = 'error' | 'warning'; export declare type Severity = SeverityLevel | false; export interface ErrorInfo { type: ErrorType; severityLevel: SeverityLevel; text: string; at: string; filePath: string; fileName: string; } export declare enum ErrorType { MissingTitle = 0, MissingDetails = 1, CompilationWarning = 2, MissingUserDoc = 3, MissingDevDoc = 4, MissingParams = 5, MissingReturnParams = 6, MissingAllParams = 7, MissingAllReturnParams = 8, MissingUserOrDevDoc = 9 } declare interface ErrorUserdocArrayItem { notice?: string; } export interface ErrorDevdocArrayItem { details?: string; params?: { [key: string]: string; }; } export declare type AddErrorFunc = (errorType: ErrorType, severityLevel: SeverityLevel, extraData?: any) => void; export declare type ErrorHandler = { addError: AddErrorFunc; getAll: () => ErrorInfo[]; }; export interface CompilerOutputContractWithDocumentation extends CompilerOutputContract { devdoc?: { author?: string; details?: string; title?: string; errors?: { [key: string]: ErrorDevdocArrayItem[]; }; events?: { [key: string]: { details: string; params: { [key: string]: string; }; }; }; methods?: { [key: string]: { details?: string; params: { [key: string]: string; }; returns: { [key: string]: string; }; }; }; returns?: { [key: string]: { details?: string; params: { [key: string]: string; }; }; }; stateVariables?: { [key: string]: { details?: string; params: { [key: string]: string; }; returns: { [key: string]: string; }; }; }; }; userdoc?: { errors?: { [key: string]: ErrorUserdocArrayItem[]; }; events?: { [key: string]: { notice: string; }; }; methods?: { [key: string]: { notice: string; }; }; notice?: string; }; } export interface CompilerOutputWithDocsAndPath extends CompilerOutputContractWithDocumentation { filePath: string; fileName: string; } export declare type ErrorObj = { [file: string]: ErrorInfo[]; }; export {}; //# sourceMappingURL=types.d.ts.map