|
import { type Transform, type XYPosition, type Rect, type NodeOrigin, type NodeBase, type EdgeBase, type FitViewParamsBase, type FitViewOptionsBase, CoordinateExtent, OnError, OnBeforeDeleteBase, NodeLookup, InternalNodeBase, NodeDragItem } from '../types'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export declare const isEdgeBase: <EdgeType extends EdgeBase = EdgeBase>(element: any) => element is EdgeType; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export declare const isNodeBase: <NodeType extends NodeBase = NodeBase>(element: any) => element is NodeType; |
|
export declare const isInternalNodeBase: <NodeType extends InternalNodeBase = InternalNodeBase>(element: any) => element is NodeType; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export declare const getOutgoers: <NodeType extends NodeBase = NodeBase, EdgeType extends EdgeBase = EdgeBase>(node: NodeType | { |
|
id: string; |
|
}, nodes: NodeType[], edges: EdgeType[]) => NodeType[]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export declare const getIncomers: <NodeType extends NodeBase = NodeBase, EdgeType extends EdgeBase = EdgeBase>(node: NodeType | { |
|
id: string; |
|
}, nodes: NodeType[], edges: EdgeType[]) => NodeType[]; |
|
export declare const getNodePositionWithOrigin: (node: NodeBase, nodeOrigin?: NodeOrigin) => XYPosition; |
|
export type GetNodesBoundsParams<NodeType extends NodeBase = NodeBase> = { |
|
nodeOrigin?: NodeOrigin; |
|
nodeLookup?: NodeLookup<InternalNodeBase<NodeType>>; |
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export declare const getNodesBounds: <NodeType extends NodeBase = NodeBase>(nodes: (NodeType | InternalNodeBase<NodeType> | string)[], params?: GetNodesBoundsParams<NodeType>) => Rect; |
|
export type GetInternalNodesBoundsParams<NodeType> = { |
|
useRelativePosition?: boolean; |
|
filter?: (node: NodeType) => boolean; |
|
}; |
|
|
|
|
|
|
|
|
|
export declare const getInternalNodesBounds: <NodeType extends NodeDragItem | InternalNodeBase>(nodeLookup: Map<string, NodeType>, params?: GetInternalNodesBoundsParams<NodeType>) => Rect; |
|
export declare const getNodesInside: <NodeType extends NodeBase = NodeBase>(nodes: Map<string, InternalNodeBase<NodeType>>, rect: Rect, [tx, ty, tScale]?: Transform, partially?: boolean, excludeNonSelectableNodes?: boolean) => InternalNodeBase<NodeType>[]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
export declare const getConnectedEdges: <NodeType extends NodeBase = NodeBase, EdgeType extends EdgeBase = EdgeBase>(nodes: NodeType[], edges: EdgeType[]) => EdgeType[]; |
|
export declare function getFitViewNodes<Params extends NodeLookup<InternalNodeBase<NodeBase>>, Options extends FitViewOptionsBase<NodeBase>>(nodeLookup: Params, options?: Pick<Options, 'nodes' | 'includeHiddenNodes'>): NodeLookup; |
|
export declare function fitView<Params extends FitViewParamsBase<NodeBase>, Options extends FitViewOptionsBase<NodeBase>>({ nodes, width, height, panZoom, minZoom, maxZoom }: Params, options?: Omit<Options, 'nodes' | 'includeHiddenNodes'>): Promise<boolean>; |
|
|
|
|
|
|
|
|
|
|
|
|
|
export declare function calculateNodePosition<NodeType extends NodeBase>({ nodeId, nextPosition, nodeLookup, nodeOrigin, nodeExtent, onError, }: { |
|
nodeId: string; |
|
nextPosition: XYPosition; |
|
nodeLookup: NodeLookup<InternalNodeBase<NodeType>>; |
|
nodeOrigin?: NodeOrigin; |
|
nodeExtent?: CoordinateExtent; |
|
onError?: OnError; |
|
}): { |
|
position: XYPosition; |
|
positionAbsolute: XYPosition; |
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export declare function getElementsToRemove<NodeType extends NodeBase = NodeBase, EdgeType extends EdgeBase = EdgeBase>({ nodesToRemove, edgesToRemove, nodes, edges, onBeforeDelete, }: { |
|
nodesToRemove: Partial<NodeType>[]; |
|
edgesToRemove: Partial<EdgeType>[]; |
|
nodes: NodeType[]; |
|
edges: EdgeType[]; |
|
onBeforeDelete?: OnBeforeDeleteBase<NodeType, EdgeType>; |
|
}): Promise<{ |
|
nodes: NodeType[]; |
|
edges: EdgeType[]; |
|
}>; |
|
|