update: Flow instance provides update node internals func
* Rename onLoadParams to FlowInstance * Pass update node internals to instance
This commit is contained in:
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { EventHook } from '@vueuse/core'
|
||||
import { Connection, Edge, Elements, FlowTransform, Node, OnConnectStartParams, OnLoadParams } from '../types'
|
||||
import { Connection, Edge, Elements, FlowTransform, Node, OnConnectStartParams, FlowInstance } from '../types'
|
||||
|
||||
export type FlowHook<T = any> = EventHook<T>
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface FlowEvents {
|
||||
}
|
||||
connectStop: MouseEvent
|
||||
connectEnd: MouseEvent
|
||||
load: OnLoadParams
|
||||
load: FlowInstance
|
||||
move: FlowTransform | undefined
|
||||
moveStart: FlowTransform | undefined
|
||||
moveEnd: FlowTransform | undefined
|
||||
|
||||
+3
-2
@@ -77,7 +77,7 @@ export type FitViewFunc = (fitViewOptions?: FitViewParams) => void
|
||||
export type ProjectFunc = (position: XYPosition) => XYPosition
|
||||
export type ToObjectFunc<T = any> = () => FlowExportObject<T>
|
||||
|
||||
export type OnLoadParams<T = any> = {
|
||||
export type FlowInstance<T = any> = {
|
||||
zoomIn: () => void
|
||||
zoomOut: () => void
|
||||
zoomTo: (zoomLevel: number) => void
|
||||
@@ -86,9 +86,10 @@ export type OnLoadParams<T = any> = {
|
||||
getElements: () => Elements<T>
|
||||
setTransform: (transform: FlowTransform) => void
|
||||
toObject: ToObjectFunc<T>
|
||||
updateNodeInternals: (id: ElementId) => void
|
||||
}
|
||||
|
||||
export type OnLoadFunc<T = any> = (params: OnLoadParams<T>) => void
|
||||
export type OnLoadFunc<T = any> = (params: FlowInstance<T>) => void
|
||||
|
||||
export interface FlowOptions extends Omit<HTMLAttributes, 'onLoad'> {
|
||||
elements: Elements
|
||||
|
||||
Reference in New Issue
Block a user