UNPKG

minotor

Version:

A lightweight client-side transit routing library.

28 lines (27 loc) 814 B
import { Stop } from '../stops/stops.js'; import { Duration } from '../timetable/duration.js'; import { Time } from '../timetable/time.js'; import { ServiceRoute, TransferType } from '../timetable/timetable.js'; export type PickUpDropOffType = 'REGULAR' | 'NOT_AVAILABLE' | 'MUST_PHONE_AGENCY' | 'MUST_COORDINATE_WITH_DRIVER'; export type BaseLeg = { from: Stop; to: Stop; }; export type Transfer = BaseLeg & { minTransferTime?: Duration; type: TransferType; }; export type VehicleLeg = BaseLeg & { route: ServiceRoute; departureTime: Time; arrivalTime: Time; }; export type Leg = Transfer | VehicleLeg; export declare class Route { legs: Leg[]; constructor(legs: Leg[]); departureTime(): Time; arrivalTime(): Time; totalDuration(): Duration; print(): string; }