chore(types): remove some unnecessary generics
This commit is contained in:
@@ -74,7 +74,7 @@ type Injection<NodeData = ElementData, EdgeData = ElementData> = UseVueFlow<Node
|
||||
type Scope = (EffectScope & { vueFlowId: string }) | undefined
|
||||
|
||||
export default <NodeData = ElementData, EdgeData = ElementData>(
|
||||
options?: Partial<FlowOptions<NodeData, EdgeData>>,
|
||||
options?: Partial<FlowOptions>,
|
||||
): UseVueFlow<NodeData, EdgeData> => {
|
||||
const storage = Storage.getInstance()
|
||||
const scope = getCurrentScope() as Scope
|
||||
|
||||
@@ -74,20 +74,20 @@ export interface SelectionRect extends Rect {
|
||||
draw: boolean
|
||||
}
|
||||
|
||||
export type FlowExportObject<NodeData = ElementData, EdgeData = ElementData> = {
|
||||
nodes: GraphNode<NodeData>[]
|
||||
edges: GraphEdge<EdgeData>[]
|
||||
export type FlowExportObject = {
|
||||
nodes: GraphNode[]
|
||||
edges: GraphEdge[]
|
||||
position: [number, number]
|
||||
zoom: number
|
||||
}
|
||||
|
||||
export type ToObject<NodeData = ElementData, EdgeData = ElementData> = () => FlowExportObject<NodeData, EdgeData>
|
||||
export type ToObject = () => FlowExportObject
|
||||
|
||||
export type FlowInstance<NodeData = ElementData, EdgeData = ElementData> = {
|
||||
getElements: () => FlowElements<NodeData, EdgeData>
|
||||
getNodes: () => GraphNode<NodeData>[]
|
||||
getEdges: () => GraphEdge<EdgeData>[]
|
||||
toObject: ToObject<NodeData, EdgeData>
|
||||
export type FlowInstance = {
|
||||
getElements: () => FlowElements
|
||||
getNodes: () => GraphNode[]
|
||||
getEdges: () => GraphEdge[]
|
||||
toObject: ToObject
|
||||
} & UseZoomPanHelper
|
||||
|
||||
export interface FlowProps<NodeData = ElementData, EdgeData = ElementData> {
|
||||
|
||||
@@ -26,7 +26,7 @@ export interface FlowEvents<NodeData = ElementData, EdgeData = ElementData> {
|
||||
} & OnConnectStartParams
|
||||
connectStop: MouseEvent
|
||||
connectEnd: MouseEvent
|
||||
paneReady: FlowInstance<NodeData, EdgeData>
|
||||
paneReady: FlowInstance
|
||||
move: { event: D3ZoomEvent<HTMLDivElement, any>; flowTransform: FlowTransform }
|
||||
moveStart: { event: D3ZoomEvent<HTMLDivElement, any>; flowTransform: FlowTransform }
|
||||
moveEnd: { event: D3ZoomEvent<HTMLDivElement, any>; flowTransform: FlowTransform }
|
||||
|
||||
@@ -24,7 +24,7 @@ export interface State<NodeData = ElementData, EdgeData = ElementData>
|
||||
extends Omit<FlowOptions<NodeData, EdgeData>, 'id' | 'modelValue'> {
|
||||
/** Event hooks, you can manipulate the triggers on your own peril */
|
||||
hooks: FlowHooks<NodeData, EdgeData>
|
||||
instance: FlowInstance<NodeData, EdgeData> | null
|
||||
instance: FlowInstance | null
|
||||
|
||||
/** all stored nodes */
|
||||
nodes: GraphNode<NodeData>[]
|
||||
|
||||
Reference in New Issue
Block a user