import type { XyJsonDiagnostic } from '../lib/index.ts';
import type { RuleLevel } from './package/index.ts';
import type { ActionResult } from './result.ts';
export interface RuleRunnerConfig {
    rules?: Record<string, unknown>;
}
export interface RuleCheckContext {
    fix: boolean;
    isExplicit: boolean;
    level: RuleLevel;
}
export interface RuleCheckDiagnostic extends XyJsonDiagnostic {
    level?: Exclude<RuleLevel, 'off'>;
}
export interface RuleCheckOutcome {
    diagnostics?: RuleCheckDiagnostic[];
    fixedCount?: number;
}
export interface RuleCheckDefinition<TContext = void> {
    aliases?: string[];
    check: (context: TContext, rule: RuleCheckContext) => Promise<RuleCheckOutcome> | RuleCheckOutcome;
    defaultLevel: RuleLevel;
    description?: string;
    fixable?: boolean;
    id: string;
}
export interface RuleRunDiagnostic extends XyJsonDiagnostic {
    level: Exclude<RuleLevel, 'off'>;
    rule: string;
}
export interface RuleRunReport {
    diagnostics: RuleRunDiagnostic[];
    errorCount: number;
    fixedCount: number;
    warningCount: number;
}
export interface RuleRunResult extends ActionResult {
    envelope: ActionResult['envelope'] & {
        data: RuleRunReport;
        errors?: RuleRunDiagnostic[];
        warnings?: RuleRunDiagnostic[];
    };
}
export interface RuleRunnerReporter<TContext = unknown> {
    diagnostic?: (diagnostic: RuleRunDiagnostic) => void;
    fixed?: (rule: RuleCheckDefinition<TContext>, fixedCount: number) => void;
    passed?: (rule: RuleCheckDefinition<TContext>) => void;
}
export interface RunRuleChecksParams<TContext = void> {
    commandName: string;
    config?: RuleRunnerConfig;
    configKey?: string;
    context: TContext;
    fix?: boolean;
    reporter?: RuleRunnerReporter<TContext>;
    rules: RuleCheckDefinition<TContext>[];
    strict?: boolean;
}
export declare function isRuleLevel(value: unknown): value is RuleLevel;
export declare function parseRuleLevelSetting(location: string, setting: unknown, defaultLevel: RuleLevel): RuleLevel;
export declare function defaultRuleReporter<TContext = unknown>(): RuleRunnerReporter<TContext>;
export declare function runRuleChecks<TContext = void>({ commandName, configKey, config, context, fix, reporter, rules, strict, }: RunRuleChecksParams<TContext>): Promise<RuleRunResult>;
//# sourceMappingURL=ruleRunner.d.ts.map