gtfs-to-html
Version:
Build human readable transit timetables as HTML, PDF or CSV from GTFS
78 lines (72 loc) • 2.33 kB
TypeScript
import { ConfigAgency, Timetable, Route, TimetablePage } from 'gtfs';
interface Config {
agencies: ConfigAgency[];
assetPath?: string;
sqlitePath?: string;
allowEmptyTimetables?: boolean;
beautify?: boolean;
coordinatePrecision?: number;
dateFormat?: string;
daysShortStrings?: string[];
daysStrings?: string[];
defaultOrientation?: string;
effectiveDate?: string;
endDate?: string;
groupTimetablesIntoPages?: boolean;
interpolatedStopSymbol?: string;
interpolatedStopText?: string;
linkStopUrls?: boolean;
mapStyleUrl?: string;
menuType?: 'none' | 'simple' | 'jump' | 'radio';
noDropoffSymbol?: string;
noDropoffText?: string;
noHead?: boolean;
noPickupSymbol?: string;
noPickupText?: string;
noRegularServiceDaysText?: string;
noServiceSymbol?: string;
noServiceText?: string;
outputFormat?: 'html' | 'pdf' | 'csv';
overwriteExistingFiles?: boolean;
outputPath?: string;
requestDropoffSymbol?: string;
requestDropoffText?: string;
requestPickupSymbol?: string;
requestPickupText?: string;
serviceNotProvidedOnText?: string;
serviceProvidedOnText?: string;
showArrivalOnDifference?: number;
showCalendarExceptions?: boolean;
showDuplicateTrips?: boolean;
showMap?: boolean;
showOnlyTimepoint?: boolean;
showRouteTitle?: boolean;
showStopCity?: boolean;
showStopDescription?: boolean;
showStoptimesForRequestStops?: boolean;
skipImport?: boolean;
sortingAlgorithm?: string;
startDate?: string;
templatePath?: string;
timeFormat?: string;
useParentStation?: boolean;
verbose?: boolean;
zipOutput?: boolean;
logFunction?: (text: string) => void;
}
interface FormattedTimetable extends Timetable {
route_ids: string[];
trip_ids: string[];
routes: Route[];
service_ids?: string[];
warnings?: string[];
has_continues_as_route?: boolean;
has_continues_from_route?: boolean;
}
interface FormattedTimetablePage extends TimetablePage {
timetables: FormattedTimetable[];
routes: Route[];
relativePath?: string;
}
declare const gtfsToHtml: (initialConfig: Config) => Promise<string>;
export { type Config, type FormattedTimetable, type FormattedTimetablePage, gtfsToHtml as default };