-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.js
140 lines (127 loc) · 5.42 KB
/
types.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/**
* @typedef {object} one_call_weather_data_response
* @property {number} lat
* @property {number} lon
* @property {string} timezone
* @property {number} timezone_offset
* @property {current} current
* @property {hourly[]} hourly
* @property {daily[]} daily
*/
/**
* OpenWeatherMap API response for one call weather data
* @typedef {object} current
* @property {number} dt Time of the forecasted data, Unix, UTC
* @property {number} sunrise
* @property {number} sunset
* @property {number} temp Temperature. Units – default: kelvin, metric: Celsius, imperial: Fahrenheit.
* @property {number} feels_like Temperature. This accounts for the human perception of weather. Units – default: kelvin, metric: Celsius, imperial: Fahrenheit.
* @property {number} pressure Atmospheric pressure on the sea level, hPa
* @property {number} humidity Humidity, %
* @property {number} dew_point Atmospheric temperature (varying according to pressure and humidity) below which water droplets begin to condense and dew can form. Units – default: kelvin, metric: Celsius, imperial: Fahrenheit.
* @property {number} uvi UV index
* @property {number} clouds Cloudiness, %
* @property {number} visibility Average visibility, metres. The maximum value of the visibility is 10km
* @property {number} wind_speed Wind speed. Units – default: metre/sec, metric: metre/sec, imperial: miles/hour
* @property {number} wind_deg Wind direction, degrees (meteorological)
* @property {weather[]} weather
// Temporarily adding these properties to the current object
* @property {number} aqi Air Quality Index. Possible values: 1, 2, 3, 4, 5. Where 1 = Good, 2 = Fair, 3 = Moderate, 4 = Poor, 5 = Very Poor.
*/
/**
* @typedef {object} weather
* @property {number} id
* @property {string} main
* @property {string} description
* @property {string} icon
*/
/**
* @typedef {object} hourly
* @property {number} dt Time of the forecasted data, Unix, UTC
* @property {number} temp Temperature. Units – default: kelvin, metric: Celsius, imperial: Fahrenheit.
* @property {number} feels_like Temperature. This accounts for the human perception of weather. Units – default: kelvin, metric: Celsius, imperial: Fahrenheit.
* @property {number} pressure Atmospheric pressure on the sea level, hPa
* @property {number} humidity Humidity, %
* @property {number} dew_point Atmospheric temperature (varying according to pressure and humidity) below which water droplets begin to condense and dew can form. Units – default: kelvin, metric: Celsius, imperial: Fahrenheit.
* @property {number} uvi UV index
* @property {number} clouds Cloudiness, %
* @property {number} visibility Average visibility, metres. The maximum value of the visibility is 10km
* @property {number} wind_speed Wind speed. Units – default: metre/sec, metric: metre/sec, imperial: miles/hour
* @property {number} wind_deg Wind direction, degrees (meteorological)
* @property {number} [wind_gust] Wind gust. Units – default: metre/sec, metric: metre/sec, imperial: miles/hour.
* @property {weather[]} weather
* @property {number} pop Probability of precipitation. The values of the parameter vary between 0 and 1, where 0 is equal to 0%, 1 is equal to 100%
*/
/**
* @typedef {object} rain
* @property {number} "1h"
*/
/**
* @typedef {object} snow
* @property {number} 1h
*/
/**
* @typedef {object} daily
* @property {number} dt Time of the forecasted data, Unix, UTC
* @property {number} sunrise
* @property {number} sunset
* @property {number} moonrise
* @property {number} moonset
* @property {number} moon_phase
* @property {temp} temp
* @property {feels_like} feels_like
* @property {number} pressure Atmospheric pressure on the sea level, hPa
* @property {number} humidity Humidity, %
* @property {number} dew_point Atmospheric temperature (varying according to pressure and humidity) below which water droplets begin to condense and dew can form. Units – default: kelvin, metric: Celsius, imperial: Fahrenheit.
* @property {number} wind_speed Wind speed. Units – default: metre/sec, metric: metre/sec, imperial: miles/hour
* @property {number} wind_deg Wind direction, degrees (meteorological)
* @property {number} wind_gust
* @property {weather[]} weather
* @property {number} clouds
* @property {number} pop
* @property {number} uvi
*/
/**
* @typedef {object} temp
* @property {number} day
* @property {number} min
* @property {number} max
* @property {number} night
* @property {number} eve
* @property {number} morn
*/
/**
* @typedef {object} feels_like
* @property {number} day
* @property {number} night
* @property {number} eve
* @property {number} morn
*/
/**
Data from AirNow API (https://docs.airnowapi.org/)
* @typedef {object} AirNowData
* @property {string} DateObserved
* @property {number} HourObserved
* @property {string} LocalTimeZone
* @property {string} ReportingArea
* @property {string} StateCode
* @property {number} Latitude
* @property {number} Longitude
* @property {string} ParameterName
* @property {number} AQI
* @property {Category} Category
*/
/**
* @typedef {object} Category
* @property {number} Number
* @property {string} Name
*/
// Object for air quality index (AQI) color codes, numbers, and descriptions
// map of AQI numbers to AQI objects, which contain color codes and descriptions
// https://docs.airnowapi.org/aq101
/**
* @typedef {object} AQI
* @property {number} CategoryNumber
* @property {string} Color
* @property {string} Description
*/