UNPKG

@any-routing/core

Version:

This library was generated with [Nx](https://nx.dev).

44 lines (43 loc) 1.93 kB
import { AnyRoutingDataResponse, RouteSummary } from './data-providers'; import { AnyRoutingEventsMap, AnyRoutingOptions, AnyRoutingState, Waypoint as InputWaypoint, InternalWaypoint, RecalculateOptions, Mode } from './libre-routing.model'; export declare class AnyRouting<R extends AnyRoutingDataResponse = AnyRoutingDataResponse> { private readonly dispatcher; private readonly geocoder?; private _options; private _plugins; private _initialState; private _state; get options(): AnyRoutingOptions; get data(): R; get state(): AnyRoutingState<R>; get dataProvider(): import("./data-providers").AnyRoutingDataProvider; get selectedRouteId(): number | undefined | null; private get waypoints(); constructor(options: AnyRoutingOptions); initialize(): void; onRemove(): void; setMode(mode: Mode): void; setWaypoints(waypoints: InputWaypoint[]): void; getWaypoint(waypointId: number): InternalWaypoint; recalculateRoute(opts?: RecalculateOptions & Record<string, any>): Promise<R | undefined>; on<E extends keyof AnyRoutingEventsMap>(event: E, callback: (event: AnyRoutingEventsMap[E]) => void): void; off<E extends keyof AnyRoutingEventsMap>(event: E, callback: (event: AnyRoutingEventsMap[E]) => void): void; selectRoute(routeId: number): void; reset(): void; getUniqueName(name: string): string; syncWaypointsPositions(waypoints: RouteSummary['waypoints']): InternalWaypoint[]; setState({ waypoints, data, routesShapeGeojson, selectedRouteId, }: { waypoints?: InputWaypoint[]; data?: R; routesShapeGeojson?: R['routesShapeGeojson']; selectedRouteId?: number | null; }): void; private initPlugins; private detachPlugins; private resolvePlugin; private _setState; private _patchState; private transformToInternalWaypoints; private fire; private geocodeWaypoints; }