import { LngLatLike } from 'maplibre-gl'; import { TravelMode, GeometryType, AvoidType, ApproachType } from '@src/common/interface'; import { NBRequestStatus } from './common'; export interface SnapToRoadsRequest { /** Pipe separated list of points along a path on which a snap to road will be done. The default maximum limit is 200 */ path: LngLatLike[]; /** Pipe separated unix timestamps for each location. Unit: seconds */ timestamps?: number[]; /** Pipe separated Radiuses of each location for performing snap to road. Unit: meters */ radiuses?: number[]; /** A parameter which which sets the transportation mode for the route. PS: Only the 4w/car profile is enabled by default. The other customised routing profiles are only supported in premium plan. */ mode?: TravelMode | string; /** Enable to interpolate the path. Default: `false` Note: might return more points */ interpolate?: boolean; /** Setting this will ensure the route avoids ferry, tolls or highways. */ avoid?: AvoidType; /** A semicolon-separated list indicating the side of the road from which to approach waypoints in a requested route. If provided, the number of approaches must be one more than the number of waypoints. */ approaches?: ApproachType[]; /** Sets the output format of the route geometry in the response.If `geojson` is selected, the response will include geometry in polyline6 format and will also include a geojson object that defines the route polyline. Default: `polyline6` */ geometry?: GeometryType; /** * enable to ignore location not found in service boundary. * Note: enable this to ignore outliers, otherwise an error will be thrown. * Default: `false` **/ tolerateOutlier?: boolean; } export type SnapToRoadsResult = { /** A string indicating the state of the response. This is a separate code than the HTTP status code. On normal valid responses, the value will be `Ok`. */ status: NBRequestStatus; /** error message if status is not 200. */ msg?: string; snappedPoints: Array; /** Total travel distance of the snapped path. */ distance: number; /** Encoded geometry value in `polyline` or `polyline6`. */ geometry: string[]; /** geojson when the geometry parameter given is `geojson` */ geojson: { coordinates: number[][]; }; } | string; export interface SnapToRoadsResponsePoint { /** Latitude and longitude. */ location: { latitude: number; longitude: number; }; /** Index of original input array. */ originalIndex: number; /** Bearing angle of the snapped point. */ bearing: number; /** Distance of the snapped point from the original. */ distance: number; /** Name of the street the coordinate snapped to. */ name: string; } export declare class SnapToRoadsService { getSnapToRoads(opt: SnapToRoadsRequest): Promise; } //# sourceMappingURL=snap-to-roads.d.ts.map