import { FLOWDESIGNER_NODE_MOVE_START , FLOWDESIGNER_NODE_APPLY_MOVEMENT , FLOWDESIGNER_NODE_MOVE , FLOWDESIGNER_NODE_MOVE_END , FLOWDESIGNER_NODE_ADD , FLOWDESIGNER_NODE_SET_TYPE , FLOWDESIGNER_NODE_SET_GRAPHICAL_ATTRIBUTES , FLOWDESIGNER_NODE_REMOVE_GRAPHICAL_ATTRIBUTES , FLOWDESIGNER_NODE_SET_DATA , FLOWDESIGNER_NODE_REMOVE_DATA , FLOWDESIGNER_NODE_SET_SIZE , FLOWDESIGNER_NODE_REMOVE , FLOWDESIGNER_NODE_UPDATE , } from '../constants/flowdesigner.constants' ; import { Position } from '../customTypings/index.d' ; param { string } nodeId param { string } nodeType param { Object } attr return { Object } export const addNode = ( nodeId , nodeType ? , { data = { } , graphicalAttributes = { } } = { } ) => ( { type : FLOWDESIGNER_NODE_ADD , nodeId , nodeType , data , graphicalAttributes , } ) ; deprecated export function startMoveNodeTo ( nodeId , nodePosition ) { return { type : FLOWDESIGNER_NODE_MOVE_START , nodeId , nodePosition , } ; } deprecated param { string } nodeId param { { x : number , y : number } } nodePosition return { Object } export function moveNodeTo ( nodeId , nodePosition ) { return { type : FLOWDESIGNER_NODE_MOVE , nodeId , nodePosition , } ; } deprecated param nodesId { array < string > } param movement { Object } return { Object } export const applyMovementTo = ( nodesId , movement ) => ( { type : FLOWDESIGNER_NODE_APPLY_MOVEMENT , nodesId , movement , } ) ; deprecated param { string } nodeId param { { x : number , y : number } } nodePosition return { Object } export function moveNodeToEnd ( nodeId , nodePosition ) { return { type : FLOWDESIGNER_NODE_MOVE_END , nodeId , nodePosition , } ; } deprecated param { string } nodeId param { { height : number , width : number } } nodeSize return { Object } export const setNodeSize = ( nodeId , nodeSize ) => ( { type : FLOWDESIGNER_NODE_SET_SIZE , nodeId , nodeSize , } ) ; deprecated param { string } nodeId param { string } nodeType return { Object } export function setNodeType ( nodeId , nodeType ) { return { type : FLOWDESIGNER_NODE_SET_TYPE , nodeId , nodeType , } ; } deprecated param { string } nodeId param { Object } graphicalAttributes export const setNodeGraphicalAttributes = ( nodeId , graphicalAttributes ) => ( { type : FLOWDESIGNER_NODE_SET_GRAPHICAL_ATTRIBUTES , nodeId , graphicalAttributes , } ) ; deprecated param { string } nodeId param { string } graphicalAttributesKey export const removeNodeGraphicalAttribute = ( nodeId , graphicalAttributesKey ) => ( { type : FLOWDESIGNER_NODE_REMOVE_GRAPHICAL_ATTRIBUTES , nodeId , graphicalAttributesKey , } ) ; deprecated param { string } nodeId param { Object } data param { boolean } bySubmit export const setNodeData = ( nodeId , data , bySubmit ) => ( { type : FLOWDESIGNER_NODE_SET_DATA , nodeId , data , bySubmit , } ) ; deprecated param { string } nodeId param { string } dataKey export const removeNodeData = ( nodeId , dataKey ) => ( { type : FLOWDESIGNER_NODE_REMOVE_DATA , nodeId , dataKey , } ) ; deprecated param { string } nodeId export const removeNode = ( nodeId ) => ( { type : FLOWDESIGNER_NODE_REMOVE , nodeId , } ) ; export const update = ( nodeId , node ) => ( { type : FLOWDESIGNER_NODE_UPDATE , node , nodeId , } ) ;