import type { SModelElementImpl, ViewerOptions } from "sprotty"; import type { Action } from "sprotty-protocol"; import { TouchListener } from "../contrib/touch-tool.js"; /** * A touch listener that handles panning and zooming of the viewport */ export declare class ViewportTouchListener extends TouchListener { /** * The last positon a one-finger touch event occurred at * (Updated on touch start and touch move) */ private lastTouchPosition?; /** * The last distance (in screen units) between two fingers in a two-finger touch event * (Updated on touch start and touch move) */ private lastTouchDistance?; /** * The last midpoint between two fingers in a two-finger touch event * (Updated on touch start and touch move) */ private lastTouchMidpoint?; /** * The action dispatcher used to dispatch actions */ private actionDispatcher; /** * The viewer options used to limit the zoom level */ protected viewerOptions: ViewerOptions; touchStart(target: SModelElementImpl, event: TouchEvent): Action[]; touchMove(target: SModelElementImpl, event: TouchEvent): Action[]; /** * Calculates the new viewport when panning with one touch * * @param viewport the current viewport * @param event the touch event, should have exactly one touch * @returns the new viewport */ private calculateViewportFromOneTouch; /** * Calculates the new viewport when panning and zooming with two touches * * @param viewport the current viewport * @param event the touch event, should have exactly two touches * @returns the new viewport */ private calculateViewportFromTwoTouches; touchEnd(target: SModelElementImpl, event: TouchEvent): Action[]; /** * Calculates the distance of the firsts two touches in the list * * @param touches the list of touches * @returns the distance between the first two touches */ private calculateDistance; /** * Returns the midpoint of the first two touches in the list relative to the canvas bounds * * @param touches the list of touches * @param canvasBounds the bounds of the canvas in page coordinates * @returns the midpoint of the first two touches */ private calculateMidpoint; } //# sourceMappingURL=touch.d.ts.map