UNPKG

mobility-toolbox-js

Version:

Toolbox for JavaScript applications in the domains of mobility and logistics.

17 lines (16 loc) 868 B
import type { RealtimeAPIDeparturesById } from '../../api/RealtimeAPI'; import type { RealtimeDepartureExtended } from '../../types'; /** * This function sort Departures by arrival time and filter out unwanted departures: * - when dparture time is in the past * - when departure are duplicated * - when departure is not in the next 30 min * * @param {Object} depObject The object containing departures by id. * @param {boolean} [sortByMinArrivalTime=false] If true sort departures by arrival time. * @param {number} [maxDepartureAge=30] The maximum departure age in minutes. * @return {RealtimeDeparture[]} Return departures array. * @private */ declare const sortAndfilterDepartures: (depObject: RealtimeAPIDeparturesById, sortByMinArrivalTime?: boolean, maxDepartureAge?: number) => RealtimeDepartureExtended[]; export default sortAndfilterDepartures;