import { MetadataFile } from "./MetadataFile"; import { RegexViolation, RegexRuleConfig } from "./RegexViolation"; /** * Metadata that defines a regex rule */ export interface RegexRuleInfo { /** Canonical rule ID, e.g., "naming-convention" */ ruleId: string; /** Legacy class name for backward compatibility */ name: string; /** Short label for UI display */ label: string; /** Detailed description of what the rule checks */ description: string; /** Brief summary (5-10 words) */ summary: string; /** Default severity */ severity: "error" | "warning" | "note"; /** Metadata types this rule supports, e.g., ["Flow", "ApexClass"] */ supportedTypes: string[]; /** Documentation references */ docRefs?: Array<{ label: string; path: string; }>; /** Whether the rule accepts configuration options */ isConfigurable: boolean; } /** * Base class for all regex-based rules. * Rules extend this and implement the `check` method. */ export declare abstract class RegexRule { readonly ruleId: string; readonly name: string; readonly label: string; readonly description: string; readonly summary: string; readonly supportedTypes: string[]; readonly docRefs: Array<{ label: string; path: string; }>; readonly isConfigurable: boolean; severity: "error" | "warning" | "note"; constructor(info: RegexRuleInfo); /** * Execute the rule against a metadata file. * Handles type filtering and config merging before calling check(). */ execute(file: MetadataFile, config?: RegexRuleConfig): RegexViolation[]; /** * Abstract method that subclasses implement to perform the actual check. * Should return violations with default severity/message (execute() will override). */ protected abstract check(file: MetadataFile, config?: RegexRuleConfig): RegexViolation[]; /** * Helper to create a violation with common fields populated */ protected createViolation(file: MetadataFile, overrides: Partial): RegexViolation; }