export declare class ControlsFeature { private enhancer; private controlsContainer; isDestroyed: boolean; constructor(enhancer: SvgEnhancer); init(): void; private createControls; destroy(): void; } export declare class DblclickResetFeature { private enhancer; private handleDblClick; constructor(enhancer: SvgEnhancer); init(): void; private _handleDblClick; destroy(): void; } declare class EventEmitter { private events; on(event: string, listener: Listener): this; emit(event: string, ...args: any[]): boolean; off(event: string, listener?: Listener): this; removeAllListeners(): this; } export declare class FullscreenFeature { private enhancer; constructor(enhancer: SvgEnhancer); toggleFullscreen(): void; destroy(): void; } /** * Initializes an SvgToolbelt instance on the given container. * This is a convenience function that creates a new SvgToolbelt instance and calls init() on it. * * @param selectorOrElements * - If string: CSS selector to find containers holding an (e.g. ".zoomable-svg") * - If HTMLElement[]: list of containers to initialize * - If HTMLElement: single container * @param config Partial config overrides */ export declare function initializeSvgToolbelt(selectorOrElements: string | HTMLElement | HTMLElement[], config?: Partial): void; /** * @deprecated initializeSvgZoom is deprecated and will be removed in a future version. Use initializeSvgToolbelt instead. */ export declare function initializeSvgZoom(selectorOrElements: string | HTMLElement | HTMLElement[], config?: Partial): void; export declare class KeyboardFeature { private enhancer; private handleKeyDown; isDestroyed: boolean; constructor(enhancer: SvgEnhancer); init(): void; private _handleKeyDown; private emitArrowEvent; destroy(): void; } /** * Simple event emitter for feature communication. */ declare type Listener = (...args: any[]) => void; export declare class NoContextMenuFeature { private enhancer; private handleContextMenu; constructor(enhancer: SvgEnhancer); init(): void; destroy(): void; } export declare class PanFeature { private enhancer; private isDragging; private lastMouseX; private lastMouseY; private handleMouseDown; private handleMouseMove; private handleMouseUp; constructor(enhancer: SvgEnhancer); init(): void; private _handleMouseDown; private _handleMouseMove; private _handleMouseUp; destroy(): void; } /** * Base class to provide core zoom/pan functionality to any element. * All features (zoom, pan, touch, keyboard, controls, fullscreen, etc.) are added as needed. */ export declare class SvgEnhancer extends EventEmitter { container: HTMLElement; svg: SVGSVGElement | null; config: SvgEnhancerConfig; isDestroyed: boolean; scale: number; translateX: number; translateY: number; features: SvgEnhancerFeatures; private transitionTimeoutId; constructor(container: HTMLElement, config?: Partial); /** * Initialize the container (e.g., add CSS classes), and then features will hook in. */ init(): void; protected setupContainer(): void; /** * Ensure panning does not exceed reasonable limits based on content and zoom level. * Allows panning until only 10% of content remains visible. */ constrainPan(): void; /** * Destroy all features and remove listeners. */ destroy(): void; /** * Convenience getter for the container's bounding rect. */ get containerRect(): DOMRect; /** * Reset the SVG to its default scale and position with transition animation. */ reset(): void; /** * Apply the current transform to the SVG without transition animation. */ applyTransform(): void; /** * Apply the current transform to the SVG with transition animation. */ applyTransformWithTransition(): void; /** * Try to get SVG bounds using getBBox method (works in real browsers) */ private _tryGetBoundsFromBBox; /** * Try to get SVG bounds from viewBox attribute */ private _tryGetBoundsFromViewBox; /** * Get SVG bounds from width/height attributes or fallback to defaults */ private _getBoundsFromAttributesOrDefault; /** * Get SVG bounds using fallback chain: getBBox -> viewBox -> attributes -> defaults */ private _getSvgBounds; } /** * Default configuration for SvgEnhancer. * Provides zoom/pan limits, UI controls, touch/keyboard support, etc. */ export declare interface SvgEnhancerConfig { minScale: number; maxScale: number; zoomStep: number; transitionDuration: number; showControls: boolean; controlsPosition: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'; enableTouch: boolean; enableKeyboard: boolean; showZoomLevelIndicator: boolean; } declare interface SvgEnhancerFeatures { zoom: any; pan: any; touch: any | null; keyboard: any | null; controls: any | null; fullscreen: any | null; dblclickReset: any; noContextMenu: any; zoomLevelIndicator: any | null; } /** * SvgZoom class: a high-level wrapper that sets up all features on the container: * - zoom (mouse wheel) * - pan (click & drag) * - touch (pinch & drag) * - keyboard (arrows / + / - / 0) * - on-screen controls (zoom in/out/reset, fullscreen) * - double-click to reset * - disable context menu */ export declare class SvgToolbelt extends SvgEnhancer { constructor(container: HTMLElement, config?: Partial); /** * Initialize all features, then apply any initial transforms. */ init(): void; /** Zoom in 1 step via public API */ zoomIn(): void; /** Zoom out 1 step via public API */ zoomOut(): void; } /** * @deprecated SvgZoom is deprecated and will be removed in a future version. Use SvgToolbelt instead. */ export declare class SvgZoom extends SvgToolbelt { constructor(container: HTMLElement, config?: Partial); } export declare class TouchFeature { private enhancer; private isDragging; private lastMouseX; private lastMouseY; private lastTouchDistance; private handleTouchStart; private handleTouchMove; private handleTouchEnd; constructor(enhancer: SvgEnhancer); init(): void; private _handleTouchStart; private _handleTouchMove; private _handleTouchEnd; destroy(): void; } export declare class ZoomFeature { private enhancer; private handleWheel; constructor(enhancer: SvgEnhancer); init(): void; private _handleWheel; zoomIn(): void; zoomOut(): void; zoomAt(x: number, y: number, delta: number): void; destroy(): void; } /** * ZoomLevelIndicatorFeature * * Displays a transient badge (e.g. "150%") whenever the zoom level changes. * The badge appears in the top-left corner by default and fades out after a delay. */ export declare class ZoomLevelIndicatorFeature { private enhancer; private badge; private hideTimeout; private onZoom; constructor(enhancer: SvgEnhancer); init(): void; private _onZoom; destroy(): void; } export { }