refactor(types): only export HandleProps but not HandleComponentProps

This commit is contained in:
moklick
2024-05-07 16:22:26 +02:00
parent 5093213116
commit 2b0d75ddaa
8 changed files with 19 additions and 41 deletions
@@ -14,10 +14,11 @@ import {
getHostForElement,
isMouseEvent,
addEdge,
type HandleProps,
type HandleProps as HandlePropsSystem,
type Connection,
type HandleType,
ConnectionMode,
OnConnect,
} from '@xyflow/system';
import { useStore, useStoreApi } from '../../hooks/useStore';
@@ -25,7 +26,10 @@ import { useNodeId } from '../../contexts/NodeIdContext';
import { type ReactFlowState } from '../../types';
import { fixedForwardRef } from '../../utils';
export interface HandleComponentProps extends HandleProps, Omit<HTMLAttributes<HTMLDivElement>, 'id'> {}
export interface HandleProps extends HandlePropsSystem, Omit<HTMLAttributes<HTMLDivElement>, 'id'> {
/** Callback called when connection is made */
onConnect?: OnConnect;
}
const selector = (s: ReactFlowState) => ({
connectOnClick: s.connectOnClick,
@@ -75,7 +79,7 @@ function HandleComponent(
onMouseDown,
onTouchStart,
...rest
}: HandleComponentProps,
}: HandleProps,
ref: ForwardedRef<HTMLDivElement>
) {
const handleId = id || null;