diff --git a/.changeset/famous-nails-hug.md b/.changeset/famous-nails-hug.md new file mode 100644 index 00000000..85209c29 --- /dev/null +++ b/.changeset/famous-nails-hug.md @@ -0,0 +1,7 @@ +--- +'@xyflow/react': patch +'@xyflow/svelte': patch +'@xyflow/system': patch +--- + +fix(resizer): export types diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index e15d9ca2..604e3d35 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -85,6 +85,9 @@ export { type ControlPosition, type ControlLinePosition, type ResizeControlVariant, + type ResizeParams, + type ResizeParamsWithDirection, + type ResizeDragEvent, type NodeChange, type NodeDimensionChange, type NodePositionChange, diff --git a/packages/svelte/src/lib/index.ts b/packages/svelte/src/lib/index.ts index b13a7d90..112af9fa 100644 --- a/packages/svelte/src/lib/index.ts +++ b/packages/svelte/src/lib/index.ts @@ -105,6 +105,9 @@ export { type ControlPosition, type ControlLinePosition, type ResizeControlVariant, + type ResizeParams, + type ResizeParamsWithDirection, + type ResizeDragEvent, type IsValidConnection } from '@xyflow/system'; diff --git a/packages/system/src/xyresizer/types.ts b/packages/system/src/xyresizer/types.ts index 446e0ac4..99480512 100644 --- a/packages/system/src/xyresizer/types.ts +++ b/packages/system/src/xyresizer/types.ts @@ -1,13 +1,13 @@ import type { D3DragEvent, SubjectPosition } from 'd3-drag'; -export type XYResizerParams = { +export type ResizeParams = { x: number; y: number; width: number; height: number; }; -export type XYResizerParamsWithDirection = XYResizerParams & { +export type ResizeParamsWithDirection = ResizeParams & { direction: number[]; }; @@ -23,10 +23,10 @@ export enum ResizeControlVariant { export const XY_RESIZER_HANDLE_POSITIONS: ControlPosition[] = ['top-left', 'top-right', 'bottom-left', 'bottom-right']; export const XY_RESIZER_LINE_POSITIONS: ControlLinePosition[] = ['top', 'right', 'bottom', 'left']; -type OnResizeHandler = (event: ResizeDragEvent, params: Params) => Result; +type OnResizeHandler = (event: ResizeDragEvent, params: Params) => Result; export type ResizeDragEvent = D3DragEvent; -export type ShouldResize = OnResizeHandler; +export type ShouldResize = OnResizeHandler; export type OnResizeStart = OnResizeHandler; -export type OnResize = OnResizeHandler; +export type OnResize = OnResizeHandler; export type OnResizeEnd = OnResizeHandler;