fix(resizer): export types closes #4439

This commit is contained in:
moklick
2024-07-15 10:56:39 +02:00
parent 487b13c9ad
commit a51ee45b66
3 changed files with 11 additions and 5 deletions
+3
View File
@@ -85,6 +85,9 @@ export {
type ControlPosition, type ControlPosition,
type ControlLinePosition, type ControlLinePosition,
type ResizeControlVariant, type ResizeControlVariant,
type ResizeParams,
type ResizeParamsWithDirection,
type ResizeDragEvent,
type NodeChange, type NodeChange,
type NodeDimensionChange, type NodeDimensionChange,
type NodePositionChange, type NodePositionChange,
+3
View File
@@ -105,6 +105,9 @@ export {
type ControlPosition, type ControlPosition,
type ControlLinePosition, type ControlLinePosition,
type ResizeControlVariant, type ResizeControlVariant,
type ResizeParams,
type ResizeParamsWithDirection,
type ResizeDragEvent,
type IsValidConnection type IsValidConnection
} from '@xyflow/system'; } from '@xyflow/system';
+5 -5
View File
@@ -1,13 +1,13 @@
import type { D3DragEvent, SubjectPosition } from 'd3-drag'; import type { D3DragEvent, SubjectPosition } from 'd3-drag';
export type XYResizerParams = { export type ResizeParams = {
x: number; x: number;
y: number; y: number;
width: number; width: number;
height: number; height: number;
}; };
export type XYResizerParamsWithDirection = XYResizerParams & { export type ResizeParamsWithDirection = ResizeParams & {
direction: number[]; 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_HANDLE_POSITIONS: ControlPosition[] = ['top-left', 'top-right', 'bottom-left', 'bottom-right'];
export const XY_RESIZER_LINE_POSITIONS: ControlLinePosition[] = ['top', 'right', 'bottom', 'left']; export const XY_RESIZER_LINE_POSITIONS: ControlLinePosition[] = ['top', 'right', 'bottom', 'left'];
type OnResizeHandler<Params = XYResizerParams, Result = void> = (event: ResizeDragEvent, params: Params) => Result; type OnResizeHandler<Params = ResizeParams, Result = void> = (event: ResizeDragEvent, params: Params) => Result;
export type ResizeDragEvent = D3DragEvent<HTMLDivElement, null, SubjectPosition>; export type ResizeDragEvent = D3DragEvent<HTMLDivElement, null, SubjectPosition>;
export type ShouldResize = OnResizeHandler<XYResizerParamsWithDirection, boolean>; export type ShouldResize = OnResizeHandler<ResizeParamsWithDirection, boolean>;
export type OnResizeStart = OnResizeHandler; export type OnResizeStart = OnResizeHandler;
export type OnResize = OnResizeHandler<XYResizerParamsWithDirection>; export type OnResize = OnResizeHandler<ResizeParamsWithDirection>;
export type OnResizeEnd = OnResizeHandler; export type OnResizeEnd = OnResizeHandler;