import * as ts from "typescript"; import type { LintRule, LintContext, Severity, Category } from "./rule.js"; /** * Condition for matching nodes within a selector result. */ export interface MatchCondition { /** RegExp pattern to match the node's text */ pattern?: RegExp; /** Selector name — only match if node is within a parent matching this selector */ within?: string; /** Require specific child selector(s) to be present */ require?: string | string[]; /** Named check to evaluate */ check?: string; } /** * Declarative fix description. */ export interface DeclarativeFix { /** Kind of fix operation */ kind: "replace" | "insert-before" | "insert-after" | "delete"; /** Static replacement text */ text?: string; /** Dynamic resolve function for the replacement text */ resolve?: (node: ts.Node, sf: ts.SourceFile) => string; } /** * Specification for a declarative lint rule. */ export interface RuleSpec { /** Unique rule ID */ id: string; /** Severity level */ severity: Severity; /** Category for grouping */ category: Category; /** Human-readable description of what this rule checks */ description?: string; /** Link to rule documentation */ helpUri?: string; /** Selector name (or compound) to find target nodes */ selector: string; /** Optional match condition to further filter nodes */ match?: MatchCondition; /** Message template. `{node}` is replaced with the node's text. */ message: string; /** Optional fix to apply */ fix?: DeclarativeFix; /** Optional custom validation function */ validate?: (node: ts.Node, context: LintContext) => boolean; } /** * Build a standard LintRule from a declarative RuleSpec. */ export declare function rule(spec: RuleSpec): LintRule; //# sourceMappingURL=declarative.d.ts.map