Merge pull request #4446 from xyflow/fix/resizer-types
fix(resizer): export types
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
'@xyflow/react': patch
|
||||||
|
'@xyflow/svelte': patch
|
||||||
|
'@xyflow/system': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix(resizer): export types
|
||||||
@@ -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,
|
||||||
|
|||||||
@@ -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';
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user