Interface HafasClient

interface HafasClient {
    arrivals: ((station:
        | string
        | Location
        | Station
        | Stop, options: undefined | DeparturesArrivalsOptions) => Promise<Arrivals>);
    departures: ((station:
        | string
        | Location
        | Station
        | Stop, options: undefined | DeparturesArrivalsOptions) => Promise<Departures>);
    journeys: ((from:
        | string
        | Location
        | Station
        | Stop, to:
        | string
        | Location
        | Station
        | Stop, options: undefined | JourneysOptions) => Promise<Journeys>);
    journeysFromTrip?: ((fromTripId: string, previousStopover: StopOver, to:
        | string
        | Location
        | Station
        | Stop, opt: undefined | JourneysFromTripOptions) => Promise<Journeys>);
    lines?: ((query: string, opt: undefined | LinesOptions) => Promise<LinesWithRealtimeData>);
    locations: ((name: string, options: undefined | LocationsOptions) => Promise<readonly (Location | Station | Stop)[]>);
    nearby: ((location: Location, options: undefined | NearByOptions) => Promise<readonly (Location | Station | Stop)[]>);
    radar?: ((box: BoundingBox, options: undefined | RadarOptions) => Promise<Radar>);
    reachableFrom?: ((address: Location, options: undefined | ReachableFromOptions) => Promise<DurationsWithRealtimeData>);
    refreshJourney?: ((refreshToken: string, options: undefined | RefreshJourneyOptions) => Promise<JourneyWithRealtimeData>);
    remarks?: ((opt: undefined | RemarksOptions) => Promise<WarningsWithRealtimeData>);
    serverInfo: ((opt: undefined | ServerOptions) => Promise<ServerInfo>);
    stop: ((id: string | Stop, options: undefined | StopOptions) => Promise<Location | Station | Stop>);
    trip?: ((id: string, options: undefined | TripOptions) => Promise<TripWithRealtimeData>);
    tripsByName?: ((lineNameOrFahrtNr: string, options: undefined | TripsByNameOptions) => Promise<TripsWithRealtimeData>);
}

Properties

arrivals: ((station:
    | string
    | Location
    | Station
    | Stop, options: undefined | DeparturesArrivalsOptions) => Promise<Arrivals>)

Retrieves arrivals

Type declaration

departures: ((station:
    | string
    | Location
    | Station
    | Stop, options: undefined | DeparturesArrivalsOptions) => Promise<Departures>)

Retrieves departures

Type declaration

journeys: ((from:
    | string
    | Location
    | Station
    | Stop, to:
    | string
    | Location
    | Station
    | Stop, options: undefined | JourneysOptions) => Promise<Journeys>)

Retrieves journeys

Type declaration

journeysFromTrip?: ((fromTripId: string, previousStopover: StopOver, to:
    | string
    | Location
    | Station
    | Stop, opt: undefined | JourneysFromTripOptions) => Promise<Journeys>)

Retrieves journeys from trip id to station

Type declaration

lines?: ((query: string, opt: undefined | LinesOptions) => Promise<LinesWithRealtimeData>)

Fetches all lines known to the HAFAS endpoint

Type declaration

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

Retrieves locations or stops

Type declaration

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

Retrieves nearby stops from location

Type declaration

radar?: ((box: BoundingBox, options: undefined | RadarOptions) => Promise<Radar>)

Retrieves all vehicles currently in an area.

Type declaration

reachableFrom?: ((address: Location, options: undefined | ReachableFromOptions) => Promise<DurationsWithRealtimeData>)

Retrieves stations reachable within a certain time from a location

Type declaration

refreshJourney?: ((refreshToken: string, options: undefined | RefreshJourneyOptions) => Promise<JourneyWithRealtimeData>)

refreshes a Journey

Type declaration

remarks?: ((opt: undefined | RemarksOptions) => Promise<WarningsWithRealtimeData>)

Fetches all remarks known to the HAFAS endpoint

Type declaration

serverInfo: ((opt: undefined | ServerOptions) => Promise<ServerInfo>)

Fetches meta information from the HAFAS endpoint

Type declaration

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

Retrieves information about a stop

Type declaration

trip?: ((id: string, options: undefined | TripOptions) => Promise<TripWithRealtimeData>)

Refetch information about a trip

Type declaration

tripsByName?: ((lineNameOrFahrtNr: string, options: undefined | TripsByNameOptions) => Promise<TripsWithRealtimeData>)

Retrieves trips by name.

Type declaration