feat(flow): Add event listener to vueflow object

* event listener also exist in store state (hooksOn)
* add applyChangesHandlers to vueflow object, can be used to apply changes i.e. deleting etc.

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-12-20 19:29:52 +01:00
parent a604dd8ab1
commit d875cfede3
5 changed files with 54 additions and 10 deletions
+8
View File
@@ -3,6 +3,8 @@ import { GraphEdge, Edge } from './edge'
import { GraphNode, CoordinateExtent, Node } from './node'
import { ConnectionLineType, ConnectionMode } from './connection'
import { KeyCode, PanOnScrollMode, UseZoomPanHelper } from './zoom'
import { FlowStore } from './store'
import { EdgeChange, FlowHooksOn, NodeChange } from './hooks'
export type FlowElement<N = any, E = any> = GraphNode<N> | GraphEdge<E>
export type FlowElements<N = any, E = any> = FlowElement<N, E>[]
@@ -116,3 +118,9 @@ export interface FlowProps<N = any, E = N> {
}
export type FlowOptions<N = any, E = N> = FlowProps<N, E>
export type UseVueFlow = {
store: FlowStore
applyNodeChanges: (changes: NodeChange[]) => void
applyEdgeChanges: (changes: EdgeChange[]) => void
} & FlowHooksOn