chore(onbeforedelete): use correct node/edge types, pass generic
This commit is contained in:
@@ -79,7 +79,6 @@ export {
|
||||
type ColorMode,
|
||||
type ColorModeClass,
|
||||
type HandleType,
|
||||
type OnBeforeDelete,
|
||||
type ShouldResize,
|
||||
type OnResizeStart,
|
||||
type OnResize,
|
||||
|
||||
@@ -21,7 +21,6 @@ import type {
|
||||
IsValidConnection,
|
||||
ColorMode,
|
||||
SnapGrid,
|
||||
OnBeforeDelete,
|
||||
} from '@xyflow/system';
|
||||
|
||||
import type {
|
||||
@@ -44,6 +43,7 @@ import type {
|
||||
SelectionDragHandler,
|
||||
EdgeMouseHandler,
|
||||
OnNodeDrag,
|
||||
OnBeforeDelete,
|
||||
} from '.';
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
FitBounds,
|
||||
XYPosition,
|
||||
NodeProps,
|
||||
OnBeforeDeleteBase,
|
||||
} from '@xyflow/system';
|
||||
|
||||
import type { NodeChange, EdgeChange, Node, Edge, ReactFlowInstance, EdgeProps } from '.';
|
||||
@@ -59,3 +60,8 @@ export type ViewportHelperFunctions = {
|
||||
flowToScreenPosition: (position: XYPosition) => XYPosition;
|
||||
viewportInitialized: boolean;
|
||||
};
|
||||
|
||||
export type OnBeforeDelete<NodeType extends Node = Node, EdgeType extends Edge = Edge> = OnBeforeDeleteBase<
|
||||
NodeType,
|
||||
EdgeType
|
||||
>;
|
||||
|
||||
@@ -26,7 +26,6 @@ import {
|
||||
type EdgeLookup,
|
||||
type ConnectionLookup,
|
||||
type NodeLookup,
|
||||
OnBeforeDelete,
|
||||
} from '@xyflow/system';
|
||||
|
||||
import type {
|
||||
@@ -43,6 +42,7 @@ import type {
|
||||
UnselectNodesAndEdgesParams,
|
||||
OnDelete,
|
||||
OnNodeDrag,
|
||||
OnBeforeDelete,
|
||||
} from '.';
|
||||
|
||||
export type ReactFlowStore = {
|
||||
|
||||
Reference in New Issue
Block a user