import type { Time } from "@gb-transit/gtfs-loader"; import { type RouteIdx, type Routes, type StopIdx } from "../network/Timetable.js"; /** * A view positioned on one route, holding the offsets its slices start at so that the scan works * in positions and trip numbers local to the route rather than indexes into the global arrays. * * It is a view, not a copy: every accessor reads through to the timetable. Resolving the offsets * costs three loads, so it is done once per route in `moveTo` rather than once per stop, which is * also why a cursor is reused across routes instead of being allocated for each one. */ export declare class RouteCursor { private readonly routes; private atRoute; private stopsBase; private timesBase; private firstTrip; private stopsInRoute; private tripsInRoute; constructor(routes: Routes); /** * The route the cursor is positioned on */ get route(): RouteIdx; /** * Number of stops on the route, which is also the stride of its arrivals and departures */ get numStops(): number; /** * Number of trips on the route */ get numTrips(): number; /** * Position the cursor on a route, resolving where its slice of each global array starts. */ moveTo(route: RouteIdx): void; stopAt(position: number): StopIdx; /** * Whether the route takes passengers on at the given position */ canPickUp(position: number): boolean; /** * Whether the route sets passengers down at the given position */ canDropOff(position: number): boolean; arrival(trip: number, position: number): Time; departure(trip: number, position: number): Time; /** * The route's nth trip in the global, route major numbering the calendar is bit packed in */ globalTrip(trip: number): number; }