minotor
Version:
A lightweight client-side transit routing library.
24 lines (23 loc) • 929 B
TypeScript
import { SourceStopId, StopId } from '../stops/stops.js';
import { ServiceRouteId, Transfer } from '../timetable/timetable.js';
import { ParsedStopsMap } from './stops.js';
import { TripId } from './trips.js';
export type GtfsTransferType = 0 | 1 | 2 | 3 | 4 | 5;
export type TransfersMap = Map<StopId, Transfer[]>;
export type TransferEntry = {
from_stop_id?: SourceStopId;
to_stop_id?: SourceStopId;
from_trip_id?: TripId;
to_trip_id?: TripId;
from_route_id?: ServiceRouteId;
to_route_id?: ServiceRouteId;
transfer_type: GtfsTransferType;
min_transfer_time?: number;
};
/**
* Parses the transfers.txt file from a GTFS feed.
*
* @param stopsStream The readable stream containing the stops data.
* @return A mapping of stop IDs to corresponding stop details.
*/
export declare const parseTransfers: (transfersStream: NodeJS.ReadableStream, stopsMap: ParsedStopsMap) => Promise<TransfersMap>;