From 21e5fc15205d6d1dd1802fa37ca24d38efafda48 Mon Sep 17 00:00:00 2001 From: peterkogo Date: Thu, 15 Aug 2024 13:10:27 +0200 Subject: [PATCH] re-export connectionState types --- packages/react/src/index.ts | 4 ++++ packages/system/src/types/general.ts | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index 7c984bf0..cb36e305 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -101,6 +101,10 @@ export { type EdgeAddChange, type EdgeReplaceChange, type KeyCode, + type ConnectionState, + type FinalConnectionState, + type ConnectionInProgress, + type NoConnection, } from '@xyflow/system'; // we need this workaround to prevent a duplicate identifier error diff --git a/packages/system/src/types/general.ts b/packages/system/src/types/general.ts index 56e97afe..98d8afb6 100644 --- a/packages/system/src/types/general.ts +++ b/packages/system/src/types/general.ts @@ -52,8 +52,6 @@ export type OnConnectStart = (event: MouseEvent | TouchEvent, params: OnConnectS export type OnConnect = (connection: Connection) => void; export type OnConnectEnd = (event: MouseEvent | TouchEvent, connectionState: FinalConnectionState) => void; -export type FinalConnectionState = Omit; - export type IsValidConnection = (edge: EdgeBase | Connection) => boolean; export type FitViewParamsBase = { @@ -175,6 +173,11 @@ export type ConnectionState | NoConnection; +export type FinalConnectionState = Omit< + ConnectionState, + 'inProgress' +>; + export type UpdateConnection = ( params: ConnectionState ) => void;