import { type LogIssue, type LogLevel, type Logger } from 'ag-charts-core'; import type { AgChartValidationIssueEvent, AgChartValidationsOptions } from 'ag-charts-types'; import type { ChartRegistry } from '../../module/moduleContext'; export type ValidationSeverity = LogLevel; export type ValidationIssue = LogIssue; export type GroupedValidationIssues = Record; export type ValidationIssueListener = (event: AgChartValidationIssueEvent) => void; /** * The phase of an update that re-raises a live issue if it still holds: `data` for data processing, `update` * for everything else in a pass that re-evaluates callbacks. An issue raised outside any pass is `update`. */ export type ValidationPass = 'data' | 'update'; /** The order the overlay renders its severity sections in. */ export declare const SEVERITY_ORDER: ValidationSeverity[]; /** The `validations` subtree of options not yet known to be valid: public keys, unknown values. */ type UnvalidatedValidations = { [K in keyof AgChartValidationsOptions]?: unknown; }; export declare function getValidations(options: unknown): UnvalidatedValidations | undefined; /** The three services a validations pass needs; a chart context supplies them, and so does a provisional set. */ export type ValidationsRuntime = Pick; /** For an options pass that runs before the chart owning it exists; `ChartOptions.adopt()` hands over. */ export declare function createProvisionalRuntime(logger: Logger): ValidationsRuntime; /** * The single subscriber to `validation:issue`, implementing the four `validations` options as reactions * to the one event: `consoleOn` gates the Logger, `showOverlayOn` selects from the collection kept here, * `issueRaised` is told once per issue, and `throwOn` throws from inside the logging call. */ export declare class ChartValidations { private readonly logger; private readonly eventsHub; private readonly cleanup; private readonly collection; /** The phase each live-raised issue belongs to; issues a cycle installed have no entry and outlive passes. */ private readonly passOf; private readonly raisedInPass; private readonly openPasses; private showOverlayMask; private throwMask; private failFastSuppressed; private dismissed; private listener?; /** Keys already told to `listener`, so a re-raised issue is told once per listener, as `warnOnce` prints once. */ private readonly told; private readonly pendingDispatch; private dispatching; private reportingListenerError; constructor(ctx: Pick & Partial>); destroy(): void; /** * Accepts an unvalidated `validations` subtree. An unusable value falls back: `consoleOn` to everything, * so it cannot silence the warning that reports it, and the other three to nothing. */ configure(raw: unknown): void; /** Selects the severities the overlay shows; compared by content, since callers allocate a fresh array per pass. */ setShowOverlayOn(selected: readonly ValidationSeverity[]): void; /** Holds fail-fast off for a pass with no caller to throw to (a CSS-variable refresh from a DOM event). */ suspendFailFast(): () => void; /** The issues currently collected, oldest first. */ get issues(): LogIssue[]; /** * Replaces the collection with what a re-validating pass raised. `handledBy` is the instance the pass * reported through; what it or this instance already told the same listener is not told again. */ beginCycle(issues: readonly LogIssue[], handledBy?: ChartValidations): void; /** Opens a phase that re-raises every issue of its kind that still holds; `endPass` drops the rest. */ beginPass(pass: ValidationPass): void; /** Closes the phase. A completed pass retires the issues it owns that it did not raise again; an aborted one keeps them. */ endPass(pass: ValidationPass, completed?: boolean): void; dismiss(): void; hasVisibleIssues(): boolean; getVisibleIssues(): GroupedValidationIssues; private sameKeys; private onIssue; private dispatch; private reportListenerError; } export {};