import type { IntlShape } from 'react-intl'; import type { XYChartSelectionRectangleMetadata } from '../../hooks/useSortRectangleDatapoints.js'; import type { AxisIdToScaleDomain, MapDatapoints, SeriesToMetadata, XYChartAxisInternal, XYChartSeriesWithDatapoints, XYChartVariantsInternal } from '../../types/xy-chart-internals.js'; import type { XYChartSelectionLinearMetadata } from '../../types/xy-chart-selection.js'; import type { XYChartColorPalette, XYChartData } from '../../types/xy-chart.js'; export type ControlFlowCommand = 'continue' | void; export interface SeriesProcessingStrategy { canHandle(seriesProps: XYChartVariantsInternal): boolean; preprocess?(data: XYChartData[], seriesProps: XYChartVariantsInternal, xAxis: XYChartAxisInternal, yAxis: XYChartAxisInternal, context?: MutableProcessingContext): void; process(datum: XYChartData, seriesProps: XYChartVariantsInternal, xAxis: XYChartAxisInternal, yAxis: XYChartAxisInternal, context: MutableProcessingContext): ControlFlowCommand; } export interface MutableProcessingContext { seriesMap: Map; seriesWithDatapoints: Array; seriesToMetadata: SeriesToMetadata; axisIdToScaleDomain: AxisIdToScaleDomain; seriesIndexes: string[]; intl: IntlShape; colorPalette?: XYChartColorPalette; datapointMetadataMap: MapDatapoints; filteredSeriesIds?: Set; axisWithSeries: Set; } export interface SeriesConstructor { addValue: (point: T) => void; } export type RectSeriesConstructor = SeriesConstructor; export type DotSeriesConstructor = SeriesConstructor; export type LineSeriesConstructor = SeriesConstructor; export type BarSeriesConstructor = SeriesConstructor; export type AreaSeriesConstructor = SeriesConstructor;