import { type LngLat } from './geometry'; /** * - `here`: the clicked point (undirected on the map, or snapped onto a clicked line) * - `line-start` / `line-end`: ends of a clicked line, bearing = line direction * - `into-node`: on a street approaching a junction, looking into the junction */ export type ViewpointRole = 'here' | 'line-start' | 'line-end' | 'into-node' | 'custom'; export type Viewpoint = { id: string; lngLat: LngLat; /** Map bearing in degrees; `null` = undirected (look around in all four directions). */ bearing: number | null; role: ViewpointRole; label?: string; }; /** * - `forward` / `back`: along / against the viewpoint bearing * - `right` / `left`: across it, for the clicked spot on a street (house fronts, side streets) * - `N` `E` `S` `W`: compass directions for undirected viewpoints * - `into`: into a junction (single direction) */ export type ViewDirectionKind = 'forward' | 'right' | 'back' | 'left' | 'N' | 'E' | 'S' | 'W' | 'into'; export type ViewDirection = { /** Stable key `${viewpointId}:${kind}`. */ key: string; viewpointId: string; kind: ViewDirectionKind; bearing: number; }; export declare const viewDirections: (viewpoint: Viewpoint) => ViewDirection[]; export declare const viewpointFromPoint: (lngLat: LngLat, id?: string) => Viewpoint; export type ViewpointsFromLineOptions = { /** Move start/end viewpoints this far into the line so they sit on the street, not the junction. */ endInsetMeters?: number; /** Skip the click viewpoint when it is this close to start or end. */ minSpacingMeters?: number; }; /** * Viewpoints for a clicked line: its start, the clicked point snapped onto it, and its end. * All share the line direction as bearing, so each offers a forward and a back view. */ export declare const viewpointsFromLine: (line: LngLat[], click: LngLat, { endInsetMeters, minSpacingMeters }?: ViewpointsFromLineOptions) => Viewpoint[]; /** * One viewpoint per street approaching `node`, `distanceMeters` up the street, looking into the * junction. Each approach is a line with one end at (or near) the node; its direction does not matter. */ export declare const viewpointsIntoNode: (node: LngLat, approaches: LngLat[][], { distanceMeters: offset }?: { distanceMeters?: number; }) => Viewpoint[];