Options
All
  • Public
  • Public/Protected
  • All
Menu

External module scripts/weather

Manage weather information

Index

Variables

Const KEY

KEY: "KEY_WEATHER" = "KEY_WEATHER"

API key

Const MIN_CALL_FREQ

MIN_CALL_FREQ: number = ChromeTime.MSEC_IN_HOUR

The most frequently we will call the API

Const URL_BASE

URL_BASE: "https://api.openweathermap.org/data/2.5/weather" = "https://api.openweathermap.org/data/2.5/weather"

Base url of weather API

Functions

getLocation

  • getLocation(options?: object): Promise<object>
  • Get the current geo location. Will prompt if needed

    throws

    An error if we failed to get location

    Parameters

    • Default value options: object = DEF_LOC_OPTIONS

      api options

      • enableHighAccuracy: boolean
      • maximumAge: number
      • timeout: number

    Returns Promise<object>

    current location

kToC

  • kToC(temp: number): string

kToF

  • kToF(temp: number): string

update

  • update(force?: boolean): Promise<void>
  • Update the weather

    throws

    An error if update failed

    Parameters

    • Default value force: boolean = false

      if true, force update

    Returns Promise<void>

updateUnits

  • updateUnits(): void

Object literals

Const DEF_LOC

DEF_LOC: object

Default geolocation options

lat

lat: number = 0

lon

lon: number = 0

Const DEF_LOC_OPTIONS

DEF_LOC_OPTIONS: object

Default geolocation permission options

enableHighAccuracy

enableHighAccuracy: boolean = false

maximumAge

maximumAge: number = 0

timeout

timeout: number = 60000

Const DEF_WEATHER

DEF_WEATHER: object

Default weather

city

city: string = ""

dayNight

dayNight: string = ""

description

description: string = ""

id

id: number = 0

temp

temp: string = ""

tempValue

tempValue: number = 0

time

time: number = 0

Generated using TypeDoc