import type { GeoJsonFeature } from "@trackunit/geo-json-utils"; /** * Precomputed geometric facts about a single contended shape — a feature whose * fill overlaps at least one other feature in the same layer. The library * computes these facts; the resolver only orders them. */ export type ContendedShape = Readonly<{ /** The contended feature. Its `id` (stringified) is what the resolver returns. */ feature: GeoJsonFeature; /** Planar area of the feature's fill, used as the stable tiebreak. */ area: number; /** IDs of other contended shapes that fully contain this one. */ containedIn: ReadonlyArray; }>; /** * Decides fill ownership for a set of overlapping shapes. Returns the contended * feature IDs ordered **top-first** — the first ID owns shared pixels, later * IDs are clipped against the winners ahead of them. * * Pure and zoom-invariant: same contended shapes must yield the same ordering. * Swappable per-layer via the `overlap.resolveStackOrder` option on `useShapes`. */ export type ResolveShapeStackOrder = (contended: ReadonlyArray) => ReadonlyArray; /** * Default stack-order policy (ADR-0021 "golden path"). In priority order: * * 1. **Containment** — a shape contained within another ranks above its * container, so the specific inner site beats the broad outer one. * 2. **Smaller area on top** — stable tiebreak; inner shapes are typically * smaller, so this reinforces containment and keeps nested sites visible. */ export declare const defaultShapeStackOrder: ResolveShapeStackOrder;