import type { Die } from '../core/dies.js';
import { type TestDef } from '../renderer/buildWaferMap.js';
export interface CapabilityDatum {
    testNumber: number;
    label: string;
    unit?: string;
    /**
     * Whether this test has both `limitLow` and `limitHigh` defined. When
     * false, `lsl`/`usl`/`cp`/`cpk`/`pp`/`ppk` are all absent/null — there is
     * no spec to measure capability against — and the five-number summary
     * below is normalized onto the test's own observed [min, max] instead of
     * [lsl, usl].
     */
    hasSpec: boolean;
    lsl?: number;
    usl?: number;
    mean: number;
    /** Sample stddev, ddof=1, pooled across every die across all items. */
    stdOverall: number;
    /** Pooled within-wafer sample stddev. NaN if no item contributed ≥2 values. */
    stdWithin: number;
    n: number;
    /** Cp/Cpk use `stdWithin`; null when stdWithin is NaN or 0, or when `hasSpec` is false. */
    cp: number | null;
    cpk: number | null;
    /** Pp/Ppk use `stdOverall`; null when stdOverall is 0, or when `hasSpec` is false. */
    pp: number | null;
    ppk: number | null;
    /**
     * Five-number summary of all values, normalized: `(v - lsl) / (usl - lsl)`
     * when `hasSpec`, otherwise `(v - dataMin) / (dataMax - dataMin)` (0.5 for
     * every value when the test has zero variance).
     */
    min: number;
    q1: number;
    median: number;
    q3: number;
    max: number;
}
export interface CapabilityItem {
    /** One item's dies — typically one wafer, the natural short-term subgroup for Cp/Cpk. */
    dies?: Die[];
}
/**
 * Process-capability data for every test in `testDefs` that has at least one
 * recorded value. Tests with both `limitLow` and `limitHigh` defined get the
 * full Cp/Cpk/Pp/Ppk treatment, normalized onto [0,1] via their spec (see
 * `CapabilityDatum.hasSpec`); tests with only one limit or none still appear
 * (`hasSpec: false`), normalized onto their own observed range instead, so a
 * lot where most tests lack full limits doesn't render as an empty chart.
 * Sorted spec'd-first (worst-Ppk-first within that tier), then unspec'd
 * (most-variable-first within that tier) — see the sort at the bottom.
 */
export declare function buildCapabilityData(items: CapabilityItem[], testDefs: TestDef[]): CapabilityDatum[];
//# sourceMappingURL=capability.d.ts.map