import { type CSSProperties } from "react"; /** * Public shape of `legendProps`. The `onClick` and `formatter` signatures * intentionally use `unknown` (rather than a hand-rolled Recharts shim) * so the object is structurally assignable to Recharts' own * `` props without needing a peer-dep on `recharts`. * * See kaze-design-system#27 — earlier versions used a narrow custom * `RechartsLegendClickEvent` type which failed to unify with Recharts' * `LegendProps['onClick']`, forcing downstream users to wrap with * `as any`. */ export interface UseLegendToggleResult { /** Whether a given dataKey is currently hidden */ isHidden: (dataKey: string) => boolean; /** Toggle visibility for a given dataKey */ toggle: (dataKey: string) => void; /** Reset all series to visible */ reset: () => void; /** Props to spread onto a Recharts `` */ legendProps: { wrapperStyle: CSSProperties; onClick: (e: unknown) => void; formatter: (value: string, entry: unknown) => React.ReactNode; }; } /** * Hook for toggling Recharts legend entries to hide/show individual series. * * @example * const { isHidden, legendProps } = useLegendToggle(); * return ( * * * * * ); */ export declare function useLegendToggle(): UseLegendToggleResult;