Merge pull request #5333 from xyflow/export-missing-types

export additional types
This commit is contained in:
Moritz Klack
2025-06-16 09:56:52 +02:00
committed by GitHub
4 changed files with 48 additions and 1 deletions
+7
View File
@@ -0,0 +1,7 @@
---
'@xyflow/react': patch
'@xyflow/svelte': patch
'@xyflow/system': patch
---
Add missing type exports
+3
View File
@@ -109,6 +109,9 @@ export {
type NodeConnection, type NodeConnection,
type OnReconnect, type OnReconnect,
type AriaLabelConfig, type AriaLabelConfig,
type SetCenter,
type SetViewport,
type FitBounds,
} from '@xyflow/system'; } from '@xyflow/system';
// we need this workaround to prevent a duplicate identifier error // we need this workaround to prevent a duplicate identifier error
+7 -1
View File
@@ -105,6 +105,9 @@ export {
type OnResizeStart, type OnResizeStart,
type OnResize, type OnResize,
type OnResizeEnd, type OnResizeEnd,
type OnReconnect,
type OnReconnectStart,
type OnReconnectEnd,
type ControlPosition, type ControlPosition,
type ControlLinePosition, type ControlLinePosition,
ResizeControlVariant, ResizeControlVariant,
@@ -113,7 +116,10 @@ export {
type ResizeDragEvent, type ResizeDragEvent,
type IsValidConnection, type IsValidConnection,
type NodeConnection, type NodeConnection,
type AriaLabelConfig type AriaLabelConfig,
type SetCenter,
type SetViewport,
type FitBounds
} from '@xyflow/system'; } from '@xyflow/system';
// system utils // system utils
+31
View File
@@ -21,8 +21,33 @@ export type ZoomInOut = (options?: ViewportHelperFunctionOptions) => Promise<boo
export type ZoomTo = (zoomLevel: number, options?: ViewportHelperFunctionOptions) => Promise<boolean>; export type ZoomTo = (zoomLevel: number, options?: ViewportHelperFunctionOptions) => Promise<boolean>;
export type GetZoom = () => number; export type GetZoom = () => number;
export type GetViewport = () => Viewport; export type GetViewport = () => Viewport;
/**
* The `SetViewport` function is used to set the viewport of the flow.
*
* @inline
* @param viewport - The viewport to set.
* @param options - Optional parameters to control the animation and easing of the viewport change.
*/
export type SetViewport = (viewport: Viewport, options?: ViewportHelperFunctionOptions) => Promise<boolean>; export type SetViewport = (viewport: Viewport, options?: ViewportHelperFunctionOptions) => Promise<boolean>;
/**
* The `SetCenter` function is used to set the center of the flow viewport to a specific position
*
* @inline
* @param x - x coordinate
* @param y - y coordinate
* @param options - Optional parameters to control the animation and easing of the viewport change.
*/
export type SetCenter = (x: number, y: number, options?: SetCenterOptions) => Promise<boolean>; export type SetCenter = (x: number, y: number, options?: SetCenterOptions) => Promise<boolean>;
/**
* The `FitBounds` function is used to fit the flow viewport to the bounds of the nodes.
*
* @inline
* @param bounds - The bounds to fit the viewport to.
* @param options - Optional parameters to control the animation and easing of the viewport change.
*/
export type FitBounds = (bounds: Rect, options?: FitBoundsOptions) => Promise<boolean>; export type FitBounds = (bounds: Rect, options?: FitBoundsOptions) => Promise<boolean>;
/** /**
@@ -179,10 +204,16 @@ export type ViewportHelperFunctionOptions = {
interpolate?: 'smooth' | 'linear'; interpolate?: 'smooth' | 'linear';
}; };
/**
* @inline
*/
export type SetCenterOptions = ViewportHelperFunctionOptions & { export type SetCenterOptions = ViewportHelperFunctionOptions & {
zoom?: number; zoom?: number;
}; };
/**
* @inline
*/
export type FitBoundsOptions = ViewportHelperFunctionOptions & { export type FitBoundsOptions = ViewportHelperFunctionOptions & {
padding?: number; padding?: number;
}; };