import type { StopID, StopTime, Trip } from "@gb-transit/gtfs-loader"; import type { Network } from "../network/Network.js"; import type { RouteIdx, StopIdx } from "../network/Timetable.js"; /** * A leg taken on a vehicle: the route, the trip on it, and the positions boarded and alighted at. * Four integers, because that is all the scan needs to record. */ export type Connection = [route: RouteIdx, trip: number, from: number, to: number]; /** * A leg taken on foot, as an index into Network.transfers */ export type TransferIdx = number; /** * The connection that gave the best arrival at each stop in each round. Indexed by stop, then * sparsely by round, so a stop with no entries was never reached. */ export type ConnectionIndex = (Connection | TransferIdx)[][]; /** * A leg taken on foot is recorded as an index into the network's transfers, a leg taken on a * vehicle as a tuple. */ export declare function isTransfer(connection: Connection | TransferIdx): connection is TransferIdx; /** * The rest turn a connection back into the feed's terms, which is only worth doing for a journey * that is actually returned. */ /** * The stop the connection was boarded at */ export declare function originIndexOf(network: Network, [route, , from]: Connection): StopIdx; /** * The stop the connection was boarded at, as the feed names it */ export declare function originOf(network: Network, connection: Connection): StopID; /** * The feed's trip the connection was made on */ export declare function tripOf(network: Network, [, trip]: Connection): Trip; /** * The stop times the connection covers, from the call boarded at to the call alighted at, * including the passing points between them. */ export declare function stopTimesOf(network: Network, connection: Connection): StopTime[];