import { type Die, type PositionedDie, type Wafer } from '../core/index.js';
import type { ReticleConfig } from '../renderer/buildWaferMap.js';
export interface StatsRegion {
    family: 'ring' | 'quadrant' | 'reticle-position' | 'test-site' | 'sector';
    key: string;
    label: string;
    dieKeys: string[];
}
export interface RegionYieldDatum {
    /** Region identity, e.g. `ring:2` or `quadrant:NE` — parse with `parseRegionKey`. */
    key: string;
    label: string;
    /** `(pass / n) × 100`, in [0, 100]. Only present for regions with n > 0 (see filter below). */
    yieldPercent: number;
    /** Yield-eligible, binned die count in this region. */
    n: number;
}
/**
 * Pass/fail yield per region (ring, quadrant, or any other `StatsRegion`
 * family), pooled across one or more wafers. Single source of truth for this
 * computation — consumed by both the summary panel's progress-bar rows and
 * the ring/quadrant yield diagrams, which previously each recomputed the
 * same pass/total tally independently.
 */
export declare function buildRegionYieldData(diesByWafer: Die[][], allWafers: Wafer[], ringCount: number, passBins: number[], regionBuilder: (dies: PositionedDie[], wafer: Wafer, ringCount: number) => StatsRegion[]): RegionYieldDatum[];
/** Compass bearing names for a given sector count, ordered CCW from East. */
export declare function sectorCompassNames(sectorCount: number): string[];
/** True when two quadrants share an edge (NE–NW, NE–SE, NW–SW, SE–SW); diagonals are not adjacent. */
export declare function areQuadrantsAdjacent(a: string, b: string): boolean;
export interface ParsedRegionKey {
    family: StatsRegion['family'] | 'unknown';
    ring?: number;
    quadrant?: string;
    sector?: string;
}
/**
 * Parse a region key (e.g. `ring:2`, `quadrant:NE`, `sector:NNE`) into its
 * structured parts. Always parse identity from the key, never from the label.
 */
export declare function parseRegionKey(key: string): ParsedRegionKey;
export declare function buildRingRegions(dies: PositionedDie[], wafer: Wafer, ringCount: number): StatsRegion[];
export declare function buildQuadrantRegions(dies: PositionedDie[], wafer: Wafer, ringCount: number): StatsRegion[];
export declare function buildReticlePositionRegions(dies: PositionedDie[], reticleConfig: ReticleConfig | undefined): StatsRegion[];
/**
 * Group dies by siteNum for parallel test site analysis.
 *
 * Returns an empty array (suppressing analysis) unless at least 2 distinct
 * siteNum values each appear on MIN_DIES_PER_SITE or more dies — this prevents
 * spurious regions when siteNum is used as a monotonically-increasing counter
 * rather than a true parallel-site identifier.
 *
 * Pass `forceEnable: true` to bypass the guard (e.g. when the caller has already
 * validated the data).
 */
export declare function buildTestSiteRegions(dies: Die[], forceEnable?: boolean): StatsRegion[];
export declare function buildSectorRegions(dies: PositionedDie[], wafer: Wafer, sectorCount: number): StatsRegion[];
//# sourceMappingURL=regions.d.ts.map