chore(core): cleanup types

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-04-11 20:28:02 +02:00
committed by Braks
parent 717d8e0d43
commit 4524948515
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -172,7 +172,7 @@ export interface EdgeProps<Data = ElementData, CustomEvents = {}, Type extends s
type: Type
label?: string | VNode | Component<EdgeTextProps> | Object
style?: CSSProperties
selected: boolean
selected?: boolean
sourcePosition: Position
targetPosition: Position
sourceHandleId?: string
+1 -1
View File
@@ -238,7 +238,7 @@ export interface Actions extends ViewportFunctions {
/** apply translate extent to d3 */
setTranslateExtent: (translateExtent: CoordinateExtent) => void
/** apply extent to nodes */
setNodeExtent: (nodeExtent: CoordinateExtent) => void
setNodeExtent: (nodeExtent: CoordinateExtent | CoordinateExtentRange) => void
/** enable/disable node interaction (dragging, selecting etc) */
setInteractive: (isInteractive: boolean) => void
/** set new state */
+2 -2
View File
@@ -103,7 +103,7 @@ function getParentExtent(
export function getExtent<T extends NodeDragItem | GraphNode>(
item: T,
onError: State['hooks']['error']['trigger'],
extent?: CoordinateExtent,
extent?: State['nodeExtent'],
parent?: GraphNode,
) {
let currentExtent = item.extent || extent
@@ -146,7 +146,7 @@ export function calcNextPosition(
node: GraphNode | NodeDragItem,
nextPosition: XYPosition,
onError: State['hooks']['error']['trigger'],
nodeExtent?: CoordinateExtent,
nodeExtent?: State['nodeExtent'],
parentNode?: GraphNode,
) {
const extent = getExtent(node, onError, nodeExtent, parentNode)