Interface HafasClient

interface HafasClient {
    arrivals: ((station, options) => Promise<Arrivals>);
    departures: ((station, options) => Promise<Departures>);
    journeys: ((from, to, options) => Promise<Journeys>);
    journeysFromTrip?: ((fromTripId, previousStopover, to, opt) => Promise<Journeys>);
    lines?: ((query, opt) => Promise<LinesWithRealtimeData>);
    locations: ((name, options) => Promise<readonly (Location | Station | Stop)[]>);
    nearby: ((location, options) => Promise<readonly (Location | Station | Stop)[]>);
    radar?: ((box, options) => Promise<Radar>);
    reachableFrom?: ((address, options) => Promise<DurationsWithRealtimeData>);
    refreshJourney?: ((refreshToken, options) => Promise<JourneyWithRealtimeData>);
    remarks?: ((opt) => Promise<WarningsWithRealtimeData>);
    serverInfo: ((opt) => Promise<ServerInfo>);
    stop: ((id, options) => Promise<Location | Station | Stop>);
    trip?: ((id, options) => Promise<TripWithRealtimeData>);
    tripsByName?: ((lineNameOrFahrtNr, options) => Promise<TripsWithRealtimeData>);
}

Properties

arrivals: ((station, options) => Promise<Arrivals>)

Retrieves arrivals

Type declaration

Param: station

uid of station

Param: options

options

departures: ((station, options) => Promise<Departures>)

Retrieves departures

Type declaration

Param: station

uid of station

Param: options

options

journeys: ((from, to, options) => Promise<Journeys>)

Retrieves journeys

Type declaration

Param: from

uid of station

Param: to

uid of station

Param: options

options

journeysFromTrip?: ((fromTripId, previousStopover, to, opt) => Promise<Journeys>)

Retrieves journeys from trip id to station

Type declaration

Param: fromTripId

id of trip

Param: previousStopover

previous stopover

Param: to

uid of station or Station or Stop

Param: options

options

lines?: ((query, opt) => Promise<LinesWithRealtimeData>)

Fetches all lines known to the HAFAS endpoint

Type declaration

Param: query

string

Param: opt

LinesOptions

locations: ((name, options) => Promise<readonly (Location | Station | Stop)[]>)

Retrieves locations or stops

Type declaration

Param: name

name of station

Param: options

options for search

nearby: ((location, options) => Promise<readonly (Location | Station | Stop)[]>)

Retrieves nearby stops from location

Type declaration

Param: location

location

Param: options

options for search

radar?: ((box, options) => Promise<Radar>)

Retrieves all vehicles currently in an area.

Type declaration

    • (box, options): Promise<Radar>
    • Retrieves all vehicles currently in an area.

      Parameters

      Returns Promise<Radar>

Param: box

area

Param: options

options for search

reachableFrom?: ((address, options) => Promise<DurationsWithRealtimeData>)

Retrieves stations reachable within a certain time from a location

Type declaration

Param: address

location

Param: options

options for search

refreshJourney?: ((refreshToken, options) => Promise<JourneyWithRealtimeData>)

refreshes a Journey

Type declaration

Param: refreshToken

refreshToken must be a string, taken from journey#refreshToken

Param: options

options

remarks?: ((opt) => Promise<WarningsWithRealtimeData>)

Fetches all remarks known to the HAFAS endpoint

Type declaration

Param: opt

RemarksOptions

serverInfo: ((opt) => Promise<ServerInfo>)

Fetches meta information from the HAFAS endpoint

Type declaration

Param: opt

ServerOptions

stop: ((id, options) => Promise<Location | Station | Stop>)

Retrieves information about a stop

Type declaration

Param: id

uid of station

Param: options

options for search

trip?: ((id, options) => Promise<TripWithRealtimeData>)

Refetch information about a trip

Type declaration

Param: id

trip id, see Leg#tripId

Param: name

name

Param: options

options

tripsByName?: ((lineNameOrFahrtNr, options) => Promise<TripsWithRealtimeData>)

Retrieves trips by name.

Type declaration

Param: lineNameOrFahrtNr

string

Param: options

options for search

Generated using TypeDoc