import type { ChartDatum } from '../../stats/yield.js';
import { type SaveImageHandler } from './chartShell.js';
export interface ChartPanel {
    title: string;
    data: ChartDatum[];
    barColor?: (datum: ChartDatum, index: number) => string;
    valueLabel?: (datum: ChartDatum) => string;
    /**
     * Optional self-contained segmented control (yield sort, hard/soft bins).
     * When present the panel renders a radio group and, on change, recomputes
     * its own data and redraws in place.
     */
    selfControl?: {
        current: string;
        options: Array<[value: string, label: string]>;
        onChange: (value: string) => {
            data: ChartDatum[];
            title?: string;
        };
    };
    /**
     * In-place drill-down for a grouped row (`itemCount > 1`). When present,
     * clicking such a row calls `onOpenGroup`, which returns the detail
     * data/title to redraw in place (no modal, no grid rebuild) and shows a
     * Back button; clicking it calls `onBack`, which returns the overview
     * data/title.
     */
    drill?: {
        onOpenGroup: (datum: ChartDatum) => {
            data: ChartDatum[];
            title: string;
        };
        onBack: () => {
            data: ChartDatum[];
            title: string;
        };
        groupLabelText: string;
    };
    /**
     * Clicking a leaf row (`itemCount === 1` — a single wafer, whether reached
     * directly or by drilling into a group first) calls this to open that
     * wafer's map. A group row (`itemCount > 1`, drill not yet active) drills
     * instead, via `drill.onOpenGroup` — this is never called for those.
     */
    onOpen?: (datum: ChartDatum) => void;
}
export interface BarPanelHandle {
    card: HTMLElement;
    destroy: () => void;
}
export declare function renderBarPanel(panel: ChartPanel, onSaveImage?: SaveImageHandler): BarPanelHandle;
//# sourceMappingURL=barPanel.d.ts.map