import type { AgErrorGroupKey, AgErrorMessageKey } from '../api/error'; export interface StudioErrorGroup { key: AgErrorGroupKey; variableValues?: Record; } export interface StudioError { key: AgErrorMessageKey; variableValues?: Record; group?: StudioErrorGroup; suggestions?: string[]; action?: TAction; } /** * Controls how validation issues are handled. * - `report`: dispatch error events via the reporter * - `fix`: apply plan sanitisation actions (e.g. remove unsupported aggregation * fields) and reject the plan entirely if unfixable issues remain */ export interface ValidationMode { report: boolean; fix: boolean; } export declare const DEFAULT_VALIDATION_MODE: ValidationMode; /** Reports validation issues. */ export interface ErrorReporter { report(issues: StudioError[]): void; mode: ValidationMode; } export interface ErrorCollectorAddParams { suggestions?: string[]; group?: StudioErrorGroup; action?: TAction; } /** Interface for collecting validation issues. */ export interface IErrorCollector { readonly issues: StudioError[]; add(key: AgErrorMessageKey, variableValues?: Record, params?: ErrorCollectorAddParams): void; hasIssues(): boolean; report(reporter: ErrorReporter): void; reset(): void; } /** * Collects validation issues. Reporting is separate — call `report()` when ready. */ export declare class ErrorCollector implements IErrorCollector { private readonly parent?; private readonly _issues; constructor(parent?: ErrorCollector | undefined); /** Snapshot of all collected issues. */ get issues(): StudioError[]; /** Add a validation issue. */ add(key: AgErrorMessageKey, variableValues?: Record, params?: ErrorCollectorAddParams): void; /** Whether any issues have been collected. */ hasIssues(): boolean; /** Report all collected issues via the given reporter. */ report(reporter: ErrorReporter): void; /** Reset the collector for reuse. */ reset(): void; }