Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • API

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • new API(apiRequester: HTTPThrottled, _client: string, _versionToken?: string): API

Properties

Private _lastModified

_lastModified: number = 0

The Last-Modified time of the latest API response

apiRequester

apiRequester: HTTPThrottled

baseURL

baseURL: string = "https://skolmaten.se/api/3"

Base URL for Skolmaten's API

readonly

Accessors

Protected lastModified

  • get lastModified(): number
  • set lastModified(value: number): void

Methods

Protected _getMenu

  • _getMenu(school: string, force: boolean, week: string, year: string, lastModified: number, resolve: Function, reject: Function): void
  • Parameters

    • school: string
    • force: boolean
    • week: string
    • year: string
    • lastModified: number
    • resolve: Function
    • reject: Function

    Returns void

getMenu

  • getMenu(school: string, force?: boolean, week?: string, year?: string): Promise<WeekMenu>
  • Get menu for a school from Skolmaten's API

    Parameters

    • school: string

      The school from which to get the menu.

    • force: boolean = false

      Wheater or not to use 'If-Modified-Since' HTTP header

    • week: string = ...

      Week of the year to get the menu for.

    • year: string = ...

      Year to get the menu for.

    Returns Promise<WeekMenu>

Generated using TypeDoc