import type { Time } from "../../core/util/Animation"; import type { Animation } from "../../core/util/Entity"; import type { IDisposer } from "../../core/util/Disposer"; import type { IPoint } from "../../core/util/IPoint"; import type { ISpritePointerEvent } from "../../core/render/Sprite"; import { Container, IContainerSettings, IContainerPrivate, IContainerEvents } from "../../core/render/Container"; export interface IZoomableContainerSettings extends IContainerSettings { /** * Highest zoom level, as the scale of the contents. * * @default 32 */ maxZoomLevel?: number; /** * Lowest zoom level, as the scale of the contents. * * @default 1 */ minZoomLevel?: number; /** * Factor each zoom in or out (a button or a wheel step) multiplies or * divides the zoom level by. * * @default 2 */ zoomStep?: number; /** * Enables zooming with a two-finger pinch on touch devices. * * @default true */ pinchZoom?: boolean; /** * Duration of zoom animations in milliseconds. * * @default 600 */ animationDuration?: number; /** * Easing function of zoom animations. * * @default am5.ease.out(am5.ease.cubic) */ animationEasing?: (t: Time) => Time; /** * How far the zoomed-in contents can be panned out of view, as a fraction * of their width and height. * * @default 0.4 */ maxPanOut?: number; } export interface IZoomableContainerPrivate extends IContainerPrivate { } export interface IZoomableContainerEvents extends IContainerEvents { } /** * A [[Container]] whose `contents` can be zoomed with the wheel, a pinch or * [[ZoomTools]], and panned by dragging. * * @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/containers/#Zoomable_container} for more info * @since 5.8.0 * @important */ export declare class ZoomableContainer extends Container { static className: string; static classNames: Array; _settings: IZoomableContainerSettings; _privateSettings: IZoomableContainerPrivate; _events: IZoomableContainerEvents; protected _za?: Animation; protected _txa?: Animation; protected _tya?: Animation; protected _movePoints: { [index: number]: IPoint; }; protected _downScale: number; protected _downX: number; protected _downY: number; protected _pinchDP?: IDisposer; /** * The container that zooms and pans. Add elements to `contents.children`, * not to the ZoomableContainer's own `children`. * * @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/containers/#Zoomable_container} for more info */ contents: Container; protected _wheelDp: IDisposer | undefined; protected _afterNew(): void; _prepareChildren(): void; protected _handleSetWheel(): void; protected _handleWheelZoom(delta: number, point: IPoint): void; /** * Zooms to a level, keeping the contents under `point` in place. The level * is kept between `minZoomLevel` and `maxZoomLevel`. * * @param point Point in the container's coordinates * @param level Zoom level * @return Zoom animation */ zoomToPoint(point: IPoint, level: number): Animation | undefined; /** * Zooms in by `zoomStep`, around the container's center. * * @return Zoom animation */ zoomIn(): Animation | undefined; /** * Zooms out by `zoomStep`, around the container's center. * * @return Zoom animation */ zoomOut(): Animation | undefined; /** * Takes the contents back to their home view: scale `1`, not panned. */ goHome(): void; protected _animateTo(x: number, y: number, scale: number): void; protected _handleThisUp(_event: ISpritePointerEvent): void; protected _handleThisDown(event: ISpritePointerEvent): void; protected _handleThisMove(event: ISpritePointerEvent): void; protected _handlePinch(): void; } //# sourceMappingURL=ZoomableContainer.d.ts.map