import type { Die } from '../core/dies.js';
/** Shared row shape for every bar-chart panel (yield, bin pareto, ...). */
export interface ChartDatum {
    label: string;
    value: number;
    percent: number;
    /** Number of items (wafers) pooled into this row — >1 marks a drillable group row. */
    itemCount: number;
    /** Bin code this datum represents — only set for bin-pareto data. */
    binCode?: number;
    /**
     * Stable identity for a leaf row (`itemCount === 1`), independent of
     * `label` — a caller with an `onOpen` callback should resolve back to its
     * own item by `key`, not by re-searching for `label`. Labels are only
     * guaranteed unique when the caller supplies one per item; an item with no
     * `label` falls back to a shared default elsewhere (e.g. `analysisTab.ts`
     * falls back to `''` when both `label` and `wafer.metadata.waferId` are
     * absent), so two rows can carry an identical, ambiguous label — matching
     * on it would silently resolve to the wrong item. Absent on group rows
     * (`itemCount > 1`), which are drilled into rather than opened directly.
     */
    key?: string | number;
}
export interface YieldItem {
    label?: string;
    dies?: Die[];
    /**
     * Precomputed yield percent for this item (e.g. from `analyzeWaferLot`'s
     * `lotYieldSeries[waferIndex].yieldPercent`) — used directly when present.
     * Omit to have it computed from `dies` instead.
     */
    yieldPercent?: number | null;
    /** Carried through to the resulting `ChartDatum.key` unchanged — see its doc comment. */
    key?: string | number;
}
export type YieldSortBy = 'yield' | 'label';
/** One bar per item. */
export declare function buildYieldData(items: YieldItem[], passBins?: number[], sortBy?: YieldSortBy): ChartDatum[];
/**
 * Combined yield: one bar per group, pooling the group's items. The pooled
 * yield is the yield-eligible-die-count-weighted mean of per-item yields —
 * exact for the standard pass/total definition (Σ pass / Σ total =
 * Σ(yield·dies)/Σ dies), *provided* `dies` is the same population the rate
 * was computed over. Weighting uses `yieldEligibleDieCount` (excludes
 * partial/edge-excluded dies), not raw `dies.length` — a per-item
 * `yieldPercent` (own or precomputed, e.g. from `analyzeWaferLot`) already
 * excludes those dies from its own numerator/denominator (`resolveYieldPercent`
 * → `isYieldEligibleDie`), so weighting by the raw count would let a wafer's
 * excluded dies (which count toward yield nowhere else) still skew this
 * combined bar.
 */
export declare function buildYieldDataCombined(groups: {
    key: string;
    items: YieldItem[];
}[], passBins?: number[], sortBy?: YieldSortBy): ChartDatum[];
//# sourceMappingURL=yield.d.ts.map