import type { WorkflowEdge, WorkflowNode } from "../editor";
interface CollapseResult {
    nodes: WorkflowNode[];
    edges: WorkflowEdge[];
    /** Per-collapsed-group: how many descendants got hidden. The host UI
     *  reads this to render a "N steps" badge. */
    hiddenCountByGroupId: Map<string, number>;
}
/**
 * Given the canonical graph, return a derived graph that respects the
 * `collapsed` flag on every group node:
 *
 *  - Descendants of a collapsed group are marked `hidden`.
 *  - Edges that crossed the collapse boundary are rewritten: their
 *    source (or target) becomes the collapsed group's id, and the
 *    handle is reset to a synthetic perimeter handle (`__group_out` /
 *    `__group_in`). Internal-to-internal edges are dropped.
 */
export declare function collapseFor(nodes: WorkflowNode[], edges: WorkflowEdge[]): CollapseResult;
/**
 * Toggle the `data.collapsed` flag on a group node. Returns the patched
 * nodes array (immutable). Useful in event handlers.
 */
export declare function toggleGroupCollapse(groupId: string, nodes: WorkflowNode[]): WorkflowNode[];
export {};
//# sourceMappingURL=collapse.d.ts.map