import { ReactElement } from 'react'; import { ChartController, ChartProps, ChartLegendValue, ChartComparisonContext, ChartCompareConfig, ChartFillTreatment } from '../types'; import { PaintKind } from '../paint'; import { CartesianChartModel } from '../model/cartesian-model'; import { ChartSnapshot } from '../chart-context'; type ModelChartProps = Omit, 'data' | 'x' | 'series' | 'selectedCategoryId' | 'onSelectedCategoryIdChange' | 'compare' | 'visibleSeries' | 'onVisibleSeriesChange'> & { model: CartesianChartModel; compare?: boolean | (Omit & { series?: NoInfer; }); visibleSeries?: readonly NoInfer[]; onVisibleSeriesChange?: (series: readonly NoInfer[]) => void; }; export interface LegendSnapshot { series: readonly (ChartLegendValue & { color: string; kind: PaintKind; treatment: ChartFillTreatment; dasharray?: string; visible: boolean; })[]; reducedMotion: boolean; comparison: ChartComparisonContext | null; observations: readonly { id: string; x: number; row: unknown; sourceIndex: number; label: string; values: Readonly>; formattedValues: Readonly>; statuses: Readonly>; }[]; inspectedX: number | null; pinnedX: number | null; onInspect: (x: number, pinned: boolean) => void; onClearInspect: () => void; onReleaseInspect: () => void; onFocus: (id: string | null) => void; onVisibleChange: (ids: readonly string[]) => void; isolatedId: string | null; onIsolate: (id: string) => void; onRestore: () => void; onShowAll: () => void; } export interface ToolkitSnapshot { comparison: ChartComparisonContext | null; toolbar: { label: string; pressed: boolean; onClick: () => void; } | null; readout: string | null; overview: { range: { startX: number; endX: number; }; series: string; snapshot: ChartSnapshot; } | null; brush: { snapshot: ChartSnapshot; range: { startX: number; endX: number; } | null; seriesId: string; reducedMotion: boolean; onFocus: (range: { startX: number; endX: number; } | null) => void; } | null; legend: LegendSnapshot | null; } export interface ToolkitStore { getSnapshot: () => ToolkitSnapshot; subscribe: (listener: () => void) => () => void; publish: (snapshot: ToolkitSnapshot) => void; } export interface RuntimeContextValue { props: Omit, 'children' | 'className' | 'style' | 'controller'>; controller: ChartController; linked: boolean; toolkit: ToolkitStore; model?: CartesianChartModel; } export declare function Chart(props: ModelChartProps): ReactElement; export declare function Chart(props: ChartProps): ReactElement; export declare function useChartRuntime(): RuntimeContextValue; export declare function useToolkitSnapshot(): ToolkitSnapshot; /** Read comparison data/actions without opting in to any presentation. */ export declare function useChartComparison(): ChartComparisonContext | null; export {};