/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** The clear between two ports at one end (px). */ export declare const PORT_GAP = 2; /** Which end of an element a link meets: its source's end, which it leaves, or its destination's start, which it enters. */ export type PortSide = "exit" | "entry"; /** One link's end at an element, as the ports are worked out from it. */ export interface LinkPort { /** * The end it meets, as a key: the element and which of its ends. Links * whose ports name one key share that end, and stack there. */ readonly at: string; /** The element's centre line, down the page: where a lone link meets it. */ readonly centre: number; /** What the link takes of the end across its flow ({@link portSize}). */ readonly size: number; /** Where the link's other end lies, down the page: what the ports at one end are ordered by. */ readonly other: number; } /** * What a link takes of an element's end across its flow: its weight where it * leaves an end, and its head's width — max(8, 2 × weight) — where it enters a * start. * * @param weight - The link's weight: its stroke's width * @param side - Which end it meets * @returns The size, in px */ export declare function portSize(weight: number, side: PortSide): number; /** * Each link's port: where it meets its element, down the page. * * The `n` ports at one end stack about its centre line `c`, in the order of * their other ends, topmost first (and in the order given where two lie * level): the stack is `T = Σ s + 2(n − 1)` tall, and port `i` sits at * `c − T/2 + Σ_{j