import React from 'react'; import { Scale } from '../utils/scales'; import { ChartDataPoint, BarChartDataPoint } from '../types'; /** * Scale configuration for x, y, and color mapping */ export interface ChartScales { /** Scale function for the x-axis */ x: Scale | null; /** Scale function for the y-axis */ y: Scale | null; /** Optional color mapping function */ color?: (index: number, id?: string | number) => string; } /** * Props for the ChartRoot component */ export interface ChartRootProps { /** Chart width in pixels */ width: number; /** Chart height in pixels */ height: number; /** Padding around the plot area */ padding?: { top: number; right: number; bottom: number; left: number; }; /** X-axis domain (numeric range or categorical values) */ xDomain?: [number, number] | string[]; /** Y-axis domain (numeric range) */ yDomain?: [number, number]; /** Chart data points */ data?: ChartDataPoint[] | BarChartDataPoint[]; /** If true, treat xDomain as categories */ categorical?: boolean; /** Children components to render */ children: React.ReactNode; /** Optional custom color assignment function */ colorAssigner?: (index: number, id?: string | number) => string; } /** * Internal chart context value */ interface InternalChartContext { /** Total chart width */ width: number; /** Total chart height */ height: number; /** Padding applied to all sides */ padding: { top: number; right: number; bottom: number; left: number; }; /** Width of the plot area (excluding padding) */ plotWidth: number; /** Height of the plot area (excluding padding) */ plotHeight: number; /** Scale functions for coordinate mapping */ scales: ChartScales; } /** * Hook to access the chart root context * @throws Error if used outside of ChartRoot */ export declare function useChartRoot(): InternalChartContext; /** * Root chart component that provides context for scales and layout */ export declare const ChartRoot: React.FC; export {};