import { Type_Side } from './ElementsAttributesConfig'; /** Laquelle des deux règles dispose la face (cf. l'en-tête). */ export type Type_IOOrderPolicy = 'reach' | 'anchor'; export type Type_IOGeo = { side: Type_Side; ox: number; oy: number; turning?: boolean; curve_node: number; stack_ref?: number; bundle_tie?: number; }; /** * Signed ordinal that keeps a bundle of parallel links (same source, same target, same * sides) UNTWISTED across its two endpoints. The band linking two convex node boundaries * flips orientation, so the members must be laid CCW at the source and CW at the target. * With `ord` a stable per-link ordinal shared by both ends, the SOURCE end signs it by the * side's index-vs-CCW factor and the TARGET end by its opposite — so ascending sort places * the same member at mirror slots (e.g. leftmost at the source ↔ bottommost at the target * when the flow descends and turns right). `ord` must be identical from both ends (e.g. the * link's index in the sankey's global links list). */ export declare function bundleTie(side: Type_Side, is_source: boolean, ord: number): number; /** * Centre of a recycling link's central run — the "belly" of the loop, i.e. the straight * span drawn between the two curvature points. Mirrors * `LinkControlPoints.computeMiddleRecyclingPoint`, with one deliberate difference: it is * built on the node CENTRES rather than on the link's attachment points. The attachments * depend on each link's slot, i.e. on the very order being computed — feeding them back * in would make the order depend on its own previous result and let it oscillate between * two recomputations. Node centres keep this a pure function of the layout, and match the * convention used by the rest of the rule. The residual gap (at most half a node) never * decides the split on its own: the belly sits `middle_recycling + 2·thickness` clear of * the lower node. * * @param sx,sy source node centre * @param tx,ty target node centre * @param middle_recycling `shape_middle_recycling` — offset of the belly (negative = above) * @param thickness the link's drawn thickness * @param orientation `shape_orientation` ('hh' horizontal, 'vv' vertical, else diagonal) */ export declare function recyclingBellyCentre(sx: number, sy: number, tx: number, ty: number, middle_recycling: number, thickness: number, orientation: string): { x: number; y: number; }; /** * Order a node's I/O items with the gated direction-split + height policy. * * @param items each link paired with its geometry (opposite node centre, side, * node-side curvature and the `turning` flag) * @param nx,ny reference node centre * @param use_curve ADVANCED mode : break height ties by the node-side anchor distance * reach·curve_node. SIMPLE mode passes false (curvature ignored). * @returns the items in display order : side groups concatenated in side-priority * order, each side ordered top→bottom (left/right) or left→right (top/bottom). */ export declare function orderIOByGeometry(items: { item: T; geo: Type_IOGeo; }[], nx: number, ny: number, use_curve?: boolean, policy?: Type_IOOrderPolicy): T[];