import type { IBoardConnectorEndpoint, IBoardConnectorLabel, IBoardConnectorMarker, IBoardConnectorPoint, IBoardConnectorSharedRailData, IBoardElementTransform } from '../board.type';
import type { IBoardElementData } from '../services/board-element.service';
export interface IBoardGraphLayoutOptions {
    elementIds?: string[];
    /** Preserve node frames. Their automatic connector ports may still be redistributed. */
    fixedElementIds?: string[];
    /** Known return relations that must not advance forward ranks. Their bindings and manual routing remain intact. */
    feedbackConnectorIds?: string[];
    direction?: 'horizontal' | 'vertical';
    layerGap?: number;
    itemGap?: number;
    origin?: {
        x: number;
        y: number;
    };
    maxNodes?: number;
}
export type IBoardLayoutOptions = ({
    mode: 'graph';
    maximumWidthGrowth?: number;
} & IBoardGraphLayoutOptions) | {
    mode: 'routes';
    connectorIds?: readonly string[];
} | {
    mode: 'ports';
    connectorIds?: readonly string[];
} | {
    mode: 'labels';
    connectorIds?: readonly string[];
} | {
    mode: 'text';
    elementIds: readonly string[];
    maximumWidthGrowth?: number;
};
export interface IBoardLayoutPatch {
    elementId: string;
    transform?: IBoardElementTransform;
    start?: IBoardConnectorEndpoint;
    end?: IBoardConnectorEndpoint;
    labels?: IBoardConnectorLabel[];
    route?: {
        points: IBoardConnectorPoint[];
        sharedRail?: IBoardConnectorSharedRailData;
    };
}
export interface IBoardLayoutDiagnostic {
    code: string;
    elementIds: string[];
    severity?: 'error' | 'warning';
    labelIds?: string[];
}
export interface IBoardLayoutPlan {
    unitId: string;
    pageId: string;
    status: 'ready' | 'incomplete';
    /** Exact layout dependencies, used only to reject stale plans, never to restore content. */
    preconditions: {
        elementId: string;
        layoutState: string;
    }[];
    patches: IBoardLayoutPatch[];
    diagnostics: IBoardLayoutDiagnostic[];
    metrics: {
        movedElementCount: number;
        connectorCount: number;
        feedbackConnectorCount: number;
    };
}
export declare function createBoardLayoutPlan(unitId: string, pageId: string, data: Record<string, IBoardElementData>, patches: IBoardLayoutPatch[], diagnostics?: IBoardLayoutDiagnostic[]): IBoardLayoutPlan;
export declare function isBoardLayoutPlanCurrent(plan: IBoardLayoutPlan, data: Record<string, IBoardElementData>): boolean;
export declare function graphMarkerBudget(marker: IBoardConnectorMarker | undefined, stroke: number, endpointInset?: number): number;
/** Deterministic layered planning. Native structured layouts remain owned by their plugins. */
export declare function planBoardGraphLayout(unitId: string, pageId: string, source: Record<string, IBoardElementData>, options?: IBoardGraphLayoutOptions): IBoardLayoutPlan;
