react-zoom-pan-pinch 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/transform-component.d.ts +10 -0
- package/dist/components/transform-wrapper.d.ts +8 -0
- package/dist/constants/state.constants.d.ts +6 -0
- package/dist/core/animations/animations.constants.d.ts +16 -0
- package/dist/core/animations/animations.utils.d.ts +4 -0
- package/dist/core/bounds/bounds.types.d.ts +8 -0
- package/dist/core/bounds/bounds.utils.d.ts +15 -0
- package/dist/core/double-click/double-click.logic.d.ts +3 -0
- package/dist/core/handlers/handlers.logic.d.ts +8 -0
- package/dist/core/handlers/handlers.utils.d.ts +13 -0
- package/dist/core/instance.core.d.ts +68 -0
- package/dist/core/pan/panning.logic.d.ts +5 -0
- package/dist/core/pan/panning.utils.d.ts +10 -0
- package/dist/core/pan/velocity.logic.d.ts +5 -0
- package/dist/core/pan/velocity.utils.d.ts +5 -0
- package/dist/core/pinch/pinch.logic.d.ts +4 -0
- package/dist/core/pinch/pinch.utils.d.ts +6 -0
- package/dist/core/wheel/wheel.logic.d.ts +4 -0
- package/dist/core/wheel/wheel.utils.d.ts +7 -0
- package/dist/core/zoom/zoom.logic.d.ts +3 -0
- package/dist/core/zoom/zoom.utils.d.ts +3 -0
- package/dist/hooks/use-transform-context.d.ts +3 -0
- package/dist/index.cjs.js +278 -267
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +63 -57
- package/dist/index.esm.js +278 -267
- package/dist/index.esm.js.map +1 -1
- package/dist/models/calculations.model.d.ts +25 -0
- package/dist/models/context.model.d.ts +117 -0
- package/dist/models/helpers.model.d.ts +5 -0
- package/dist/models/index.d.ts +3 -0
- package/dist/stories/docs/handlers.d.ts +12 -0
- package/dist/stories/docs/props.d.ts +14 -0
- package/dist/stories/examples/content-rerendering/example.d.ts +2 -0
- package/dist/stories/examples/stress/example.d.ts +2 -0
- package/dist/stories/examples/zoom-to-element/example.d.ts +2 -0
- package/dist/stories/types/args.types.d.ts +268 -0
- package/dist/stories/utils/args.utils.d.ts +3 -0
- package/dist/stories/utils/code.utils.d.ts +6 -0
- package/dist/stories/utils/controls.utils.d.ts +3 -0
- package/dist/stories/utils/index.d.ts +3 -0
- package/dist/utils/calculations.utils.d.ts +11 -0
- package/dist/utils/callback.utils.d.ts +2 -0
- package/dist/utils/context.utils.d.ts +2 -0
- package/dist/utils/event.utils.d.ts +1 -0
- package/dist/utils/helpers.utils.d.ts +2 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/state.utils.d.ts +3 -0
- package/dist/utils/styles.utils.d.ts +3 -0
- package/package.json +30 -25
- package/src/.eslintrc.json +90 -0
- package/src/components/transform-component.tsx +2 -1
- package/src/components/transform-wrapper.tsx +27 -5
- package/src/constants/state.constants.ts +0 -2
- package/src/core/animations/animations.constants.ts +14 -12
- package/src/core/animations/animations.utils.ts +15 -11
- package/src/core/bounds/bounds.utils.ts +20 -20
- package/src/core/double-click/double-click.logic.ts +6 -12
- package/src/core/handlers/handlers.logic.ts +98 -89
- package/src/core/handlers/handlers.utils.ts +22 -24
- package/src/{components/transform-context.tsx → core/instance.core.ts} +85 -118
- package/src/core/pan/panning.logic.ts +20 -19
- package/src/core/pan/panning.utils.ts +4 -7
- package/src/core/pan/velocity.logic.ts +1 -0
- package/src/core/pinch/pinch.logic.ts +4 -6
- package/src/core/pinch/pinch.utils.ts +2 -2
- package/src/core/wheel/wheel.logic.ts +1 -0
- package/src/core/wheel/wheel.utils.ts +12 -11
- package/src/core/zoom/zoom.logic.ts +29 -29
- package/src/core/zoom/zoom.utils.ts +2 -2
- package/src/hooks/use-transform-context.tsx +3 -2
- package/src/models/context.model.ts +6 -2
- package/src/stories/docs/handlers.tsx +30 -30
- package/src/stories/examples/content-rerendering/content-updating.stories.mdx +3 -0
- package/src/stories/examples/content-rerendering/example.tsx +1 -1
- package/src/stories/examples/stress/example.tsx +24 -0
- package/src/stories/examples/stress/stress-test.stories.mdx +28 -0
- package/src/stories/examples/zoom-to-element/example.tsx +4 -0
- package/src/stories/utils/code.utils.tsx +1 -0
- package/src/stories/utils/controls.utils.tsx +21 -4
- package/src/stories/utils/styles.module.css +5 -0
- package/src/utils/styles.utils.ts +9 -1
- package/src/.eslintrc.js +0 -36
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
wrapperClass?: string;
|
|
5
|
+
contentClass?: string;
|
|
6
|
+
wrapperStyle?: React.CSSProperties;
|
|
7
|
+
contentStyle?: React.CSSProperties;
|
|
8
|
+
};
|
|
9
|
+
export declare const TransformComponent: React.FC<Props>;
|
|
10
|
+
export default TransformComponent;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ZoomPanPinch } from "../core/instance.core";
|
|
3
|
+
import { ReactZoomPanPinchProps, ReactZoomPanPinchRef } from "../models";
|
|
4
|
+
export declare const Context: React.Context<import("../models").ReactZoomPanPinchComponentHelpers & import("../models").ReactZoomPanPinchState & {
|
|
5
|
+
contextInstance: ZoomPanPinch | null;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const TransformWrapper: React.ForwardRefExoticComponent<Omit<ReactZoomPanPinchProps, "ref"> & React.RefAttributes<ReactZoomPanPinchRef>>;
|
|
8
|
+
export default TransformWrapper;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LibrarySetup, ReactZoomPanPinchContext, ReactZoomPanPinchComponentHelpers, ReactZoomPanPinchState } from "../models/context.model";
|
|
2
|
+
export declare const initialState: ReactZoomPanPinchState;
|
|
3
|
+
export declare const contextInitialState: ReactZoomPanPinchComponentHelpers & ReactZoomPanPinchState & {
|
|
4
|
+
contextInstance: ReactZoomPanPinchContext | null;
|
|
5
|
+
};
|
|
6
|
+
export declare const initialSetup: LibrarySetup;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const animations: {
|
|
2
|
+
easeOut: (t: number) => number;
|
|
3
|
+
linear: (t: number) => number;
|
|
4
|
+
easeInQuad: (t: number) => number;
|
|
5
|
+
easeOutQuad: (t: number) => number;
|
|
6
|
+
easeInOutQuad: (t: number) => number;
|
|
7
|
+
easeInCubic: (t: number) => number;
|
|
8
|
+
easeOutCubic: (t: number) => number;
|
|
9
|
+
easeInOutCubic: (t: number) => number;
|
|
10
|
+
easeInQuart: (t: number) => number;
|
|
11
|
+
easeOutQuart: (t: number) => number;
|
|
12
|
+
easeInOutQuart: (t: number) => number;
|
|
13
|
+
easeInQuint: (t: number) => number;
|
|
14
|
+
easeOutQuint: (t: number) => number;
|
|
15
|
+
easeInOutQuint: (t: number) => number;
|
|
16
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ReactZoomPanPinchContext, StateType } from "../../models";
|
|
2
|
+
export declare const handleCancelAnimation: (contextInstance: ReactZoomPanPinchContext) => void;
|
|
3
|
+
export declare function handleSetupAnimation(contextInstance: ReactZoomPanPinchContext, animationName: string, animationTime: number, callback: (step: number) => void): void;
|
|
4
|
+
export declare function animate(contextInstance: ReactZoomPanPinchContext, targetState: StateType, animationTime: number, animationName: string): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BoundsType, PositionType, ReactZoomPanPinchContext } from "../../models";
|
|
2
|
+
import { ComponentsSizesType } from "./bounds.types";
|
|
3
|
+
export declare function getComponentsSizes(wrapperComponent: HTMLDivElement, contentComponent: HTMLDivElement, newScale: number): ComponentsSizesType;
|
|
4
|
+
export declare const getBounds: (wrapperWidth: number, newContentWidth: number, diffWidth: number, wrapperHeight: number, newContentHeight: number, diffHeight: number, centerZoomedOut: boolean) => BoundsType;
|
|
5
|
+
export declare const calculateBounds: (contextInstance: ReactZoomPanPinchContext, newScale: number) => BoundsType;
|
|
6
|
+
/**
|
|
7
|
+
* Keeps value between given bounds, used for limiting view to given boundaries
|
|
8
|
+
* 1# eg. boundLimiter(2, 0, 3, true) => 2
|
|
9
|
+
* 2# eg. boundLimiter(4, 0, 3, true) => 3
|
|
10
|
+
* 3# eg. boundLimiter(-2, 0, 3, true) => 0
|
|
11
|
+
* 4# eg. boundLimiter(10, 0, 3, false) => 10
|
|
12
|
+
*/
|
|
13
|
+
export declare const boundLimiter: (value: number, minBound: number, maxBound: number, isActive: boolean) => number;
|
|
14
|
+
export declare const handleCalculateBounds: (contextInstance: ReactZoomPanPinchContext, newScale: number) => BoundsType;
|
|
15
|
+
export declare function getMouseBoundedPosition(positionX: number, positionY: number, bounds: BoundsType, limitToBounds: boolean, paddingValueX: number, paddingValueY: number, wrapperComponent: HTMLDivElement | null): PositionType;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ReactZoomPanPinchContext } from "../../models";
|
|
2
|
+
export declare function handleDoubleClick(contextInstance: ReactZoomPanPinchContext, event: MouseEvent | TouchEvent): void;
|
|
3
|
+
export declare const isDoubleClickAllowed: (contextInstance: ReactZoomPanPinchContext, event: MouseEvent | TouchEvent) => boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactZoomPanPinchContext } from "../../models";
|
|
2
|
+
import { animations } from "../animations/animations.constants";
|
|
3
|
+
export declare const zoomIn: (contextInstance: ReactZoomPanPinchContext) => (step?: number, animationTime?: number, animationType?: keyof typeof animations) => void;
|
|
4
|
+
export declare const zoomOut: (contextInstance: ReactZoomPanPinchContext) => (step?: number, animationTime?: number, animationType?: keyof typeof animations) => void;
|
|
5
|
+
export declare const setTransform: (contextInstance: ReactZoomPanPinchContext) => (newPositionX: number, newPositionY: number, newScale: number, animationTime?: number, animationType?: keyof typeof animations) => void;
|
|
6
|
+
export declare const resetTransform: (contextInstance: ReactZoomPanPinchContext) => (animationTime?: number, animationType?: keyof typeof animations) => void;
|
|
7
|
+
export declare const centerView: (contextInstance: ReactZoomPanPinchContext) => (scale?: number, animationTime?: number, animationType?: keyof typeof animations) => void;
|
|
8
|
+
export declare const zoomToElement: (contextInstance: ReactZoomPanPinchContext) => (node: HTMLElement | string, scale?: number, animationTime?: number, animationType?: keyof typeof animations) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactZoomPanPinchContext } from "../../models";
|
|
2
|
+
import { animations } from "../animations/animations.constants";
|
|
3
|
+
import { PositionType } from "../../models/calculations.model";
|
|
4
|
+
export declare const handleCalculateButtonZoom: (contextInstance: ReactZoomPanPinchContext, delta: number, step: number) => number;
|
|
5
|
+
export declare function handleZoomToViewCenter(contextInstance: ReactZoomPanPinchContext, delta: number, step: number, animationTime: number, animationType: keyof typeof animations): void;
|
|
6
|
+
export declare function resetTransformations(contextInstance: ReactZoomPanPinchContext, animationTime: number, animationType: keyof typeof animations): void;
|
|
7
|
+
export declare function getOffset(element: HTMLElement): PositionType;
|
|
8
|
+
export declare function calculateZoomToNode(contextInstance: ReactZoomPanPinchContext, node: HTMLElement, customZoom?: number): {
|
|
9
|
+
positionX: number;
|
|
10
|
+
positionY: number;
|
|
11
|
+
scale: number;
|
|
12
|
+
};
|
|
13
|
+
export declare function isValidZoomNode(node: HTMLElement | null): boolean;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { BoundsType, LibrarySetup, PositionType, VelocityType, AnimationType, ReactZoomPanPinchProps, ReactZoomPanPinchState } from "../models";
|
|
2
|
+
type StartCoordsType = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
} | null;
|
|
6
|
+
export declare class ZoomPanPinch {
|
|
7
|
+
props: ReactZoomPanPinchProps;
|
|
8
|
+
mounted: boolean;
|
|
9
|
+
transformState: ReactZoomPanPinchState;
|
|
10
|
+
setup: LibrarySetup;
|
|
11
|
+
observer?: ResizeObserver;
|
|
12
|
+
wrapperComponent: HTMLDivElement | null;
|
|
13
|
+
contentComponent: HTMLDivElement | null;
|
|
14
|
+
isInitialized: boolean;
|
|
15
|
+
bounds: BoundsType | null;
|
|
16
|
+
previousWheelEvent: WheelEvent | null;
|
|
17
|
+
wheelStopEventTimer: ReturnType<typeof setTimeout> | null;
|
|
18
|
+
wheelAnimationTimer: ReturnType<typeof setTimeout> | null;
|
|
19
|
+
isPanning: boolean;
|
|
20
|
+
startCoords: StartCoordsType;
|
|
21
|
+
lastTouch: number | null;
|
|
22
|
+
distance: null | number;
|
|
23
|
+
lastDistance: null | number;
|
|
24
|
+
pinchStartDistance: null | number;
|
|
25
|
+
pinchStartScale: null | number;
|
|
26
|
+
pinchMidpoint: null | PositionType;
|
|
27
|
+
velocity: VelocityType | null;
|
|
28
|
+
velocityTime: number | null;
|
|
29
|
+
lastMousePosition: PositionType | null;
|
|
30
|
+
animate: boolean;
|
|
31
|
+
animation: AnimationType | null;
|
|
32
|
+
maxBounds: BoundsType | null;
|
|
33
|
+
pressedKeys: {
|
|
34
|
+
[key: string]: boolean;
|
|
35
|
+
};
|
|
36
|
+
constructor(props: ReactZoomPanPinchProps);
|
|
37
|
+
mount: () => void;
|
|
38
|
+
unmount: () => void;
|
|
39
|
+
update: (newProps: ReactZoomPanPinchProps) => void;
|
|
40
|
+
initializeWindowEvents: () => void;
|
|
41
|
+
cleanupWindowEvents: () => void;
|
|
42
|
+
handleInitializeWrapperEvents: (wrapper: HTMLDivElement) => void;
|
|
43
|
+
handleInitialize: (contentComponent: HTMLDivElement) => void;
|
|
44
|
+
onWheelZoom: (event: WheelEvent) => void;
|
|
45
|
+
onPanningStart: (event: MouseEvent) => void;
|
|
46
|
+
onPanning: (event: MouseEvent) => void;
|
|
47
|
+
onPanningStop: (event: MouseEvent | TouchEvent) => void;
|
|
48
|
+
onPinchStart: (event: TouchEvent) => void;
|
|
49
|
+
onPinch: (event: TouchEvent) => void;
|
|
50
|
+
onPinchStop: (event: TouchEvent) => void;
|
|
51
|
+
onTouchPanningStart: (event: TouchEvent) => void;
|
|
52
|
+
onTouchPanning: (event: TouchEvent) => void;
|
|
53
|
+
onTouchPanningStop: (event: TouchEvent) => void;
|
|
54
|
+
onDoubleClick: (event: MouseEvent | TouchEvent) => void;
|
|
55
|
+
clearPanning: (event: MouseEvent) => void;
|
|
56
|
+
setKeyPressed: (e: KeyboardEvent) => void;
|
|
57
|
+
setKeyUnPressed: (e: KeyboardEvent) => void;
|
|
58
|
+
isPressingKeys: (keys: string[]) => boolean;
|
|
59
|
+
setTransformState: (scale: number, positionX: number, positionY: number) => void;
|
|
60
|
+
setCenter: () => void;
|
|
61
|
+
applyTransformation: () => void;
|
|
62
|
+
getContext: () => import("../models").ReactZoomPanPinchRef;
|
|
63
|
+
/**
|
|
64
|
+
* Initialization
|
|
65
|
+
*/
|
|
66
|
+
init: (wrapperComponent: HTMLDivElement, contentComponent: HTMLDivElement) => void;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ReactZoomPanPinchContext } from "../../models/context.model";
|
|
2
|
+
export declare function handlePanningStart(contextInstance: ReactZoomPanPinchContext, event: MouseEvent | TouchEvent): void;
|
|
3
|
+
export declare function handleAlignToBounds(contextInstance: ReactZoomPanPinchContext): void;
|
|
4
|
+
export declare function handlePanning(contextInstance: ReactZoomPanPinchContext, clientX: number, clientY: number): void;
|
|
5
|
+
export declare function handlePanningEnd(contextInstance: ReactZoomPanPinchContext): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PositionType, ReactZoomPanPinchContext, ReactZoomPanPinchState } from "../../models";
|
|
2
|
+
export declare const isPanningStartAllowed: (contextInstance: ReactZoomPanPinchContext, event: MouseEvent | TouchEvent) => boolean;
|
|
3
|
+
export declare const isPanningAllowed: (contextInstance: ReactZoomPanPinchContext) => boolean;
|
|
4
|
+
export declare const handlePanningSetup: (contextInstance: ReactZoomPanPinchContext, event: MouseEvent) => void;
|
|
5
|
+
export declare const handleTouchPanningSetup: (contextInstance: ReactZoomPanPinchContext, event: TouchEvent) => void;
|
|
6
|
+
export declare function handlePanToBounds(contextInstance: ReactZoomPanPinchContext): Omit<ReactZoomPanPinchState, "previousScale"> | undefined;
|
|
7
|
+
export declare function handlePaddingAnimation(contextInstance: ReactZoomPanPinchContext, positionX: number, positionY: number): void;
|
|
8
|
+
export declare function handleNewPosition(contextInstance: ReactZoomPanPinchContext, newPositionX: number, newPositionY: number, paddingValueX: number, paddingValueY: number): void;
|
|
9
|
+
export declare const getPanningClientPosition: (contextInstance: ReactZoomPanPinchContext, clientX: number, clientY: number) => PositionType;
|
|
10
|
+
export declare const getPaddingValue: (contextInstance: ReactZoomPanPinchContext, size: number) => number;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PositionType } from "../../models";
|
|
2
|
+
import { ReactZoomPanPinchContext } from "../../models/context.model";
|
|
3
|
+
export declare function getSizeMultiplier(wrapperComponent: HTMLDivElement, equalToMove: boolean): number;
|
|
4
|
+
export declare function handleCalculateVelocity(contextInstance: ReactZoomPanPinchContext, position: PositionType): void;
|
|
5
|
+
export declare function handleVelocityPanning(contextInstance: ReactZoomPanPinchContext): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ReactZoomPanPinchContext } from "../../models/context.model";
|
|
2
|
+
export declare const isVelocityCalculationAllowed: (contextInstance: ReactZoomPanPinchContext) => boolean;
|
|
3
|
+
export declare const isVelocityAllowed: (contextInstance: ReactZoomPanPinchContext) => boolean;
|
|
4
|
+
export declare function getVelocityMoveTime(contextInstance: ReactZoomPanPinchContext, velocity: number): number;
|
|
5
|
+
export declare function getVelocityPosition(newPosition: number, startPosition: number, currentPosition: number, isLocked: boolean, limitToBounds: boolean, minPosition: number, maxPosition: number, minTarget: number, maxTarget: number, step: number): number;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ReactZoomPanPinchContext } from "../../models";
|
|
2
|
+
export declare const handlePinchStart: (contextInstance: ReactZoomPanPinchContext, event: TouchEvent) => void;
|
|
3
|
+
export declare const handlePinchZoom: (contextInstance: ReactZoomPanPinchContext, event: TouchEvent) => void;
|
|
4
|
+
export declare const handlePinchStop: (contextInstance: ReactZoomPanPinchContext) => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PositionType, ReactZoomPanPinchContext } from "../../models";
|
|
2
|
+
export declare const isPinchStartAllowed: (contextInstance: ReactZoomPanPinchContext, event: TouchEvent) => boolean;
|
|
3
|
+
export declare const isPinchAllowed: (contextInstance: ReactZoomPanPinchContext) => boolean;
|
|
4
|
+
export declare const calculateTouchMidPoint: (event: TouchEvent, scale: number, contentComponent: HTMLDivElement) => PositionType;
|
|
5
|
+
export declare const getTouchDistance: (event: TouchEvent) => number;
|
|
6
|
+
export declare const calculatePinchZoom: (contextInstance: ReactZoomPanPinchContext, currentDistance: number) => number;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ReactZoomPanPinchContext } from "../../models";
|
|
2
|
+
export declare const handleWheelStart: (contextInstance: ReactZoomPanPinchContext, event: WheelEvent) => void;
|
|
3
|
+
export declare const handleWheelZoom: (contextInstance: ReactZoomPanPinchContext, event: WheelEvent) => void;
|
|
4
|
+
export declare const handleWheelStop: (contextInstance: ReactZoomPanPinchContext, event: WheelEvent) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactZoomPanPinchContext, PositionType } from "../../models";
|
|
2
|
+
export declare const isWheelAllowed: (contextInstance: ReactZoomPanPinchContext, event: WheelEvent) => boolean;
|
|
3
|
+
export declare const getDeltaY: (event?: WheelEvent) => 1 | -1 | 0;
|
|
4
|
+
export declare function getDelta(event: WheelEvent, customDelta?: number | null): number;
|
|
5
|
+
export declare function getMousePosition(event: WheelEvent | MouseEvent | TouchEvent, contentComponent: HTMLDivElement, scale: number): PositionType;
|
|
6
|
+
export declare const handleCalculateWheelZoom: (contextInstance: ReactZoomPanPinchContext, delta: number, step: number, disable: boolean, getTarget?: boolean) => number;
|
|
7
|
+
export declare const handleWheelZoomStop: (contextInstance: ReactZoomPanPinchContext, event: WheelEvent) => boolean;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ReactZoomPanPinchContext, ReactZoomPanPinchState } from "../../models";
|
|
2
|
+
export declare function handleZoomToPoint(contextInstance: ReactZoomPanPinchContext, scale: number, mouseX: number, mouseY: number): Omit<ReactZoomPanPinchState, "previousScale"> | undefined;
|
|
3
|
+
export declare function handleAlignToScaleBounds(contextInstance: ReactZoomPanPinchContext, mousePositionX?: number, mousePositionY?: number): void;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BoundsType, PositionType, ReactZoomPanPinchContext } from "../../models";
|
|
2
|
+
export declare function handleCalculateZoomPositions(contextInstance: ReactZoomPanPinchContext, mouseX: number, mouseY: number, newScale: number, bounds: BoundsType, limitToBounds: boolean): PositionType;
|
|
3
|
+
export declare function checkZoomBounds(zoom: number, minScale: number, maxScale: number, zoomPadding: number, enablePadding: boolean): number;
|