import { type ComponentProps, type ComponentType, type ReactNode } from 'react'; import { ResponsiveContainer, Tooltip } from 'recharts'; import type { LegendPayload, TooltipContentProps, TooltipPayloadEntry } from 'recharts'; declare const THEMES: { readonly light: ""; readonly dark: ".dark"; }; export type ChartConfig = { [k in string]: { label?: ReactNode; icon?: ComponentType; } & ({ color?: string; theme?: never; } | { color?: never; theme: Record; }); }; declare const ChartStyle: ({ id, config }: { id: string; config: ChartConfig; }) => import("react").JSX.Element | null; declare const ChartContainer: import("react").ForwardRefExoticComponent & import("react").HTMLAttributes & { config: ChartConfig; children: ComponentProps["children"]; }, "ref"> & import("react").RefAttributes>; declare const ChartTooltip: typeof Tooltip; /** * The one field this component reads off a tooltip entry's *original data row*. * recharts types `Payload['payload']` as `any` (it is whatever datum the caller * charted), so narrow it here to what is actually touched instead of letting * `any` leak into every read below. */ type ChartTooltipDatum = { fill?: string; }; /** A recharts tooltip entry with its `any` datum narrowed to {@link ChartTooltipDatum}. */ type ChartTooltipEntry = Omit, 'payload'> & { payload?: ChartTooltipDatum; }; /** * Props recharts hands a Tooltip `content` component. `TooltipContentProps` * (NOT `ComponentProps`) is the right source: the `Tooltip` * element's own props deliberately OMIT `payload` / `label` / `active`, * which recharts reads from context and injects here at render time. * * `payload` is re-declared because recharts widens it to `ReadonlyArray` * on `TooltipContentProps` even though it hands over the very same entries * `TooltipPayloadEntry` describes. */ type ChartTooltipContentProps = Omit>, 'payload'> & ComponentProps<'div'> & { payload?: ReadonlyArray; hideLabel?: boolean; hideIndicator?: boolean; indicator?: 'line' | 'dot' | 'dashed'; nameKey?: string; labelKey?: string; }; declare const ChartTooltipContent: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; declare const ChartLegend: import("react").MemoExoticComponent<(outsideProps: import("recharts").LegendProps) => React.ReactPortal | null>; declare const ChartLegendContent: import("react").ForwardRefExoticComponent & import("react").HTMLAttributes & { /** Injected by recharts' Legend at render time (same context-injection * contract as the tooltip content above). */ payload?: ReadonlyArray; verticalAlign?: "top" | "middle" | "bottom"; } & { hideIcon?: boolean; nameKey?: string; }, "ref"> & import("react").RefAttributes>; export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle }; //# sourceMappingURL=chart.d.ts.map