import type { IActionDispatcher, SModelElementImpl } from "sprotty"; import { ZoomMouseListener as SprottyZoomMouseListener } from "sprotty"; import type { Action } from "sprotty-protocol"; /** * Mouse listener that handles zooming with the mouse wheel. * Adds animation support when no trackpad is used. * Based upon https://github.com/maplibre/maplibre-gl-js/blob/7dff5a6e79cfe64dfed38afc302fb6dc1e52eb19/src/ui/handler/scroll_zoom.ts */ export declare class ZoomMouseListener extends SprottyZoomMouseListener { /** * Action dispatcher to dispatch the zoom actions. */ protected readonly actionDispatcher: IActionDispatcher; /** * Type of the current zoom event. */ private type?; /** * Timeout to determine if a WheelEvent is caused by a mouse wheel. * Should be canceled if the type is detected earlier. */ private timeout?; /** * The time of the last wheel event. */ private lastWheelEventTime; /** * The delta to use for the next viewport update. */ private delta; /** * Rolling time delta and value, used to detect if the wheel event is caused by a trackpad. */ private rollingValues; /** * The previous easing function used for the zoom animation. * Used to create a new easing function that is continuous with the last one. */ private previousEasing?; /** * The current target zoom level */ targetZoom?: number; wheel(target: SModelElementImpl, event: WheelEvent): Action[]; /** * Detects the wheel type (wheel or trackpad) based on the value, and time since the last event. * If the type cannot be detected now, sets a timeout when the type can surely be determined. * * @param value the scaled delta value * @param viewport the viewport * @param viewportOffset the cursor position which should remain stable */ private detectWheelType; /** * Cancels the timeout if set. */ private clearTimeoutIfSet; /** * Updates the viewport * * @param viewport the viewport to update * @param viewportOffset the cursor position which should remain stable * @returns the actions to dispatch */ private updateViewport; /** * Generates the action to update the viewport. * * @param limitedZoom the limited zoom level * @param viewport the viewport to update * @param viewportOffset the cursor position which should remain stable * @param isWheel whether the action is caused by a wheel instead of a trackpad * @returns the action to update the viewport */ private generateUpdateViewportAction; /** * Computes the easing function for the zoom animation. * Ensures that the easing function is continuous with the last one. * * @returns the easing function */ private computeWheelEasing; } //# sourceMappingURL=zoom.d.ts.map