import { BaseNative } from '..'; import { Projection } from '../projections'; import { FeatureCollection } from '../geometry/feature'; import { DefaultLatLonKeys, GenericMapPos, MapPosVector, NativeVector } from '../core'; declare enum RoutingAction { HEAD_ON, FINISH, NO_TURN, GO_STRAIGHT, TURN_RIGHT, UTURN, TURN_LEFT, REACH_VIA_LOCATION, ENTER_ROUNDABOUT, LEAVE_ROUNDABOUT, STAY_ON_ROUNDABOUT, START_AT_END_OF_STREET, ENTER_AGAINST_ALLOWED_DIRECTION, LEAVE_AGAINST_ALLOWED_DIRECTION, GO_UP, GO_DOWN, WAIT } export interface RoutingRequest { projection: Projection; points: GenericMapPos[]; customOptions: any; } export interface RouteMatchingRequest { projection: Projection; points: GenericMapPos[]; accuracy?: number; customOptions?: any; } export interface RoutingServiceOptions {} export interface ValhallaRoutingServiceOptions { profile?: ValhallaProfile; } export interface RoutingInstruction { getPointIndex(): number; getTurnAngle(): number; getTime(): number; getStreetName(): string; getInstruction(): string; getDistance(): number; getAzimuth(): number; getAction(): RoutingAction; } export class RoutingInstructionVector extends NativeVector {} export interface RoutingResult { getPoints(): MapPosVector; getTotalTime(): number; getTotalDistance(): number; getInstructions(): RoutingInstructionVector; getRawResult(): string; } export interface RouteMatchingResult { getPoints(): MapPosVector; getProjection(): Projection; getRawResult(): string; } export class RoutingService extends BaseNative { calculateRoute(options: RoutingRequest, profile?: string, jsonStr?: U): Promise>; routingResultToJSON(options: RoutingResult): Promise; } export class ValhallaRoutingService extends RoutingService { profile: ValhallaProfile; matchRoute(options: RouteMatchingRequest, profile?: string): Promise>; public setConfigurationParameter(param: string, value: any); public getConfigurationParameter(param: string): any; public addLocale(key: string, json: string); } export interface PackageManagerRoutingServiceOptions extends RoutingServiceOptions { packageManager: PackageManager; } export class PackageManagerRoutingService extends RoutingService {} export type ValhallaProfile = 'car' | 'auto' | 'bus' | 'bicycle' | 'pedestrian' | 'truck' | 'motorcycle'; export interface ValhallaOfflineRoutingServiceOptions extends ValhallaRoutingServiceOptions { path: string; } export class ValhallaOfflineRoutingService extends ValhallaRoutingService { profile: ValhallaProfile; } export interface MultiValhallaOfflineRoutingServiceOptions extends ValhallaRoutingServiceOptions {} export class MultiValhallaOfflineRoutingService extends ValhallaRoutingService { add(database: string); remove(database: string); } export interface ValhallaOnlineRoutingServiceOptions extends ValhallaRoutingServiceOptions { apiKey?: string; customServiceURL?: string; httpHeaders?: { [k: string]: string }; timeout?: number; } export class ValhallaOnlineRoutingService extends ValhallaRoutingService { customServiceURL: string; httpHeaders?: { [k: string]: string }; timeout?: number; profile: ValhallaProfile; } export interface PackageManagerValhallaRoutingServiceOptions extends ValhallaRoutingServiceOptions { packageManager: CartoPackageManager; } export class PackageManagerValhallaRoutingService extends ValhallaRoutingService {} export interface SGREOfflineRoutingServiceOptions { projection: Projection; features: FeatureCollection; config: any; } export class SGREOfflineRoutingService extends RoutingService {} export interface OSRMOfflineRoutingServiceOptions { path?: string; } export class OSRMOfflineRoutingService extends RoutingService {}