import { DatabaseConnection } from "../../database/DatabaseConnection"; import { Transfer } from "../file/Transfer"; import { CRS, Stop } from "../file/Stop"; import { Association } from "../native/Association"; import { RSID, STP, TUID } from "../native/OverlayRecord"; import { ScheduleResults } from "./ScheduleBuilder"; import { FixedLink } from "../file/FixedLink"; /** * Provide access to the CIF/TTIS data in a vaguely GTFS-ish shape. */ export declare class CIFRepository { private readonly db; private readonly stream; private readonly stationCoordinates; constructor(db: DatabaseConnection, stream: any, stationCoordinates: StationCoordinates); /** * Return the interchange time between each station */ getTransfers(): Promise; /** * Return all the stops with some configurable long/lat applied */ getStops(): Promise; /** * Return the schedules and z trains. These queries probably require some explanation: * * The first query selects the stop times for all passenger services between now and + 3 months. It's important that * the stop time location is mapped to physical stations to avoid getting fake CRS codes from the tiploc data. * * The second query selects all the z-trains (usually replacement buses) within three months. They already use CRS * codes as the location so avoid the disaster above. * * The argument range is a mysql expression like '3 MONTH'. * It is NOT SANITIZED so it cannot be untrusted user input. */ getSchedules(range: string): Promise; /** * Get associations */ getAssociations(): Promise; /** * Return the ALF information */ getFixedLinks(): Promise; private getFixedLinkRow; /** * Close the underlying database */ end(): Promise; } export interface ScheduleStopTimeRow { id: number; train_uid: TUID; retail_train_id: RSID; runs_from: string; runs_to: string; monday: 0 | 1; tuesday: 0 | 1; wednesday: 0 | 1; thursday: 0 | 1; friday: 0 | 1; saturday: 0 | 1; sunday: 0 | 1; stp_indicator: STP; crs_code: CRS; train_category: string; atoc_code: string | null; public_arrival_time: string | null; public_departure_time: string | null; scheduled_arrival_time: string | null; scheduled_departure_time: string | null; platform: string; activity: string; train_class: null | "S" | "B"; reservations: null | "R" | "S" | "A"; } export type StationCoordinates = { [crs: string]: { stop_lat: number; stop_lon: number; stop_name: string; wheelchair_boarding: 0 | 1 | 2; }; };