import type { TCameraAnimationOptions, TCameraTarget } from '@mappedin/mappedin-js'; import type { FollowCameraOptions } from '../types'; import type { ContainerDimensions, FollowMode, NavigationCoordinate, ScreenCoordinate } from './types'; /** * Calculates the Euclidean distance between two screen coordinates. * @param point1 First screen coordinate * @param point2 Second screen coordinate * @returns Distance in pixels */ export declare function calculatePixelDistance(point1: ScreenCoordinate, point2: ScreenCoordinate): number; /** * Calculates the center point of a container. * @param dimensions Container width and height * @returns Screen coordinate at center */ export declare function getContainerCenter(dimensions: ContainerDimensions): ScreenCoordinate; /** * Calculates pixel distance from a point to the center of a container. * @param point Screen coordinate to measure from * @param containerDimensions Container width and height * @returns Distance in pixels, or undefined if container has no size */ export declare function calculateDistanceFromCenter(point: ScreenCoordinate, containerDimensions: ContainerDimensions): number | undefined; /** * Calculates the pan-exit threshold in pixels for a given container size. * @param containerDimensions Container width and height in CSS pixels * @returns Threshold in pixels (clamped) */ export declare function computePanExitThresholdPixels(containerDimensions: ContainerDimensions): number; /** * Determines if a pan distance exceeds the threshold for exiting follow mode. * @param pixelDistance Distance in pixels from blue dot to screen center * @param thresholdPixels Pixel threshold (usually from {@link computePanExitThresholdPixels}) * @returns True if distance exceeds threshold */ export declare function shouldExitFollowMode(pixelDistance: number | undefined, thresholdPixels: number): boolean; /** * Creates the default camera target for follow mode. * @param mode The follow mode * @param options Optional camera options * @returns Camera target with defaults applied */ export declare function createDefaultCameraTarget(mode: FollowMode, options?: FollowCameraOptions): TCameraTarget; /** * Creates camera animation options with defaults. * @param options Optional camera options * @returns Animation options with defaults applied */ export declare function createDefaultCameraOptions(options?: FollowCameraOptions): TCameraAnimationOptions; /** * Simplifies navigation path coordinates for efficient bearing calculations. * @param coordinates Array of navigation coordinates * @param currentFloorId ID of the current floor to filter by * @param tolerance Simplification tolerance (default 0.00001) * @returns Simplified path as array of [longitude, latitude] pairs */ export declare function simplifyPathCoordinates(coordinates: NavigationCoordinate[], currentFloorId: string, tolerance?: number): number[][]; /** * Computes the bearing along a navigation path at a given position. * @param simplifiedPath Simplified path as [longitude, latitude] pairs * @param position Current position as [longitude, latitude] * @returns Bearing in degrees, or undefined if cannot be computed */ export declare function computePathBearing(simplifiedPath: number[][], position: [number, number]): number | undefined; /** * Computes the bearing for follow mode based on the current mode and position data. * @param mode Current follow mode * @param heading Device heading (for position-and-heading mode) * @param customBearing Custom bearing from options (for position-only mode) * @param simplifiedPath Simplified navigation path (for position-and-path-direction mode) * @param position Current position as [longitude, latitude] * @returns Bearing in degrees, or undefined to keep current bearing */ export declare function computeFollowBearing(mode: FollowMode, heading: number | null | undefined, customBearing: number | undefined, simplifiedPath: number[][] | undefined, position: [number, number]): number | undefined;