import type { DateNumber, Time } from "@gb-transit/gtfs-loader"; import type { RouteCursor } from "./RouteCursor.js"; import type { Routes } from "../network/Timetable.js"; /** * No trip on the route is reachable. */ export declare const NO_TRIP = -1; /** * Finds the trip to board on a route, for one date. Maintains the position of the last trip * returned in order to reduce plan time. */ export declare class TripScanner { /** Trip the route being traversed is scanned back from, which only ever moves earlier */ private scanPosition; /** The calendar's slice for the date being scanned, or an empty one outside the period it covers */ private readonly runsToday; constructor(routes: Routes, date: DateNumber); /** * Start traversing the route the cursor is positioned on, scanning back from its last trip. * * The scan position is only valid for one traversal. The trip to board can only get earlier as * a route is walked, because a trip is only looked for at all where the stop can be reached * before the trip already boarded departs it, but a later traversal of the same route may start * at an earlier stop or a later time and need a trip further on than the last one found. */ startRoute(cursor: RouteCursor): void; /** * Return the index of the earliest trip on the route the cursor is positioned on that can be * boarded at the given position, or NO_TRIP if there isn't one. */ earliestTrip(cursor: RouteCursor, position: number, time: Time): number; }