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