import { type GeoJsonPosition } from "@trackunit/geo-json-utils"; import type { CategoryKey, ControlConfig } from "../../controls/types"; import type { FitParticipation, RouteLayerHandle, RouteStyle } from "../types"; export type UseRouteOptions = Readonly<{ /** Unique ID for this layer */ id: string; /** Human-readable name */ name: string; /** Ordered waypoints that define the route */ waypoints: ReadonlyArray; /** Route styling */ style: RouteStyle; /** Whether the route is interactive (clickable/hoverable). Default: true */ interactive?: boolean; /** * Controls to contribute to the map UI, keyed by semantic area. * Omit entirely (or omit a key) to contribute nothing to that area. */ controls?: Partial>>; /** Whether the layer is currently loading its initial data. Omit for static (non-loading) layers. */ loading?: boolean; /** Controls whether this layer's bounds are included in fit-to-content operations. Default: `"all"` */ fitParticipation?: FitParticipation; }>; export type UseRouteReturn = RouteLayerHandle; /** * `useRoute` -- creates a route layer handle from an array of waypoints. * * Converts the waypoints to a GeoJSON LineString internally. * Routes need at least 2 waypoints to be rendered. * * @example * ```tsx * const route = useRoute({ * id: "delivery-route", * name: "Delivery Route", * waypoints: [[-73.98, 40.75], [-73.97, 40.76], [-73.96, 40.77]], * style: { color: "blue", width: 3, showDirectionArrows: true }, * }); * ``` */ export declare const useRoute: (options: UseRouteOptions) => UseRouteReturn;