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 ControlLinePosition,
type ResizeControlVariant,
type ResizeParams,
type ResizeParamsWithDirection,
type ResizeDragEvent,
type NodeChange,
type NodeDimensionChange,
type NodePositionChange,
+3
View File
@@ -105,6 +105,9 @@ export {
type ControlPosition,
type ControlLinePosition,
type ResizeControlVariant,
type ResizeParams,
type ResizeParamsWithDirection,
type ResizeDragEvent,
type IsValidConnection
} from '@xyflow/system';
+5 -5
View File
@@ -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<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 ShouldResize = OnResizeHandler<XYResizerParamsWithDirection, boolean>;
export type ShouldResize = OnResizeHandler<ResizeParamsWithDirection, boolean>;
export type OnResizeStart = OnResizeHandler;
export type OnResize = OnResizeHandler<XYResizerParamsWithDirection>;
export type OnResize = OnResizeHandler<ResizeParamsWithDirection>;
export type OnResizeEnd = OnResizeHandler;