import type { LotStatsSummary } from '../stats/types.js';
import type { WaferMapDisplayItem } from './renderWaferGallery.js';
import { type SaveImageHandler, type SaveTextHandler } from './toolbar.js';
export type InsightsView = 'overview' | 'distributions' | 'correlation';
/** Public option shape for `RenderOptions.insights`/`GalleryOptions.insights`. */
export interface InsightsOptions {
    /**
     * Show an "Insights" tab in the toolbar. Selecting it replaces the canvas/
     * grid with wmap's own chart suite across three sub-tabs — Overview
     * (yield, bins, ring/quadrant yield, test values), Distributions
     * (process capability, boxplot, histogram), and Correlation (matrix +
     * scatter). Default false.
     */
    enabled?: boolean;
    /** Which sub-tab is shown first. Default 'overview'. */
    defaultView?: InsightsView;
}
export interface InsightsTabDeps {
    /** Current gallery/single-wafer items — read fresh each render (a gallery's list can still be building). `null` entries (not-yet-built cards) are skipped. */
    getItems: () => Array<WaferMapDisplayItem | null>;
    /** Precomputed lot-level yield, when the host has one — reused directly instead of recomputing (see stats/yield.ts). Omit when there is no lot (e.g. a single wafer). */
    getLotStats?: () => LotStatsSummary | undefined;
    /** Read fresh each render so a live colour-scheme change is picked up. */
    getColorSchemeName: () => string;
    passBins: number[];
    /** Read fresh each render — used by the Overview tab's ring/quadrant regional yield cards. Default 4. */
    getRingCount?: () => number;
    onSaveImage?: SaveImageHandler;
    /** Optional host hook for the Overview tab's test-values "Export CSV" button — see `saveTextFile` (toolbar.ts). */
    onSaveText?: SaveTextHandler;
    /**
     * Opens one wafer's detail view — omit to disable click-to-open (e.g. a
     * single-wafer host, where the only wafer is already the one on screen).
     * `testNumber`, when given (boxplot leaf-row clicks), asks the host to
     * open the map in test-value mode on that test rather than its default
     * plot mode — so opening from a specific test's boxplot row lands on that
     * same test instead of hard-bin mode.
     */
    openWafer?: (waferIndex: number, label: string, testNumber?: number) => void;
    /** Default sub-tab shown on first render. Default 'overview'. */
    defaultView?: InsightsView;
    /**
     * When provided, the tab bar gets a leading "‹ Map"/"‹ Gallery" tab that
     * exits Insights back to the host's normal view — one visible navigation
     * model (a tab row) instead of relying on the host toolbar's icon-swap
     * toggle alone, whose "way back" is discoverable only via tooltip.
     */
    backTab?: {
        label: string;
        onBack: () => void;
    };
    /**
     * Show this tab's own identity strip (lot/wafer/product/etc.), mounted
     * above the Overview/Distributions/Correlation tab bar so it stays in the
     * same place across every sub-tab. Default true — needed by
     * `renderWaferMap.ts`, whose single-wafer `metadataBadge` overlay sits
     * under this tab's opaque inset:0 root and is fully covered while Insights
     * is open, so this strip is its only identity display there.
     * `renderWaferGallery.ts` sets this false: its own legend strip (built from
     * the same wafer/lot metadata, via the same `buildMetadataStripRow`) stays
     * mounted above the grid/Insights body in both views, so this strip would
     * just be a second, independent copy of the same content — see
     * renderWaferGallery.ts's `rebuildLegend`/`setInsightsOpen`.
     */
    showMetadataStrip?: boolean;
}
export interface InsightsTabHandle {
    /** Append this wherever the tab's content should live; starts hidden (`display: none`). */
    el: HTMLElement;
    /** (Re)builds the tab's content from the current items — call whenever the tab is opened. */
    render: () => void;
    /** Tears down every live panel's observers and removes `el`. */
    destroy: () => void;
}
export declare function createInsightsTab(deps: InsightsTabDeps): InsightsTabHandle;
//# sourceMappingURL=insightsTab.d.ts.map