refactor(types): add useZoomPanHelperFunc types
This commit is contained in:
+18
-6
@@ -64,6 +64,7 @@ export type FitViewParams = {
|
|||||||
includeHiddenNodes?: boolean;
|
includeHiddenNodes?: boolean;
|
||||||
minZoom?: number;
|
minZoom?: number;
|
||||||
maxZoom?: number;
|
maxZoom?: number;
|
||||||
|
duration?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type OnConnectStartParams = {
|
export type OnConnectStartParams = {
|
||||||
@@ -105,14 +106,25 @@ export enum PanOnScrollMode {
|
|||||||
Horizontal = 'horizontal',
|
Horizontal = 'horizontal',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type ZoomPanHelperFunctionOptions = {
|
||||||
|
duration?: number;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type SetCenterOptions = ZoomPanHelperFunctionOptions & {
|
||||||
|
zoom?: number;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type FitBoundsOptions = ZoomPanHelperFunctionOptions & {
|
||||||
|
padding?: number;
|
||||||
|
};
|
||||||
export interface ZoomPanHelperFunctions {
|
export interface ZoomPanHelperFunctions {
|
||||||
zoomIn: () => void;
|
zoomIn: (options?: ZoomPanHelperFunctionOptions) => void;
|
||||||
zoomOut: () => void;
|
zoomOut: (options?: ZoomPanHelperFunctionOptions) => void;
|
||||||
zoomTo: (zoomLevel: number) => void;
|
zoomTo: (zoomLevel: number, options?: ZoomPanHelperFunctionOptions) => void;
|
||||||
transform: (transform: FlowTransform) => void;
|
transform: (transform: FlowTransform, options?: ZoomPanHelperFunctionOptions) => void;
|
||||||
fitView: FitView;
|
fitView: FitView;
|
||||||
setCenter: (x: number, y: number, zoom?: number) => void;
|
setCenter: (x: number, y: number, options?: SetCenterOptions) => void;
|
||||||
fitBounds: (bounds: Rect, padding?: number) => void;
|
fitBounds: (bounds: Rect, options?: FitBoundsOptions) => void;
|
||||||
project: (position: XYPosition) => XYPosition;
|
project: (position: XYPosition) => XYPosition;
|
||||||
initialized: boolean;
|
initialized: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user