minotor
Version:
A lightweight client-side transit routing library.
34 lines (33 loc) • 1.15 kB
TypeScript
import { StopId } from '../stops/stops.js';
import { StopsIndex } from '../stops/stopsIndex.js';
import { Time } from '../timetable/time.js';
import { Timetable } from '../timetable/timetable.js';
import { Query } from './query.js';
import { Result } from './result.js';
import { Leg } from './route.js';
export type TripLeg = ReachingTime & {
leg?: Leg;
};
export type ReachingTime = {
time: Time;
legNumber: number;
origin: StopId;
};
export declare class Router {
private readonly timetable;
private readonly stopsIndex;
constructor(timetable: Timetable, stopsIndex: StopsIndex);
/**
* Evaluates possible transfers for a given query on a transport
* network, updating the earliest arrivals at various stops and marking new
* stops that can be reached through these transfers.
*/
private considerTransfers;
/**
* The main Raptor algorithm implementation.
*
* @param query The query containing the main parameters for the routing.
* @returns A result object containing data structures allowing to reconstruct routes and .
*/
route(query: Query): Result;
}