import React from 'react'; export type RouteTravelMode = 'DRIVING' | 'WALKING' | 'BICYCLING' | 'TRANSIT'; /** One leg of a multi-stop plan. */ export interface RouteDefinition { id: string; origin: { lat: number; lng: number; }; destination: { lat: number; lng: number; }; waypoints?: Array<{ lat: number; lng: number; }>; travelMode?: RouteTravelMode; /** Semantic token for the drawn line. Falls back to `--primary`. */ colorToken?: `--${string}`; label?: string; } export interface RouteMapProps extends React.HTMLAttributes { /** * Single route. Kept as the primary API — `routes` is additive. * Required unless `routes` is supplied. */ origin?: { lat: number; lng: number; }; destination?: { lat: number; lng: number; }; waypoints?: Array<{ lat: number; lng: number; }>; travelMode?: RouteTravelMode; /** * Several routes at once, each rendered with its own renderer and color. * A transition plan across sites needs distance and duration per leg, which a * single route could not express. */ routes?: RouteDefinition[]; /** Fires once per route as the Directions service returns it. */ onLegCalculated?: (routeId: string, distance: string, duration: string) => void; /** * Hands the route to the device's navigation app. Called with the route and a * ready-made Google Maps deep link the handler may use or ignore. */ onOpenExternalNavigation?: (route: RouteDefinition, url: string) => void; height?: string; mapId?: string; apiKey?: string; mapContainerClassName?: string; disableDefaultUI?: boolean; zoomControl?: boolean; streetViewControl?: boolean; mapTypeControl?: boolean; fullscreenControl?: boolean; onRouteCalculated?: (distance: string, duration: string) => void; /** Title shown when the Google Maps script fails to load. @default "Failed to load Google Maps" */ loadErrorTitle?: string; /** Hint shown below `loadErrorTitle`. @default "Check API key in Settings" */ loadErrorHint?: string; /** @default "Open in navigation" */ externalNavigationLabel?: string; } /** * Builds a Google Maps directions deep link for a route. * * Universal cross-platform URL: iOS and Android hand it to their maps app, and * the desktop browser opens the web client. Exported so a consumer can build the * link without wiring `onOpenExternalNavigation`. */ export declare function buildExternalNavigationUrl(route: RouteDefinition): string; /** * Specialized route display and calculation component for Google Maps. * * @description * Calculates and renders a route between an `origin` and `destination` point * using the Google Directions Service. Supports intermediate `waypoints` and * multiple `travelMode` options (DRIVING, WALKING, BICYCLING, TRANSIT). * * @ai-rules * 1. Provide `origin` and `destination` as LatLng objects `{ lat, lng }`. * 2. Use `onRouteCalculated` to receive the pre-formatted distance and duration strings. * 3. `travelMode` accepts 'DRIVING', 'WALKING', 'BICYCLING', or 'TRANSIT'. * 4. The Directions API must be enabled on your Google Maps API key. */ export declare const RouteMap: React.ForwardRefExoticComponent>;