fix(handle-on-connect): use correct HandleConnection type #5447

This commit is contained in:
moklick
2025-08-12 14:36:06 +02:00
parent 91e5e302d5
commit 4e588b2c23
6 changed files with 18 additions and 15 deletions

View File

@@ -1,10 +1,10 @@
import type { Connection, HandleProps as HandlePropsSystem } from '@xyflow/system';
import type { HandleConnection, HandleProps as HandlePropsSystem } from '@xyflow/system';
import type { Snippet } from 'svelte';
import type { ClassValue, HTMLAttributes } from 'svelte/elements';
export type HandleProps = HandlePropsSystem & {
class?: ClassValue;
onconnect?: (connections: Connection[]) => void;
ondisconnect?: (connections: Connection[]) => void;
onconnect?: (connections: HandleConnection[]) => void;
ondisconnect?: (connections: HandleConnection[]) => void;
children?: Snippet;
} & HTMLAttributes<HTMLDivElement>;

View File

@@ -1,9 +1,9 @@
import {
areConnectionMapsEqual,
handleConnectionChange,
type NodeConnection,
type HandleType,
type Connection,
handleConnectionChange
type HandleConnection
} from '@xyflow/system';
import { useStore } from '$lib/store';
@@ -13,8 +13,8 @@ type UseNodeConnectionsParams = {
id?: string;
handleType?: HandleType;
handleId?: string;
onConnect?: (connections: Connection[]) => void;
onDisconnect?: (connections: Connection[]) => void;
onConnect?: (connections: HandleConnection[]) => void;
onDisconnect?: (connections: HandleConnection[]) => void;
};
type ConnectionMap = Map<string, NodeConnection>;

View File

@@ -54,7 +54,7 @@ export type {
StraightEdgeProps,
EdgeTypes,
DefaultEdgeOptions,
BuiltInEdge,
BuiltInEdge
} from '$lib/types/edges';
export type * from '$lib/types/general';
export type { Node, NodeTypes, BuiltInNode, NodeProps, InternalNode } from '$lib/types/nodes';
@@ -120,7 +120,8 @@ export {
type AriaLabelConfig,
type SetCenter,
type SetViewport,
type FitBounds
type FitBounds,
type HandleConnection
} from '@xyflow/system';
// system utils