import type { ReactElement } from 'react'; import type { TransformMatrix, Scale, PinchDelta, GenericWheelEvent, Zoom as ZoomType } from './types'; export type ZoomProps = { /** Width of the zoom container. */ width: number; /** Height of the zoom container. */ height: number; /** * ```js * wheelDelta(event) * ``` * * A function that returns { scaleX,scaleY } factors to scale the matrix by. * Scale factors greater than 1 will increase (zoom in), less than 1 will decrease (zoom out). */ wheelDelta?: (event: GenericWheelEvent) => Scale; /** * ```js * pinchDelta(state) * ``` * * A function that returns { scaleX, scaleY, point } factors to scale the matrix by. * Scale factors greater than 1 will increase (zoom in), less than 1 will decrease (zoom out), the point is used to find where to zoom. * The state parameter is from react-use-gestures onPinch handler */ pinchDelta?: PinchDelta; /** Minimum x scale value for transform. */ scaleXMin?: number; /** Maximum x scale value for transform. */ scaleXMax?: number; /** Minimum y scale value for transform. */ scaleYMin?: number; /** Maximum y scale value for transform. */ scaleYMax?: number; /** * By default constrain() will only constrain scale values. To change * constraints you can pass in your own constrain function as a prop. * * For example, if you wanted to constrain your view to within [[0, 0], [width, height]]: * * ```js * function constrain(transformMatrix, prevTransformMatrix) { * const min = applyMatrixToPoint(transformMatrix, { x: 0, y: 0 }); * const max = applyMatrixToPoint(transformMatrix, { x: width, y: height }); * if (max.x < width || max.y < height) { * return prevTransformMatrix; * } * if (min.x > 0 || min.y > 0) { * return prevTransformMatrix; * } * return transformMatrix; * } * ``` */ constrain?: (transform: TransformMatrix, prevTransform: TransformMatrix) => TransformMatrix; /** Initial transform matrix to apply. */ initialTransformMatrix?: TransformMatrix; children: (zoom: ZoomType) => ReactElement; }; declare function Zoom({ scaleXMin, scaleXMax, scaleYMin, scaleYMax, initialTransformMatrix, wheelDelta, pinchDelta, width, height, constrain, children, }: ZoomProps): ReactElement; export default Zoom; //# sourceMappingURL=Zoom.d.ts.map