refactor(general): cleanup

This commit is contained in:
moklick
2021-12-09 09:17:36 +01:00
parent 38308781ee
commit 81585dbff5
17 changed files with 70 additions and 137 deletions
+8 -4
View File
@@ -26,8 +26,11 @@ export type OnEdgesChange = (nodes: EdgeChange[]) => void;
export type ZoomInOut = (options?: ZoomPanHelperFunctionOptions) => void;
export type ZoomTo = (zoomLevel: number, options?: ZoomPanHelperFunctionOptions) => void;
export type GetZoom = () => number;
export type GetTransform = () => FlowTransform;
export type SetTransform = (transform: FlowTransform, options?: ZoomPanHelperFunctionOptions) => void;
export type SetCenter = (x: number, y: number, options?: SetCenterOptions) => void;
export type FitBounds = (bounds: Rect, options?: FitBoundsOptions) => void;
export type ReactFlowInstance<T = any> = {
zoomIn: ZoomInOut;
@@ -125,17 +128,18 @@ export type SetCenterOptions = ZoomPanHelperFunctionOptions & {
export type FitBoundsOptions = ZoomPanHelperFunctionOptions & {
padding?: number;
};
export interface ZoomPanHelperFunctions {
zoomIn: ZoomInOut;
zoomOut: ZoomInOut;
zoomTo: ZoomTo;
getZoom: () => number;
getZoom: GetZoom;
setTransform: SetTransform;
getTransform: () => FlowTransform;
getTransform: GetTransform;
fitView: FitView;
setCenter: SetCenter;
fitBounds: (bounds: Rect, options?: FitBoundsOptions) => void;
project: (position: XYPosition) => XYPosition;
fitBounds: FitBounds;
project: Project;
initialized: boolean;
}