import type { XYPosition, Dimensions, NodeBase, EdgeBase } from '.'; export type NodeDimensionChange = { id: string; type: 'dimensions'; dimensions?: Dimensions; resizing?: boolean; setAttributes?: boolean | 'width' | 'height'; }; export type NodePositionChange = { id: string; type: 'position'; position?: XYPosition; positionAbsolute?: XYPosition; dragging?: boolean; }; export type NodeSelectionChange = { id: string; type: 'select'; selected: boolean; }; export type NodeRemoveChange = { id: string; type: 'remove'; }; export type NodeAddChange = { item: NodeType; type: 'add'; index?: number; }; export type NodeReplaceChange = { id: string; item: NodeType; type: 'replace'; }; /** * The [`onNodesChange`](/api-reference/react-flow#on-nodes-change) callback takes *an array of `NodeChange` objects that you should use to update your flow's state. *The `NodeChange` type is a union of six different object types that represent that *various ways an node can change in a flow. * @public */ export type NodeChange = NodeDimensionChange | NodePositionChange | NodeSelectionChange | NodeRemoveChange | NodeAddChange | NodeReplaceChange; export type EdgeSelectionChange = NodeSelectionChange; export type EdgeRemoveChange = NodeRemoveChange; export type EdgeAddChange = { item: EdgeType; type: 'add'; index?: number; }; export type EdgeReplaceChange = { id: string; item: EdgeType; type: 'replace'; }; /** * The [`onEdgesChange`](/api-reference/react-flow#on-edges-change) callback takes *an array of `EdgeChange` objects that you should use to update your flow's state. *The `EdgeChange` type is a union of four different object types that represent that *various ways an edge can change in a flow. * * @public */ export type EdgeChange = EdgeSelectionChange | EdgeRemoveChange | EdgeAddChange | EdgeReplaceChange; //# sourceMappingURL=changes.d.ts.map