minotor
Version:
A lightweight client-side transit routing library.
35 lines (34 loc) • 1.27 kB
TypeScript
import { Platform } from '../stops/stops.js';
import { StopsIndex } from '../stops/stopsIndex.js';
import { RouteType, Timetable } from '../timetable/timetable.js';
import { StopEntry } from './stops.js';
import { Maybe } from './utils.js';
export type GtfsProfile = {
routeTypeParser: (routeType: number) => Maybe<RouteType>;
platformParser?: (stopEntry: StopEntry) => Maybe<Platform>;
};
export declare class GtfsParser {
private path;
private profile;
constructor(path: string, profile?: GtfsProfile);
/**
* Parses a GTFS feed to extract all the data relevant to a given day in a transit-planner friendly format.
*
* @param date The active date.
* @param gtfsPath A path to the zipped GTFS feed.
* @param gtfsProfile The GTFS profile configuration.
* @returns An object containing the timetable and stops map.
*/
parse(date: Date): Promise<{
timetable: Timetable;
stopsIndex: StopsIndex;
}>;
/**
* Parses a GTFS feed to extract all stops.
*
* @param gtfsPath A path the zipped GTFS feed.
* @param gtfsProfile The GTFS profile configuration.
* @returns An object containing the timetable and stops map.
*/
parseStops(): Promise<StopsIndex>;
}