import type { Die } from './dies.js';
export type AggregationMethod = 'mean' | 'median' | 'stddev' | 'min' | 'max' | 'count';
/** Minimal die shape required by aggregation functions — satisfied by both Die and DieResult. */
export interface DieLike {
    x: number;
    y: number;
    testValues?: Record<number, number>;
    /** Recorded per-test pass/fail verdicts (true = pass). Never aggregated — always stripped from outputs. */
    testPass?: Record<number, boolean>;
    hbin?: number;
    sbin?: number;
}
/**
 * Aggregate a per-test-parameter numeric value across a lot of wafers.
 *
 * @param diesByWafer  One `Die[]` per wafer — all wafers must share the same grid layout.
 * @param method       Aggregation function applied per (x,y) position across all wafers.
 * @param paramIndex   Which `die.testValues` key to aggregate — a test number such as
 *                     `1050`, not a positional index (default 0).
 * @returns One Die per unique (x,y) position with the aggregate stored at
 *          `testValues[0]` regardless of the input key. Dies that had no value on any
 *          wafer are included with `testValues: undefined` as a "no data" signal —
 *          they are not filtered out.
 *
 * @example Compute mean test value across a lot:
 * ```ts
 * const lotMean = aggregateValues(diesByWafer, 'mean');
 * const scene = buildView(wafer, lotMean, { plotMode: 'value' });
 * ```
 */
export declare function aggregateValues(diesByWafer: DieLike[][], method: AggregationMethod, paramIndex?: number): DieLike[];
/**
 * Return all unique bin values present in dies, sorted ascending.
 * `binSpace` selects whether to inspect `die.hbin` (default) or `die.sbin`.
 */
export declare function getUniqueBins(dies: Die[], binSpace?: 'hard' | 'soft'): number[];
/**
 * Aggregate multiple wafers by counting, per die position, how many wafers
 * had a specific bin value.
 *
 * Returns one Die per unique (x,y) position (using the first wafer's layout
 * as the spatial template) where:
 *   values[0]  = number of wafers that had targetBin at this position
 *   hbin/sbin  = targetBin (in the appropriate bin space)
 *
 * Use with plotMode: 'value' and valueRange: [0, diesByWafer.length] to get
 * a colour scale that runs from "never" to "always".
 *
 * @param diesByWafer  One Die[] per wafer, all sharing the same grid layout.
 * @param targetBin    The bin value to count.
 * @param binSpace     Which bin space to test — `'hard'` (default) or `'soft'`.
 */
export declare function aggregateBinCounts(diesByWafer: DieLike[][], targetBin: number, binSpace?: 'hard' | 'soft'): DieLike[];
//# sourceMappingURL=aggregates.d.ts.map