Options
All
  • Public
  • Public/Protected
  • All
Menu
since

0.0.1

classdesc

Perform calls to the the Västtrafik API

Hierarchy

  • API

Index

Constructors

constructor

Properties

Private _accessToken

_accessToken: string = ""

The access token to use for authorization

property

apiRequester

apiRequester: HTTPThrottled

baseURL

baseURL: string = "https://api.vasttrafik.se/bin/rest.exe/v2"

Base URL for Västtrafik's API

property
readonly

zone

zone: MomentZone = ...

moment-timezone Zone object

property
readonly

Methods

Private _getRawDepartures

  • _getRawDepartures(stop: string, datetime: Moment, timeSpan?: number, needJourneyDetail?: boolean): Promise<any>
  • GET data from the Västtrafik's "departureBoard" endpoint

    since

    0.1.0

    Parameters

    • stop: string

      The ID of the stop to get departures from

    • datetime: Moment

      The time and date of which to get departures

    • timeSpan: number = 60

      To get the next departures in a specified timespan of up to 24 hours, in minutes

    • needJourneyDetail: boolean = false

      Whether or not the reference URL for the journey detail service is needed

    Returns Promise<any>

getDepartures

  • getDepartures(stop: string, datetime?: Moment, timeSpan?: number, needJourneyDetail?: boolean): Promise<Stop>
  • GET and parse data from the Västtrafik's "departureBoard" endpoint

    since

    0.0.1

    Parameters

    • stop: string

      The ID of the stop to get departures from

    • datetime: Moment = ...

      The time and date of which to get departures

    • timeSpan: number = 60

      To get the next departures in a specified timespan of up to 24 hours, in minutes

    • needJourneyDetail: boolean = false

      Whether or not the reference URL for the journey detail service is needed

    Returns Promise<Stop>

Generated using TypeDoc