@angelrove/forecast-utils 1.1.1 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +357 -716
- package/dist/types/OpenMeteo/current/useForecastCurrent.d.ts +1 -0
- package/dist/types/OpenMeteo/daily/useForecastDaily.d.ts +1 -0
- package/dist/types/OpenMeteo/hourly/useForecastHourly.d.ts +1 -0
- package/dist/types/OpenMeteo/index.d.ts +4 -0
- package/dist/types/OpenMeteo/weatherSymbol/weatherSymbol.d.ts +1 -0
- package/dist/types/astronomy/index.d.ts +4 -0
- package/dist/types/astronomy/moon/MoonCalc.d.ts +12 -0
- package/dist/types/astronomy/moon/parseBasicData.d.ts +2 -1
- package/dist/types/astronomy/sun/SunCalc.d.ts +6 -0
- package/dist/types/astronomy/timeZoneInfo.d.ts +2 -1
- package/dist/types/astronomy/timehelpers.d.ts +9 -3
- package/dist/types/astronomy/types.d.ts +0 -7
- package/dist/types/geolocation/getGeolocation.d.ts +2 -2
- package/dist/types/geolocation/index.d.ts +1 -0
- package/dist/types/utils/degreesToCompass.d.ts +11 -0
- package/dist/types/utils/index.d.ts +5 -0
- package/dist/types/utils/warning.d.ts +2 -0
- package/dist/types/utils/wind/WindArrow.d.ts +2 -1
- package/dist/types/utils/wind/windArrowTx.d.ts +2 -1
- package/dist/types/utils/wind/windLevel.d.ts +1 -0
- package/package.json +8 -5
- package/src/OpenMeteo/current/useForecastCurrent.js +2 -1
- package/src/OpenMeteo/daily/useForecastDaily.js +2 -1
- package/src/OpenMeteo/hourly/useForecastHourly.js +2 -1
- package/src/OpenMeteo/index.js +9 -0
- package/src/OpenMeteo/weatherSymbol/weatherSymbol.js +2 -1
- package/src/astronomy/index.js +13 -0
- package/src/astronomy/moon/MoonCalc.js +33 -14
- package/src/astronomy/moon/parseBasicData.js +2 -0
- package/src/astronomy/sun/SunCalc.js +17 -10
- package/src/astronomy/timeZoneInfo.js +5 -2
- package/src/astronomy/timehelpers.js +9 -4
- package/src/astronomy/types.js +2 -12
- package/src/geolocation/getGeolocation.js +7 -5
- package/src/geolocation/index.js +5 -0
- package/src/index.js +2 -3
- package/src/utils/degreesToCompass.js +25 -1
- package/src/utils/index.js +9 -0
- package/src/utils/warning.js +6 -7
- package/src/utils/wind/WindArrow.jsx +2 -1
- package/src/utils/wind/windArrowTx.js +2 -1
- package/src/utils/wind/windLevel.js +4 -1
package/README.md
CHANGED
|
@@ -1,239 +1,51 @@
|
|
|
1
1
|
## Modules
|
|
2
2
|
|
|
3
3
|
<dl>
|
|
4
|
-
<dt><a href="#
|
|
4
|
+
<dt><a href="#module_Astronomy">Astronomy</a></dt>
|
|
5
|
+
<dd></dd>
|
|
6
|
+
<dt><a href="#module_Astronomy/MoonCalc">Astronomy/MoonCalc</a></dt>
|
|
5
7
|
<dd><p>MoonCalc for calculating moon times, positions, and phases.</p>
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
|
|
8
|
+
<p> import { MoonCalc } from ...</p>
|
|
9
|
+
<p>Importante!:
|
|
10
|
+
¡Solo proporcionar HORA LOCAL DEL SISTEMA!: 'new Date()'</p>
|
|
9
11
|
</dd>
|
|
10
|
-
<dt><a href="#
|
|
11
|
-
<dd><p>SunCalc for calculating solar times, positions, and phases
|
|
12
|
-
<
|
|
13
|
-
<
|
|
14
|
-
|
|
12
|
+
<dt><a href="#module_Astronomy/SunCalc">Astronomy/SunCalc</a></dt>
|
|
13
|
+
<dd><p>SunCalc for calculating solar times, positions, and phases.</p>
|
|
14
|
+
<p> import { SunCalc } from ...</p>
|
|
15
|
+
<p>Importante:
|
|
16
|
+
¡Solo proporcionar HORA LOCAL DEL SISTEMA!: 'new Date()'
|
|
17
|
+
Con excepción de 'getSolarTime()': recibe la hora local correspondiente a la localización dada.</p>
|
|
15
18
|
</dd>
|
|
16
|
-
<dt><a href="#module_astronomy/time-date">astronomy/time-date</a></dt>
|
|
17
|
-
<dd></dd>
|
|
18
|
-
<dt><a href="#module_astronomy/time-date">astronomy/time-date</a></dt>
|
|
19
|
-
<dd></dd>
|
|
20
|
-
<dt><a href="#module_astronomy/types">astronomy/types</a></dt>
|
|
21
|
-
<dd></dd>
|
|
22
19
|
<dt><a href="#module_Geolocation">Geolocation</a></dt>
|
|
23
20
|
<dd></dd>
|
|
24
|
-
<dt><a href="#
|
|
25
|
-
<dd></dd>
|
|
26
|
-
<dt><a href="#OpenMeteo_daily">OpenMeteo:daily</a></dt>
|
|
27
|
-
<dd></dd>
|
|
28
|
-
<dt><a href="#OpenMeteo_hourly">OpenMeteo:hourly</a></dt>
|
|
29
|
-
<dd></dd>
|
|
30
|
-
<dt><a href="#OpenMeteo_weatherSymbol">OpenMeteo:weatherSymbol</a></dt>
|
|
31
|
-
<dd></dd>
|
|
32
|
-
<dt><a href="#module_utils">utils</a></dt>
|
|
21
|
+
<dt><a href="#module_OpenMeteo">OpenMeteo</a></dt>
|
|
33
22
|
<dd></dd>
|
|
34
|
-
<dt><a href="#
|
|
35
|
-
<dd></dd>
|
|
36
|
-
<dt><a href="#module_utils">utils</a></dt>
|
|
37
|
-
<dd></dd>
|
|
38
|
-
<dt><a href="#module_utils">utils</a></dt>
|
|
23
|
+
<dt><a href="#module_Utils">Utils</a></dt>
|
|
39
24
|
<dd></dd>
|
|
40
25
|
</dl>
|
|
41
26
|
|
|
42
|
-
<a name="
|
|
43
|
-
|
|
44
|
-
## MoonCalc
|
|
45
|
-
MoonCalc for calculating moon times, positions, and phases.
|
|
46
|
-
- import { MoonCalc } from '@angelrov/forecast';
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
* [MoonCalc](#module_MoonCalc)
|
|
50
|
-
* [~phasesES](#module_MoonCalc..phasesES) : <code>Object.<string, string></code>
|
|
51
|
-
* [~data(latitude, longitude, [date], [language])](#module_MoonCalc..data) ⇒ <code>MoonData</code>
|
|
52
|
-
* [~dataExt(latitude, longitude, [date], [language])](#module_MoonCalc..dataExt) ⇒ <code>Object</code>
|
|
53
|
-
* [~emoji(latitude, longitude, [date])](#module_MoonCalc..emoji) ⇒ <code>string</code>
|
|
54
|
-
* [~times(latitude, longitude, timezoneId, date)](#module_MoonCalc..times) ⇒ <code>Object</code>
|
|
55
|
-
* [~getUpOrDown(altitude, highest)](#module_MoonCalc..getUpOrDown) ⇒ <code>string</code>
|
|
56
|
-
|
|
57
|
-
<a name="module_MoonCalc..phasesES"></a>
|
|
58
|
-
|
|
59
|
-
### MoonCalc~phasesES : <code>Object.<string, string></code>
|
|
60
|
-
Mapa de fases lunares.
|
|
61
|
-
|
|
62
|
-
**Kind**: inner constant of [<code>MoonCalc</code>](#module_MoonCalc)
|
|
63
|
-
<a name="module_MoonCalc..data"></a>
|
|
64
|
-
|
|
65
|
-
### MoonCalc~data(latitude, longitude, [date], [language]) ⇒ <code>MoonData</code>
|
|
66
|
-
**Kind**: inner method of [<code>MoonCalc</code>](#module_MoonCalc)
|
|
67
|
-
|
|
68
|
-
| Param | Type | Default |
|
|
69
|
-
| --- | --- | --- |
|
|
70
|
-
| latitude | <code>number</code> | |
|
|
71
|
-
| longitude | <code>number</code> | |
|
|
72
|
-
| [date] | <code>Date</code> | <code>new Date()</code> |
|
|
73
|
-
| [language] | <code>string</code> | <code>"es-ES"</code> |
|
|
74
|
-
|
|
75
|
-
<a name="module_MoonCalc..dataExt"></a>
|
|
76
|
-
|
|
77
|
-
### MoonCalc~dataExt(latitude, longitude, [date], [language]) ⇒ <code>Object</code>
|
|
78
|
-
Información de la luna para una fecha y hora dadas.
|
|
79
|
-
La fecha y hora se devolverán en la zona horaria local.
|
|
80
|
-
|
|
81
|
-
**Kind**: inner method of [<code>MoonCalc</code>](#module_MoonCalc)
|
|
82
|
-
|
|
83
|
-
| Param | Type | Default |
|
|
84
|
-
| --- | --- | --- |
|
|
85
|
-
| latitude | <code>number</code> | |
|
|
86
|
-
| longitude | <code>number</code> | |
|
|
87
|
-
| [date] | <code>Date</code> | <code>new Date()</code> |
|
|
88
|
-
| [language] | <code>string</code> | <code>"es-ES"</code> |
|
|
89
|
-
|
|
90
|
-
<a name="module_MoonCalc..emoji"></a>
|
|
91
|
-
|
|
92
|
-
### MoonCalc~emoji(latitude, longitude, [date]) ⇒ <code>string</code>
|
|
93
|
-
**Kind**: inner method of [<code>MoonCalc</code>](#module_MoonCalc)
|
|
94
|
-
**Returns**: <code>string</code> - - Emoji of the moon phase
|
|
95
|
-
|
|
96
|
-
| Param | Type | Default |
|
|
97
|
-
| --- | --- | --- |
|
|
98
|
-
| latitude | <code>number</code> | |
|
|
99
|
-
| longitude | <code>number</code> | |
|
|
100
|
-
| [date] | <code>Date</code> | <code>new Date()</code> |
|
|
101
|
-
|
|
102
|
-
<a name="module_MoonCalc..times"></a>
|
|
103
|
-
|
|
104
|
-
### MoonCalc~times(latitude, longitude, timezoneId, date) ⇒ <code>Object</code>
|
|
105
|
-
**Kind**: inner method of [<code>MoonCalc</code>](#module_MoonCalc)
|
|
106
|
-
|
|
107
|
-
| Param | Type |
|
|
108
|
-
| --- | --- |
|
|
109
|
-
| latitude | <code>number</code> |
|
|
110
|
-
| longitude | <code>number</code> |
|
|
111
|
-
| timezoneId | <code>string</code> |
|
|
112
|
-
| date | <code>Date</code> |
|
|
113
|
-
|
|
114
|
-
<a name="module_MoonCalc..getUpOrDown"></a>
|
|
115
|
-
|
|
116
|
-
### MoonCalc~getUpOrDown(altitude, highest) ⇒ <code>string</code>
|
|
117
|
-
**Kind**: inner method of [<code>MoonCalc</code>](#module_MoonCalc)
|
|
118
|
-
**Returns**: <code>string</code> - - Up or down emoji
|
|
119
|
-
|
|
120
|
-
| Param | Type |
|
|
121
|
-
| --- | --- |
|
|
122
|
-
| altitude | <code>number</code> |
|
|
123
|
-
| highest | <code>Date</code> |
|
|
124
|
-
|
|
125
|
-
<a name="module_SunCalc"></a>
|
|
126
|
-
|
|
127
|
-
## SunCalc
|
|
128
|
-
SunCalc for calculating solar times, positions, and phases.
|
|
129
|
-
- import { SunCalc } from '@angelrov/forecast';
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
* [SunCalc](#module_SunCalc)
|
|
133
|
-
* [~SunCalc](#module_SunCalc..SunCalc)
|
|
134
|
-
* [~all(date, latitude, longitude, timezoneId)](#module_SunCalc..all) ⇒ <code>Object</code>
|
|
135
|
-
* [~times(date, latitude, longitude, timezoneId)](#module_SunCalc..times) ⇒ <code>Object</code>
|
|
136
|
-
* [~getSolarTime(date, lng, offsetSign, offset)](#module_SunCalc..getSolarTime) ⇒ <code>string</code>
|
|
137
|
-
* [~position(latitude, longitude)](#module_SunCalc..position) ⇒ <code>Object</code>
|
|
138
|
-
* [~getIsNight(lat, lon, timezoneId, date, dateStr)](#module_SunCalc..getIsNight) ⇒ <code>boolean</code>
|
|
139
|
-
* [~getPhase(altitude, noon)](#module_SunCalc..getPhase) ⇒ <code>string</code>
|
|
140
|
-
|
|
141
|
-
<a name="module_SunCalc..SunCalc"></a>
|
|
142
|
-
|
|
143
|
-
### SunCalc~SunCalc
|
|
144
|
-
IMPORTANTE!!:
|
|
145
|
-
¡Solo proporcionar HORA LOCAL DEL SISTEMA!: 'new Date()'
|
|
146
|
-
La única excepción es 'getSolarTime()': hay que darle la hora local correspondiente a la localización dada.
|
|
147
|
-
|
|
148
|
-
**Kind**: inner constant of [<code>SunCalc</code>](#module_SunCalc)
|
|
149
|
-
<a name="module_SunCalc..all"></a>
|
|
150
|
-
|
|
151
|
-
### SunCalc~all(date, latitude, longitude, timezoneId) ⇒ <code>Object</code>
|
|
152
|
-
**Kind**: inner method of [<code>SunCalc</code>](#module_SunCalc)
|
|
153
|
-
|
|
154
|
-
| Param | Type |
|
|
155
|
-
| --- | --- |
|
|
156
|
-
| date | <code>Date</code> |
|
|
157
|
-
| latitude | <code>number</code> |
|
|
158
|
-
| longitude | <code>number</code> |
|
|
159
|
-
| timezoneId | <code>string</code> |
|
|
27
|
+
<a name="module_Astronomy"></a>
|
|
160
28
|
|
|
161
|
-
|
|
29
|
+
## Astronomy
|
|
162
30
|
|
|
163
|
-
|
|
164
|
-
|
|
31
|
+
* [Astronomy](#module_Astronomy)
|
|
32
|
+
* [.exports.timeString([date], [sec])](#module_Astronomy.exports.timeString) ⇒ <code>string</code>
|
|
33
|
+
* [.exports.nowString(sec)](#module_Astronomy.exports.nowString) ⇒ <code>String</code>
|
|
34
|
+
* [.exports.dateFormat([date])](#module_Astronomy.exports.dateFormat) ⇒ <code>string</code>
|
|
35
|
+
* [.exports.getLocalTimeFromTz(timeZone, [date])](#module_Astronomy.exports.getLocalTimeFromTz) ⇒ <code>string</code>
|
|
36
|
+
* [.exports.getLocalTimeInfo(apiKey, lat, lng)](#module_Astronomy.exports.getLocalTimeInfo) ⇒ <code>Promise.<(any\|LocalTimeData)></code>
|
|
37
|
+
* [.AstroPosition](#module_Astronomy.AstroPosition) : <code>Object</code>
|
|
38
|
+
* [.LocalTimeData](#module_Astronomy.LocalTimeData) : <code>Object</code>
|
|
165
39
|
|
|
166
|
-
| Param | Type |
|
|
167
|
-
| --- | --- |
|
|
168
|
-
| date | <code>Date</code> |
|
|
169
|
-
| latitude | <code>number</code> |
|
|
170
|
-
| longitude | <code>number</code> |
|
|
171
|
-
| timezoneId | <code>string</code> |
|
|
172
40
|
|
|
173
|
-
|
|
41
|
+
* * *
|
|
174
42
|
|
|
175
|
-
|
|
176
|
-
**Kind**: inner method of [<code>SunCalc</code>](#module_SunCalc)
|
|
177
|
-
**Returns**: <code>string</code> - - Local time in "HH:mm" format
|
|
43
|
+
<a name="module_Astronomy.exports.timeString"></a>
|
|
178
44
|
|
|
179
|
-
|
|
180
|
-
| --- | --- | --- |
|
|
181
|
-
| date | <code>Date</code> | |
|
|
182
|
-
| lng | <code>number</code> | |
|
|
183
|
-
| offsetSign | <code>string</code> | "+" or "-" |
|
|
184
|
-
| offset | <code>number</code> | UTC offset in hours |
|
|
185
|
-
|
|
186
|
-
<a name="module_SunCalc..position"></a>
|
|
187
|
-
|
|
188
|
-
### SunCalc~position(latitude, longitude) ⇒ <code>Object</code>
|
|
189
|
-
**Kind**: inner method of [<code>SunCalc</code>](#module_SunCalc)
|
|
190
|
-
|
|
191
|
-
| Param | Type |
|
|
192
|
-
| --- | --- |
|
|
193
|
-
| latitude | <code>number</code> |
|
|
194
|
-
| longitude | <code>number</code> |
|
|
195
|
-
|
|
196
|
-
<a name="module_SunCalc..getIsNight"></a>
|
|
197
|
-
|
|
198
|
-
### SunCalc~getIsNight(lat, lon, timezoneId, date, dateStr) ⇒ <code>boolean</code>
|
|
199
|
-
**Kind**: inner method of [<code>SunCalc</code>](#module_SunCalc)
|
|
200
|
-
**Returns**: <code>boolean</code> - - true if it's night, false otherwise
|
|
201
|
-
|
|
202
|
-
| Param | Type |
|
|
203
|
-
| --- | --- |
|
|
204
|
-
| lat | <code>number</code> |
|
|
205
|
-
| lon | <code>number</code> |
|
|
206
|
-
| timezoneId | <code>string</code> |
|
|
207
|
-
| date | <code>number</code> \| <code>Date</code> |
|
|
208
|
-
| dateStr | <code>string</code> |
|
|
209
|
-
|
|
210
|
-
<a name="module_SunCalc..getPhase"></a>
|
|
211
|
-
|
|
212
|
-
### SunCalc~getPhase(altitude, noon) ⇒ <code>string</code>
|
|
213
|
-
**Kind**: inner method of [<code>SunCalc</code>](#module_SunCalc)
|
|
214
|
-
**Returns**: <code>string</code> - - The phase of the sun based on its altitude
|
|
215
|
-
|
|
216
|
-
| Param | Type |
|
|
217
|
-
| --- | --- |
|
|
218
|
-
| altitude | <code>number</code> |
|
|
219
|
-
| noon | <code>string</code> |
|
|
220
|
-
|
|
221
|
-
<a name="module_astronomy/time-date"></a>
|
|
222
|
-
|
|
223
|
-
## astronomy/time-date
|
|
224
|
-
|
|
225
|
-
* [astronomy/time-date](#module_astronomy/time-date)
|
|
226
|
-
* [.timeString([date], [sec])](#module_astronomy/time-date.timeString) ⇒ <code>string</code>
|
|
227
|
-
* [.dateFormat([date])](#module_astronomy/time-date.dateFormat) ⇒ <code>string</code>
|
|
228
|
-
* [.getLocalTimeFromTz(timeZone, [date])](#module_astronomy/time-date.getLocalTimeFromTz) ⇒ <code>string</code>
|
|
229
|
-
* [.getLocalTimeInfo(apiKey, lat, lng)](#module_astronomy/time-date.getLocalTimeInfo) ⇒ <code>Promise.<(any\|LocalTimeData)></code>
|
|
230
|
-
|
|
231
|
-
<a name="module_astronomy/time-date.timeString"></a>
|
|
232
|
-
|
|
233
|
-
### astronomy/time-date.timeString([date], [sec]) ⇒ <code>string</code>
|
|
45
|
+
### Astronomy.exports.timeString([date], [sec]) ⇒ <code>string</code>
|
|
234
46
|
Formatea una fecha a un string legible.
|
|
235
47
|
|
|
236
|
-
**Kind**: static method of [<code>
|
|
48
|
+
**Kind**: static method of [<code>Astronomy</code>](#module_Astronomy)
|
|
237
49
|
**Returns**: <code>string</code> - La fecha formateada.
|
|
238
50
|
|
|
239
51
|
| Param | Type | Default |
|
|
@@ -241,90 +53,42 @@ Formatea una fecha a un string legible.
|
|
|
241
53
|
| [date] | <code>Date</code> | |
|
|
242
54
|
| [sec] | <code>boolean</code> | <code>false</code> |
|
|
243
55
|
|
|
244
|
-
<a name="module_astronomy/time-date.dateFormat"></a>
|
|
245
|
-
|
|
246
|
-
### astronomy/time-date.dateFormat([date]) ⇒ <code>string</code>
|
|
247
|
-
Formatea una fecha a un string legible.
|
|
248
|
-
|
|
249
|
-
**Kind**: static method of [<code>astronomy/time-date</code>](#module_astronomy/time-date)
|
|
250
|
-
**Returns**: <code>string</code> - La fecha formateada.
|
|
251
|
-
|
|
252
|
-
| Param | Type | Default | Description |
|
|
253
|
-
| --- | --- | --- | --- |
|
|
254
|
-
| [date] | <code>Date</code> | <code>new Date()</code> | La fecha a formatear. |
|
|
255
|
-
|
|
256
|
-
<a name="module_astronomy/time-date.getLocalTimeFromTz"></a>
|
|
257
56
|
|
|
258
|
-
|
|
259
|
-
Get local time from timezone
|
|
260
|
-
|
|
261
|
-
**Kind**: static method of [<code>astronomy/time-date</code>](#module_astronomy/time-date)
|
|
262
|
-
**Returns**: <code>string</code> - - The formatted local time string.
|
|
263
|
-
|
|
264
|
-
| Param | Type | Default | Description |
|
|
265
|
-
| --- | --- | --- | --- |
|
|
266
|
-
| timeZone | <code>string</code> | | The timezone string (e.g., 'America/New_York'). |
|
|
267
|
-
| [date] | <code>Date</code> \| <code>number</code> | <code>new Date()</code> | The date object to format. Defaults to the current date. |
|
|
57
|
+
* * *
|
|
268
58
|
|
|
269
|
-
<a name="
|
|
59
|
+
<a name="module_Astronomy.exports.nowString"></a>
|
|
270
60
|
|
|
271
|
-
###
|
|
272
|
-
|
|
61
|
+
### Astronomy.exports.nowString(sec) ⇒ <code>String</code>
|
|
62
|
+
**Kind**: static method of [<code>Astronomy</code>](#module_Astronomy)
|
|
273
63
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
- <code>Error</code> - If the API request fails or returns an error status.
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
| Param | Type | Description |
|
|
282
|
-
| --- | --- | --- |
|
|
283
|
-
| apiKey | <code>string</code> | GoogleMaps API key. |
|
|
284
|
-
| lat | <code>number</code> | |
|
|
285
|
-
| lng | <code>number</code> | |
|
|
286
|
-
|
|
287
|
-
<a name="module_astronomy/time-date"></a>
|
|
64
|
+
| Param | Type |
|
|
65
|
+
| --- | --- |
|
|
66
|
+
| sec | <code>boolean</code> |
|
|
288
67
|
|
|
289
|
-
## astronomy/time-date
|
|
290
68
|
|
|
291
|
-
*
|
|
292
|
-
* [.timeString([date], [sec])](#module_astronomy/time-date.timeString) ⇒ <code>string</code>
|
|
293
|
-
* [.dateFormat([date])](#module_astronomy/time-date.dateFormat) ⇒ <code>string</code>
|
|
294
|
-
* [.getLocalTimeFromTz(timeZone, [date])](#module_astronomy/time-date.getLocalTimeFromTz) ⇒ <code>string</code>
|
|
295
|
-
* [.getLocalTimeInfo(apiKey, lat, lng)](#module_astronomy/time-date.getLocalTimeInfo) ⇒ <code>Promise.<(any\|LocalTimeData)></code>
|
|
69
|
+
* * *
|
|
296
70
|
|
|
297
|
-
<a name="
|
|
71
|
+
<a name="module_Astronomy.exports.dateFormat"></a>
|
|
298
72
|
|
|
299
|
-
###
|
|
73
|
+
### Astronomy.exports.dateFormat([date]) ⇒ <code>string</code>
|
|
300
74
|
Formatea una fecha a un string legible.
|
|
301
75
|
|
|
302
|
-
**Kind**: static method of [<code>
|
|
303
|
-
**Returns**: <code>string</code> - La fecha formateada.
|
|
304
|
-
|
|
305
|
-
| Param | Type | Default |
|
|
306
|
-
| --- | --- | --- |
|
|
307
|
-
| [date] | <code>Date</code> | |
|
|
308
|
-
| [sec] | <code>boolean</code> | <code>false</code> |
|
|
309
|
-
|
|
310
|
-
<a name="module_astronomy/time-date.dateFormat"></a>
|
|
311
|
-
|
|
312
|
-
### astronomy/time-date.dateFormat([date]) ⇒ <code>string</code>
|
|
313
|
-
Formatea una fecha a un string legible.
|
|
314
|
-
|
|
315
|
-
**Kind**: static method of [<code>astronomy/time-date</code>](#module_astronomy/time-date)
|
|
76
|
+
**Kind**: static method of [<code>Astronomy</code>](#module_Astronomy)
|
|
316
77
|
**Returns**: <code>string</code> - La fecha formateada.
|
|
317
78
|
|
|
318
79
|
| Param | Type | Default | Description |
|
|
319
80
|
| --- | --- | --- | --- |
|
|
320
81
|
| [date] | <code>Date</code> | <code>new Date()</code> | La fecha a formatear. |
|
|
321
82
|
|
|
322
|
-
<a name="module_astronomy/time-date.getLocalTimeFromTz"></a>
|
|
323
83
|
|
|
324
|
-
|
|
84
|
+
* * *
|
|
85
|
+
|
|
86
|
+
<a name="module_Astronomy.exports.getLocalTimeFromTz"></a>
|
|
87
|
+
|
|
88
|
+
### Astronomy.exports.getLocalTimeFromTz(timeZone, [date]) ⇒ <code>string</code>
|
|
325
89
|
Get local time from timezone
|
|
326
90
|
|
|
327
|
-
**Kind**: static method of [<code>
|
|
91
|
+
**Kind**: static method of [<code>Astronomy</code>](#module_Astronomy)
|
|
328
92
|
**Returns**: <code>string</code> - - The formatted local time string.
|
|
329
93
|
|
|
330
94
|
| Param | Type | Default | Description |
|
|
@@ -332,12 +96,15 @@ Get local time from timezone
|
|
|
332
96
|
| timeZone | <code>string</code> | | The timezone string (e.g., 'America/New_York'). |
|
|
333
97
|
| [date] | <code>Date</code> \| <code>number</code> | <code>new Date()</code> | The date object to format. Defaults to the current date. |
|
|
334
98
|
|
|
335
|
-
<a name="module_astronomy/time-date.getLocalTimeInfo"></a>
|
|
336
99
|
|
|
337
|
-
|
|
338
|
-
Google API: Get local time from any location
|
|
100
|
+
* * *
|
|
339
101
|
|
|
340
|
-
|
|
102
|
+
<a name="module_Astronomy.exports.getLocalTimeInfo"></a>
|
|
103
|
+
|
|
104
|
+
### Astronomy.exports.getLocalTimeInfo(apiKey, lat, lng) ⇒ <code>Promise.<(any\|LocalTimeData)></code>
|
|
105
|
+
Get local time from any location using Google Maps TimeZone API.
|
|
106
|
+
|
|
107
|
+
**Kind**: static method of [<code>Astronomy</code>](#module_Astronomy)
|
|
341
108
|
**Returns**: <code>Promise.<(any\|LocalTimeData)></code> - - An object containing the local time and timezone information:
|
|
342
109
|
**Throws**:
|
|
343
110
|
|
|
@@ -350,19 +117,13 @@ Google API: Get local time from any location
|
|
|
350
117
|
| lat | <code>number</code> | |
|
|
351
118
|
| lng | <code>number</code> | |
|
|
352
119
|
|
|
353
|
-
<a name="module_astronomy/types"></a>
|
|
354
|
-
|
|
355
|
-
## astronomy/types
|
|
356
120
|
|
|
357
|
-
*
|
|
358
|
-
* [~AstroPosition](#module_astronomy/types..AstroPosition) : <code>Object</code>
|
|
359
|
-
* [~MoonData](#module_astronomy/types..MoonData) : <code>Object</code>
|
|
360
|
-
* [~LocalTimeData](#module_astronomy/types..LocalTimeData) : <code>Object</code>
|
|
121
|
+
* * *
|
|
361
122
|
|
|
362
|
-
<a name="
|
|
123
|
+
<a name="module_Astronomy.AstroPosition"></a>
|
|
363
124
|
|
|
364
|
-
###
|
|
365
|
-
**Kind**:
|
|
125
|
+
### Astronomy.AstroPosition : <code>Object</code>
|
|
126
|
+
**Kind**: static typedef of [<code>Astronomy</code>](#module_Astronomy)
|
|
366
127
|
**Properties**
|
|
367
128
|
|
|
368
129
|
| Name | Type |
|
|
@@ -372,23 +133,13 @@ Google API: Get local time from any location
|
|
|
372
133
|
| direction | <code>string</code> |
|
|
373
134
|
| direction_full | <code>string</code> |
|
|
374
135
|
|
|
375
|
-
<a name="module_astronomy/types..MoonData"></a>
|
|
376
136
|
|
|
377
|
-
|
|
378
|
-
**Kind**: inner typedef of [<code>astronomy/types</code>](#module_astronomy/types)
|
|
379
|
-
**Properties**
|
|
137
|
+
* * *
|
|
380
138
|
|
|
381
|
-
|
|
382
|
-
| --- | --- | --- |
|
|
383
|
-
| position | <code>AstroPosition</code> | |
|
|
384
|
-
| next | <code>Object</code> | |
|
|
385
|
-
| next.newMoon | <code>string</code> | Date of the next new moon. |
|
|
386
|
-
| next.fullMoon | <code>string</code> | Date of the next full moon. |
|
|
139
|
+
<a name="module_Astronomy.LocalTimeData"></a>
|
|
387
140
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
### astronomy/types~LocalTimeData : <code>Object</code>
|
|
391
|
-
**Kind**: inner typedef of [<code>astronomy/types</code>](#module_astronomy/types)
|
|
141
|
+
### Astronomy.LocalTimeData : <code>Object</code>
|
|
142
|
+
**Kind**: static typedef of [<code>Astronomy</code>](#module_Astronomy)
|
|
392
143
|
**Properties**
|
|
393
144
|
|
|
394
145
|
| Name | Type | Description |
|
|
@@ -401,545 +152,437 @@ Google API: Get local time from any location
|
|
|
401
152
|
| offsetSign | <code>string</code> | The sign of the offset ('+' or '-'). |
|
|
402
153
|
| dstOffset | <code>number</code> | The DST offset in hours. |
|
|
403
154
|
|
|
404
|
-
<a name="module_Geolocation"></a>
|
|
405
155
|
|
|
406
|
-
|
|
407
|
-
<a name="exp_module_Geolocation--module.exports"></a>
|
|
156
|
+
* * *
|
|
408
157
|
|
|
409
|
-
|
|
410
|
-
Get the current geolocation of the device and reverse
|
|
411
|
-
geocode it to get the address.
|
|
158
|
+
<a name="module_Astronomy/MoonCalc"></a>
|
|
412
159
|
|
|
413
|
-
|
|
414
|
-
|
|
160
|
+
## Astronomy/MoonCalc
|
|
161
|
+
MoonCalc for calculating moon times, positions, and phases.
|
|
415
162
|
|
|
416
|
-
|
|
163
|
+
import { MoonCalc } from ...
|
|
417
164
|
|
|
418
|
-
|
|
165
|
+
Importante!:
|
|
166
|
+
¡Solo proporcionar HORA LOCAL DEL SISTEMA!: 'new Date()'
|
|
419
167
|
|
|
420
|
-
## OpenMeteo:current
|
|
421
|
-
<a name="OpenMeteo_current.useForecastCurrent"></a>
|
|
422
168
|
|
|
423
|
-
|
|
424
|
-
|
|
169
|
+
* [Astronomy/MoonCalc](#module_Astronomy/MoonCalc)
|
|
170
|
+
* [.phasesES](#module_Astronomy/MoonCalc.phasesES) : <code>Object.<string, string></code>
|
|
171
|
+
* [.data(latitude, longitude, [date], [language])](#module_Astronomy/MoonCalc.data) ⇒ <code>MoonData</code>
|
|
172
|
+
* [.dataExt(latitude, longitude, [date], [language])](#module_Astronomy/MoonCalc.dataExt) ⇒ <code>Object</code>
|
|
173
|
+
* [.emoji(latitude, longitude, [date])](#module_Astronomy/MoonCalc.emoji) ⇒ <code>string</code>
|
|
174
|
+
* [.times(latitude, longitude, timezoneId, date)](#module_Astronomy/MoonCalc.times) ⇒ <code>Object</code>
|
|
175
|
+
* [.getUpOrDown(altitude, highest)](#module_Astronomy/MoonCalc.getUpOrDown) ⇒ <code>string</code>
|
|
176
|
+
* [.MoonData](#module_Astronomy/MoonCalc.MoonData) : <code>Object</code>
|
|
425
177
|
|
|
426
|
-
**Kind**: static method of [<code>OpenMeteo:current</code>](#OpenMeteo_current)
|
|
427
178
|
|
|
428
|
-
|
|
429
|
-
| --- | --- |
|
|
430
|
-
| lat | <code>number</code> |
|
|
431
|
-
| lon | <code>number</code> |
|
|
432
|
-
| refreshIntervalMin | <code>number</code> |
|
|
433
|
-
|
|
434
|
-
<a name="OpenMeteo_daily"></a>
|
|
179
|
+
* * *
|
|
435
180
|
|
|
436
|
-
|
|
437
|
-
<a name="OpenMeteo_daily.useForecastDaily"></a>
|
|
181
|
+
<a name="module_Astronomy/MoonCalc.phasesES"></a>
|
|
438
182
|
|
|
439
|
-
###
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
**Kind**: static method of [<code>OpenMeteo:daily</code>](#OpenMeteo_daily)
|
|
444
|
-
|
|
445
|
-
| Param | Type |
|
|
446
|
-
| --- | --- |
|
|
447
|
-
| lat | <code>number</code> |
|
|
448
|
-
| lon | <code>number</code> |
|
|
449
|
-
| refreshIntervalMin | <code>number</code> |
|
|
183
|
+
### Astronomy/MoonCalc.phasesES : <code>Object.<string, string></code>
|
|
184
|
+
Mapa de fases lunares.
|
|
185
|
+
{ phaseId, phaseName }
|
|
450
186
|
|
|
451
|
-
<
|
|
187
|
+
**Kind**: static constant of [<code>Astronomy/MoonCalc</code>](#module_Astronomy/MoonCalc)
|
|
452
188
|
|
|
453
|
-
|
|
454
|
-
<a name="OpenMeteo_hourly.useForecastHourly"></a>
|
|
189
|
+
* * *
|
|
455
190
|
|
|
456
|
-
|
|
457
|
-
Custom hook to fetch hourly forecast data for a given location and number of days from OpenMeteo API.
|
|
191
|
+
<a name="module_Astronomy/MoonCalc.data"></a>
|
|
458
192
|
|
|
459
|
-
|
|
193
|
+
### Astronomy/MoonCalc.data(latitude, longitude, [date], [language]) ⇒ <code>MoonData</code>
|
|
194
|
+
**Kind**: static method of [<code>Astronomy/MoonCalc</code>](#module_Astronomy/MoonCalc)
|
|
460
195
|
|
|
461
|
-
| Param | Type |
|
|
196
|
+
| Param | Type | Default |
|
|
462
197
|
| --- | --- | --- |
|
|
463
|
-
|
|
|
464
|
-
|
|
|
465
|
-
|
|
466
|
-
<
|
|
198
|
+
| latitude | <code>number</code> | |
|
|
199
|
+
| longitude | <code>number</code> | |
|
|
200
|
+
| [date] | <code>Date</code> | <code>new Date()</code> |
|
|
201
|
+
| [language] | <code>string</code> | <code>"es-ES"</code> |
|
|
467
202
|
|
|
468
|
-
## OpenMeteo:weatherSymbol
|
|
469
|
-
<a name="OpenMeteo_weatherSymbol.weatherSymbol"></a>
|
|
470
203
|
|
|
471
|
-
|
|
472
|
-
Get weather symbol and description based on the weather code.
|
|
204
|
+
* * *
|
|
473
205
|
|
|
474
|
-
|
|
206
|
+
<a name="module_Astronomy/MoonCalc.dataExt"></a>
|
|
475
207
|
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
| [precipitation] | <code>number</code> |
|
|
480
|
-
| night | <code>boolean</code> |
|
|
481
|
-
| dark | <code>boolean</code> |
|
|
208
|
+
### Astronomy/MoonCalc.dataExt(latitude, longitude, [date], [language]) ⇒ <code>Object</code>
|
|
209
|
+
Información de la luna para una fecha y hora dadas.
|
|
210
|
+
La fecha y hora se devolverán en la zona horaria local.
|
|
482
211
|
|
|
483
|
-
<
|
|
212
|
+
**Kind**: static method of [<code>Astronomy/MoonCalc</code>](#module_Astronomy/MoonCalc)
|
|
484
213
|
|
|
485
|
-
|
|
214
|
+
| Param | Type | Default |
|
|
215
|
+
| --- | --- | --- |
|
|
216
|
+
| latitude | <code>number</code> | |
|
|
217
|
+
| longitude | <code>number</code> | |
|
|
218
|
+
| [date] | <code>Date</code> | <code>new Date()</code> |
|
|
219
|
+
| [language] | <code>string</code> | <code>"es-ES"</code> |
|
|
486
220
|
|
|
487
|
-
* [utils](#module_utils)
|
|
488
|
-
* _static_
|
|
489
|
-
* [.degreesToCompass(degrees, language)](#module_utils.degreesToCompass) ⇒ <code>Object</code>
|
|
490
|
-
* [.getWarningByDays(precipitationSumToday, precipitationSumTomorrow, showersSumToday, showersSumTomorrow)](#module_utils.getWarningByDays) ⇒ <code>Object</code> \| <code>null</code>
|
|
491
|
-
* [.getWarning(precipitation, showers)](#module_utils.getWarning) ⇒ <code>Object</code> \| <code>null</code>
|
|
492
|
-
* [.windArrowTx(deg)](#module_utils.windArrowTx)
|
|
493
|
-
* [.getWindLevel(speed)](#module_utils.getWindLevel) ⇒ <code>WindLevel</code> \| <code>null</code>
|
|
494
|
-
* _inner_
|
|
495
|
-
* [~ALERT_LEVEL](#module_utils..ALERT_LEVEL) : <code>Array.<AlertLevel></code>
|
|
496
|
-
* [~WIND_LEVELS](#module_utils..WIND_LEVELS) : <code>Array.<WindLevel></code>
|
|
497
|
-
* [~getWarningRain(precipitation)](#module_utils..getWarningRain) ⇒ <code>Object</code> \| <code>null</code>
|
|
498
|
-
* [~getWarningShowers(showers)](#module_utils..getWarningShowers) ⇒ <code>Object</code> \| <code>null</code>
|
|
499
|
-
* [~AlertLevel](#module_utils..AlertLevel) : <code>Object</code>
|
|
500
|
-
* [~WindLevel](#module_utils..WindLevel) : <code>Object</code>
|
|
501
221
|
|
|
502
|
-
|
|
222
|
+
* * *
|
|
503
223
|
|
|
504
|
-
|
|
505
|
-
Convert degrees to compass designation
|
|
224
|
+
<a name="module_Astronomy/MoonCalc.emoji"></a>
|
|
506
225
|
|
|
507
|
-
|
|
226
|
+
### Astronomy/MoonCalc.emoji(latitude, longitude, [date]) ⇒ <code>string</code>
|
|
227
|
+
**Kind**: static method of [<code>Astronomy/MoonCalc</code>](#module_Astronomy/MoonCalc)
|
|
228
|
+
**Returns**: <code>string</code> - - Emoji of the moon phase
|
|
508
229
|
|
|
509
|
-
| Param | Type |
|
|
230
|
+
| Param | Type | Default |
|
|
510
231
|
| --- | --- | --- |
|
|
511
|
-
|
|
|
512
|
-
|
|
|
232
|
+
| latitude | <code>number</code> | |
|
|
233
|
+
| longitude | <code>number</code> | |
|
|
234
|
+
| [date] | <code>Date</code> | <code>new Date()</code> |
|
|
513
235
|
|
|
514
|
-
<a name="module_utils.getWarningByDays"></a>
|
|
515
236
|
|
|
516
|
-
|
|
517
|
-
|
|
237
|
+
* * *
|
|
238
|
+
|
|
239
|
+
<a name="module_Astronomy/MoonCalc.times"></a>
|
|
518
240
|
|
|
519
|
-
|
|
241
|
+
### Astronomy/MoonCalc.times(latitude, longitude, timezoneId, date) ⇒ <code>Object</code>
|
|
242
|
+
**Kind**: static method of [<code>Astronomy/MoonCalc</code>](#module_Astronomy/MoonCalc)
|
|
520
243
|
|
|
521
244
|
| Param | Type |
|
|
522
245
|
| --- | --- |
|
|
523
|
-
|
|
|
524
|
-
|
|
|
525
|
-
|
|
|
526
|
-
|
|
|
246
|
+
| latitude | <code>number</code> |
|
|
247
|
+
| longitude | <code>number</code> |
|
|
248
|
+
| timezoneId | <code>string</code> |
|
|
249
|
+
| date | <code>Date</code> |
|
|
527
250
|
|
|
528
|
-
<a name="module_utils.getWarning"></a>
|
|
529
251
|
|
|
530
|
-
|
|
531
|
-
Get warning by precipitation and showers
|
|
252
|
+
* * *
|
|
532
253
|
|
|
533
|
-
|
|
254
|
+
<a name="module_Astronomy/MoonCalc.getUpOrDown"></a>
|
|
255
|
+
|
|
256
|
+
### Astronomy/MoonCalc.getUpOrDown(altitude, highest) ⇒ <code>string</code>
|
|
257
|
+
**Kind**: static method of [<code>Astronomy/MoonCalc</code>](#module_Astronomy/MoonCalc)
|
|
258
|
+
**Returns**: <code>string</code> - - Up or down emoji
|
|
534
259
|
|
|
535
260
|
| Param | Type |
|
|
536
261
|
| --- | --- |
|
|
537
|
-
|
|
|
538
|
-
|
|
|
262
|
+
| altitude | <code>number</code> |
|
|
263
|
+
| highest | <code>Date</code> |
|
|
539
264
|
|
|
540
|
-
<a name="module_utils.windArrowTx"></a>
|
|
541
265
|
|
|
542
|
-
|
|
543
|
-
Convert wind direction in degrees to an arrow representation.
|
|
266
|
+
* * *
|
|
544
267
|
|
|
545
|
-
|
|
268
|
+
<a name="module_Astronomy/MoonCalc.MoonData"></a>
|
|
546
269
|
|
|
547
|
-
|
|
270
|
+
### Astronomy/MoonCalc.MoonData : <code>Object</code>
|
|
271
|
+
**Kind**: static typedef of [<code>Astronomy/MoonCalc</code>](#module_Astronomy/MoonCalc)
|
|
272
|
+
**Properties**
|
|
273
|
+
|
|
274
|
+
| Name | Type | Description |
|
|
548
275
|
| --- | --- | --- |
|
|
549
|
-
|
|
|
276
|
+
| position | <code>AstroPosition</code> | |
|
|
277
|
+
| next | <code>Object</code> | |
|
|
278
|
+
| next.newMoon | <code>string</code> | Date of the next new moon. |
|
|
279
|
+
| next.fullMoon | <code>string</code> | Date of the next full moon. |
|
|
550
280
|
|
|
551
|
-
<a name="module_utils.getWindLevel"></a>
|
|
552
281
|
|
|
553
|
-
|
|
554
|
-
Return the wind level based on the speed.
|
|
282
|
+
* * *
|
|
555
283
|
|
|
556
|
-
|
|
557
|
-
**Returns**: <code>WindLevel</code> \| <code>null</code> - Wind level object or null if speed is null
|
|
284
|
+
<a name="module_Astronomy/SunCalc"></a>
|
|
558
285
|
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
| speed | <code>number</code> | Wind speed in km/h |
|
|
286
|
+
## Astronomy/SunCalc
|
|
287
|
+
SunCalc for calculating solar times, positions, and phases.
|
|
562
288
|
|
|
563
|
-
|
|
289
|
+
import { SunCalc } from ...
|
|
564
290
|
|
|
565
|
-
|
|
566
|
-
|
|
291
|
+
Importante:
|
|
292
|
+
¡Solo proporcionar HORA LOCAL DEL SISTEMA!: 'new Date()'
|
|
293
|
+
Con excepción de 'getSolarTime()': recibe la hora local correspondiente a la localización dada.
|
|
567
294
|
|
|
568
|
-
**Kind**: inner constant of [<code>utils</code>](#module_utils)
|
|
569
|
-
<a name="module_utils..WIND_LEVELS"></a>
|
|
570
295
|
|
|
571
|
-
|
|
572
|
-
|
|
296
|
+
* [Astronomy/SunCalc](#module_Astronomy/SunCalc)
|
|
297
|
+
* [.all(date, latitude, longitude, timezoneId)](#module_Astronomy/SunCalc.all) ⇒ <code>Object</code>
|
|
298
|
+
* [.times(date, latitude, longitude, timezoneId)](#module_Astronomy/SunCalc.times) ⇒ <code>Object</code>
|
|
299
|
+
* [.getSolarTime(date, lng, offsetSign, offset)](#module_Astronomy/SunCalc.getSolarTime) ⇒ <code>string</code>
|
|
300
|
+
* [.position(latitude, longitude)](#module_Astronomy/SunCalc.position) ⇒ <code>Object</code>
|
|
301
|
+
* [.getIsNight(lat, lon, timezoneId, date, dateStr)](#module_Astronomy/SunCalc.getIsNight) ⇒ <code>boolean</code>
|
|
302
|
+
* [.getPhase(altitude, noon)](#module_Astronomy/SunCalc.getPhase) ⇒ <code>string</code>
|
|
303
|
+
|
|
573
304
|
|
|
574
|
-
|
|
575
|
-
<a name="module_utils..getWarningRain"></a>
|
|
305
|
+
* * *
|
|
576
306
|
|
|
577
|
-
|
|
578
|
-
Get warning by rain
|
|
307
|
+
<a name="module_Astronomy/SunCalc.all"></a>
|
|
579
308
|
|
|
580
|
-
|
|
309
|
+
### Astronomy/SunCalc.all(date, latitude, longitude, timezoneId) ⇒ <code>Object</code>
|
|
310
|
+
**Kind**: static method of [<code>Astronomy/SunCalc</code>](#module_Astronomy/SunCalc)
|
|
581
311
|
|
|
582
312
|
| Param | Type |
|
|
583
313
|
| --- | --- |
|
|
584
|
-
|
|
|
314
|
+
| date | <code>Date</code> |
|
|
315
|
+
| latitude | <code>number</code> |
|
|
316
|
+
| longitude | <code>number</code> |
|
|
317
|
+
| timezoneId | <code>string</code> |
|
|
318
|
+
|
|
585
319
|
|
|
586
|
-
|
|
320
|
+
* * *
|
|
587
321
|
|
|
588
|
-
|
|
589
|
-
Get warning by showers
|
|
322
|
+
<a name="module_Astronomy/SunCalc.times"></a>
|
|
590
323
|
|
|
591
|
-
|
|
324
|
+
### Astronomy/SunCalc.times(date, latitude, longitude, timezoneId) ⇒ <code>Object</code>
|
|
325
|
+
**Kind**: static method of [<code>Astronomy/SunCalc</code>](#module_Astronomy/SunCalc)
|
|
592
326
|
|
|
593
327
|
| Param | Type |
|
|
594
328
|
| --- | --- |
|
|
595
|
-
|
|
|
596
|
-
|
|
597
|
-
<
|
|
329
|
+
| date | <code>Date</code> |
|
|
330
|
+
| latitude | <code>number</code> |
|
|
331
|
+
| longitude | <code>number</code> |
|
|
332
|
+
| timezoneId | <code>string</code> |
|
|
598
333
|
|
|
599
|
-
### utils~AlertLevel : <code>Object</code>
|
|
600
|
-
**Kind**: inner typedef of [<code>utils</code>](#module_utils)
|
|
601
|
-
**Properties**
|
|
602
334
|
|
|
603
|
-
|
|
604
|
-
| --- | --- | --- |
|
|
605
|
-
| levelNum | <code>number</code> | The alert level number. |
|
|
606
|
-
| level | <code>string</code> | The alert level string (e.g., "red", "orange", "yellow"). |
|
|
607
|
-
| precipitation | <code>number</code> | The precipitation threshold for the alert level. |
|
|
608
|
-
| showers | <code>number</code> | The showers threshold for the alert level. |
|
|
335
|
+
* * *
|
|
609
336
|
|
|
610
|
-
<a name="
|
|
337
|
+
<a name="module_Astronomy/SunCalc.getSolarTime"></a>
|
|
611
338
|
|
|
612
|
-
###
|
|
613
|
-
**Kind**:
|
|
614
|
-
**
|
|
339
|
+
### Astronomy/SunCalc.getSolarTime(date, lng, offsetSign, offset) ⇒ <code>string</code>
|
|
340
|
+
**Kind**: static method of [<code>Astronomy/SunCalc</code>](#module_Astronomy/SunCalc)
|
|
341
|
+
**Returns**: <code>string</code> - - Local time in "HH:mm" format
|
|
615
342
|
|
|
616
|
-
|
|
|
343
|
+
| Param | Type | Description |
|
|
617
344
|
| --- | --- | --- |
|
|
618
|
-
|
|
|
619
|
-
|
|
|
620
|
-
|
|
|
621
|
-
|
|
|
622
|
-
| txEn | <code>string</code> | Text representing this level |
|
|
623
|
-
|
|
624
|
-
<a name="module_utils"></a>
|
|
345
|
+
| date | <code>Date</code> | |
|
|
346
|
+
| lng | <code>number</code> | |
|
|
347
|
+
| offsetSign | <code>string</code> | "+" or "-" |
|
|
348
|
+
| offset | <code>number</code> | UTC offset in hours |
|
|
625
349
|
|
|
626
|
-
## utils
|
|
627
350
|
|
|
628
|
-
*
|
|
629
|
-
* _static_
|
|
630
|
-
* [.degreesToCompass(degrees, language)](#module_utils.degreesToCompass) ⇒ <code>Object</code>
|
|
631
|
-
* [.getWarningByDays(precipitationSumToday, precipitationSumTomorrow, showersSumToday, showersSumTomorrow)](#module_utils.getWarningByDays) ⇒ <code>Object</code> \| <code>null</code>
|
|
632
|
-
* [.getWarning(precipitation, showers)](#module_utils.getWarning) ⇒ <code>Object</code> \| <code>null</code>
|
|
633
|
-
* [.windArrowTx(deg)](#module_utils.windArrowTx)
|
|
634
|
-
* [.getWindLevel(speed)](#module_utils.getWindLevel) ⇒ <code>WindLevel</code> \| <code>null</code>
|
|
635
|
-
* _inner_
|
|
636
|
-
* [~ALERT_LEVEL](#module_utils..ALERT_LEVEL) : <code>Array.<AlertLevel></code>
|
|
637
|
-
* [~WIND_LEVELS](#module_utils..WIND_LEVELS) : <code>Array.<WindLevel></code>
|
|
638
|
-
* [~getWarningRain(precipitation)](#module_utils..getWarningRain) ⇒ <code>Object</code> \| <code>null</code>
|
|
639
|
-
* [~getWarningShowers(showers)](#module_utils..getWarningShowers) ⇒ <code>Object</code> \| <code>null</code>
|
|
640
|
-
* [~AlertLevel](#module_utils..AlertLevel) : <code>Object</code>
|
|
641
|
-
* [~WindLevel](#module_utils..WindLevel) : <code>Object</code>
|
|
351
|
+
* * *
|
|
642
352
|
|
|
643
|
-
<a name="
|
|
353
|
+
<a name="module_Astronomy/SunCalc.position"></a>
|
|
644
354
|
|
|
645
|
-
###
|
|
646
|
-
|
|
355
|
+
### Astronomy/SunCalc.position(latitude, longitude) ⇒ <code>Object</code>
|
|
356
|
+
**Kind**: static method of [<code>Astronomy/SunCalc</code>](#module_Astronomy/SunCalc)
|
|
647
357
|
|
|
648
|
-
|
|
358
|
+
| Param | Type |
|
|
359
|
+
| --- | --- |
|
|
360
|
+
| latitude | <code>number</code> |
|
|
361
|
+
| longitude | <code>number</code> |
|
|
649
362
|
|
|
650
|
-
| Param | Type | Description |
|
|
651
|
-
| --- | --- | --- |
|
|
652
|
-
| degrees | <code>number</code> | |
|
|
653
|
-
| language | <code>string</code> | Language code ("en-US", "es-ES", "auto") |
|
|
654
363
|
|
|
655
|
-
|
|
364
|
+
* * *
|
|
656
365
|
|
|
657
|
-
|
|
658
|
-
Get warning by today and tomorrow
|
|
366
|
+
<a name="module_Astronomy/SunCalc.getIsNight"></a>
|
|
659
367
|
|
|
660
|
-
|
|
368
|
+
### Astronomy/SunCalc.getIsNight(lat, lon, timezoneId, date, dateStr) ⇒ <code>boolean</code>
|
|
369
|
+
**Kind**: static method of [<code>Astronomy/SunCalc</code>](#module_Astronomy/SunCalc)
|
|
370
|
+
**Returns**: <code>boolean</code> - - true if it's night, false otherwise
|
|
661
371
|
|
|
662
372
|
| Param | Type |
|
|
663
373
|
| --- | --- |
|
|
664
|
-
|
|
|
665
|
-
|
|
|
666
|
-
|
|
|
667
|
-
|
|
|
374
|
+
| lat | <code>number</code> |
|
|
375
|
+
| lon | <code>number</code> |
|
|
376
|
+
| timezoneId | <code>string</code> |
|
|
377
|
+
| date | <code>number</code> \| <code>Date</code> |
|
|
378
|
+
| dateStr | <code>string</code> |
|
|
668
379
|
|
|
669
|
-
<a name="module_utils.getWarning"></a>
|
|
670
380
|
|
|
671
|
-
|
|
672
|
-
|
|
381
|
+
* * *
|
|
382
|
+
|
|
383
|
+
<a name="module_Astronomy/SunCalc.getPhase"></a>
|
|
673
384
|
|
|
674
|
-
|
|
385
|
+
### Astronomy/SunCalc.getPhase(altitude, noon) ⇒ <code>string</code>
|
|
386
|
+
**Kind**: static method of [<code>Astronomy/SunCalc</code>](#module_Astronomy/SunCalc)
|
|
387
|
+
**Returns**: <code>string</code> - - The phase of the sun based on its altitude
|
|
675
388
|
|
|
676
389
|
| Param | Type |
|
|
677
390
|
| --- | --- |
|
|
678
|
-
|
|
|
679
|
-
|
|
|
391
|
+
| altitude | <code>number</code> |
|
|
392
|
+
| noon | <code>string</code> |
|
|
680
393
|
|
|
681
|
-
<a name="module_utils.windArrowTx"></a>
|
|
682
394
|
|
|
683
|
-
|
|
684
|
-
Convert wind direction in degrees to an arrow representation.
|
|
395
|
+
* * *
|
|
685
396
|
|
|
686
|
-
|
|
397
|
+
<a name="module_Geolocation"></a>
|
|
687
398
|
|
|
688
|
-
|
|
689
|
-
| --- | --- | --- |
|
|
690
|
-
| deg | <code>number</code> | Wind direction in degrees. |
|
|
399
|
+
## Geolocation
|
|
691
400
|
|
|
692
|
-
|
|
401
|
+
* * *
|
|
693
402
|
|
|
694
|
-
|
|
695
|
-
Return the wind level based on the speed.
|
|
403
|
+
<a name="module_Geolocation.exports.getGeolocation"></a>
|
|
696
404
|
|
|
697
|
-
|
|
698
|
-
|
|
405
|
+
### Geolocation.exports.getGeolocation() ⇒ <code>Promise.<{latitude: number, longitude: number, formatted\_address: string}></code>
|
|
406
|
+
Get the current geolocation of the device and reverse geocode it to get the address.
|
|
699
407
|
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
| speed | <code>number</code> | Wind speed in km/h |
|
|
408
|
+
**Kind**: static method of [<code>Geolocation</code>](#module_Geolocation)
|
|
409
|
+
**Throws**:
|
|
703
410
|
|
|
704
|
-
<
|
|
411
|
+
- <code>Error</code> If geolocation is not supported or permission is denied.
|
|
705
412
|
|
|
706
|
-
### utils~ALERT\_LEVEL : <code>Array.<AlertLevel></code>
|
|
707
|
-
Alert levels for rain and showers
|
|
708
413
|
|
|
709
|
-
|
|
710
|
-
<a name="module_utils..WIND_LEVELS"></a>
|
|
414
|
+
* * *
|
|
711
415
|
|
|
712
|
-
|
|
713
|
-
Ordered list of wind levels.
|
|
416
|
+
<a name="module_OpenMeteo"></a>
|
|
714
417
|
|
|
715
|
-
|
|
716
|
-
<a name="module_utils..getWarningRain"></a>
|
|
418
|
+
## OpenMeteo
|
|
717
419
|
|
|
718
|
-
|
|
719
|
-
|
|
420
|
+
* [OpenMeteo](#module_OpenMeteo)
|
|
421
|
+
* [.exports.useForecastCurrent(lat, lon, refreshIntervalMin)](#module_OpenMeteo.exports.useForecastCurrent) ⇒ <code>Object</code>
|
|
422
|
+
* [.exports.useForecastDaily(lat, lon, refreshIntervalMin)](#module_OpenMeteo.exports.useForecastDaily) ⇒ <code>Object</code>
|
|
423
|
+
* [.exports.useForecastHourly(location, dayNum)](#module_OpenMeteo.exports.useForecastHourly) ⇒ <code>Object</code>
|
|
424
|
+
* [.exports.weatherSymbol(code, [precipitation], night, dark)](#module_OpenMeteo.exports.weatherSymbol) ⇒ <code>Object</code>
|
|
720
425
|
|
|
721
|
-
**Kind**: inner method of [<code>utils</code>](#module_utils)
|
|
722
426
|
|
|
723
|
-
|
|
724
|
-
| --- | --- |
|
|
725
|
-
| precipitation | <code>number</code> |
|
|
427
|
+
* * *
|
|
726
428
|
|
|
727
|
-
<a name="
|
|
429
|
+
<a name="module_OpenMeteo.exports.useForecastCurrent"></a>
|
|
728
430
|
|
|
729
|
-
###
|
|
730
|
-
|
|
431
|
+
### OpenMeteo.exports.useForecastCurrent(lat, lon, refreshIntervalMin) ⇒ <code>Object</code>
|
|
432
|
+
Custom hook to fetch current weather data from OpenMeteo API.
|
|
731
433
|
|
|
732
|
-
**Kind**:
|
|
434
|
+
**Kind**: static method of [<code>OpenMeteo</code>](#module_OpenMeteo)
|
|
733
435
|
|
|
734
436
|
| Param | Type |
|
|
735
437
|
| --- | --- |
|
|
736
|
-
|
|
|
737
|
-
|
|
738
|
-
<
|
|
438
|
+
| lat | <code>number</code> |
|
|
439
|
+
| lon | <code>number</code> |
|
|
440
|
+
| refreshIntervalMin | <code>number</code> |
|
|
739
441
|
|
|
740
|
-
### utils~AlertLevel : <code>Object</code>
|
|
741
|
-
**Kind**: inner typedef of [<code>utils</code>](#module_utils)
|
|
742
|
-
**Properties**
|
|
743
442
|
|
|
744
|
-
|
|
745
|
-
| --- | --- | --- |
|
|
746
|
-
| levelNum | <code>number</code> | The alert level number. |
|
|
747
|
-
| level | <code>string</code> | The alert level string (e.g., "red", "orange", "yellow"). |
|
|
748
|
-
| precipitation | <code>number</code> | The precipitation threshold for the alert level. |
|
|
749
|
-
| showers | <code>number</code> | The showers threshold for the alert level. |
|
|
443
|
+
* * *
|
|
750
444
|
|
|
751
|
-
<a name="
|
|
445
|
+
<a name="module_OpenMeteo.exports.useForecastDaily"></a>
|
|
752
446
|
|
|
753
|
-
###
|
|
754
|
-
|
|
755
|
-
|
|
447
|
+
### OpenMeteo.exports.useForecastDaily(lat, lon, refreshIntervalMin) ⇒ <code>Object</code>
|
|
448
|
+
Custom hook to fetch daily forecast (10 days) data from OpenMeteo API.
|
|
449
|
+
https://api.open-meteo.com/v1/forecast?timezone=auto&latitude=36.6644363&longitude=-4.5108962&forecast_days=10&daily=weathercode
|
|
756
450
|
|
|
757
|
-
|
|
758
|
-
| --- | --- | --- |
|
|
759
|
-
| id | <code>number</code> | Level ID |
|
|
760
|
-
| speed | <code>number</code> | Minimum wind speed for this level |
|
|
761
|
-
| color | <code>string</code> | Color representing this level |
|
|
762
|
-
| tx | <code>string</code> | Text representing this level |
|
|
763
|
-
| txEn | <code>string</code> | Text representing this level |
|
|
451
|
+
**Kind**: static method of [<code>OpenMeteo</code>](#module_OpenMeteo)
|
|
764
452
|
|
|
765
|
-
|
|
453
|
+
| Param | Type |
|
|
454
|
+
| --- | --- |
|
|
455
|
+
| lat | <code>number</code> |
|
|
456
|
+
| lon | <code>number</code> |
|
|
457
|
+
| refreshIntervalMin | <code>number</code> |
|
|
766
458
|
|
|
767
|
-
## utils
|
|
768
459
|
|
|
769
|
-
*
|
|
770
|
-
* _static_
|
|
771
|
-
* [.degreesToCompass(degrees, language)](#module_utils.degreesToCompass) ⇒ <code>Object</code>
|
|
772
|
-
* [.getWarningByDays(precipitationSumToday, precipitationSumTomorrow, showersSumToday, showersSumTomorrow)](#module_utils.getWarningByDays) ⇒ <code>Object</code> \| <code>null</code>
|
|
773
|
-
* [.getWarning(precipitation, showers)](#module_utils.getWarning) ⇒ <code>Object</code> \| <code>null</code>
|
|
774
|
-
* [.windArrowTx(deg)](#module_utils.windArrowTx)
|
|
775
|
-
* [.getWindLevel(speed)](#module_utils.getWindLevel) ⇒ <code>WindLevel</code> \| <code>null</code>
|
|
776
|
-
* _inner_
|
|
777
|
-
* [~ALERT_LEVEL](#module_utils..ALERT_LEVEL) : <code>Array.<AlertLevel></code>
|
|
778
|
-
* [~WIND_LEVELS](#module_utils..WIND_LEVELS) : <code>Array.<WindLevel></code>
|
|
779
|
-
* [~getWarningRain(precipitation)](#module_utils..getWarningRain) ⇒ <code>Object</code> \| <code>null</code>
|
|
780
|
-
* [~getWarningShowers(showers)](#module_utils..getWarningShowers) ⇒ <code>Object</code> \| <code>null</code>
|
|
781
|
-
* [~AlertLevel](#module_utils..AlertLevel) : <code>Object</code>
|
|
782
|
-
* [~WindLevel](#module_utils..WindLevel) : <code>Object</code>
|
|
460
|
+
* * *
|
|
783
461
|
|
|
784
|
-
<a name="
|
|
462
|
+
<a name="module_OpenMeteo.exports.useForecastHourly"></a>
|
|
785
463
|
|
|
786
|
-
###
|
|
787
|
-
|
|
464
|
+
### OpenMeteo.exports.useForecastHourly(location, dayNum) ⇒ <code>Object</code>
|
|
465
|
+
Custom hook to fetch hourly forecast data for a given location and number of days from OpenMeteo API.
|
|
788
466
|
|
|
789
|
-
**Kind**: static method of [<code>
|
|
467
|
+
**Kind**: static method of [<code>OpenMeteo</code>](#module_OpenMeteo)
|
|
790
468
|
|
|
791
469
|
| Param | Type | Description |
|
|
792
470
|
| --- | --- | --- |
|
|
793
|
-
|
|
|
794
|
-
|
|
|
795
|
-
|
|
796
|
-
<a name="module_utils.getWarningByDays"></a>
|
|
797
|
-
|
|
798
|
-
### utils.getWarningByDays(precipitationSumToday, precipitationSumTomorrow, showersSumToday, showersSumTomorrow) ⇒ <code>Object</code> \| <code>null</code>
|
|
799
|
-
Get warning by today and tomorrow
|
|
471
|
+
| location | <code>Object</code> | |
|
|
472
|
+
| dayNum | <code>number</code> | Number of days from today: -1 = 24 hours, 0 = today, 1 = tomorrow, ... |
|
|
800
473
|
|
|
801
|
-
**Kind**: static method of [<code>utils</code>](#module_utils)
|
|
802
474
|
|
|
803
|
-
|
|
804
|
-
| --- | --- |
|
|
805
|
-
| precipitationSumToday | <code>number</code> |
|
|
806
|
-
| precipitationSumTomorrow | <code>number</code> |
|
|
807
|
-
| showersSumToday | <code>number</code> |
|
|
808
|
-
| showersSumTomorrow | <code>number</code> |
|
|
475
|
+
* * *
|
|
809
476
|
|
|
810
|
-
<a name="
|
|
477
|
+
<a name="module_OpenMeteo.exports.weatherSymbol"></a>
|
|
811
478
|
|
|
812
|
-
###
|
|
813
|
-
Get
|
|
479
|
+
### OpenMeteo.exports.weatherSymbol(code, [precipitation], night, dark) ⇒ <code>Object</code>
|
|
480
|
+
Get weather symbol and description based on the weather code.
|
|
814
481
|
|
|
815
|
-
**Kind**: static method of [<code>
|
|
482
|
+
**Kind**: static method of [<code>OpenMeteo</code>](#module_OpenMeteo)
|
|
816
483
|
|
|
817
484
|
| Param | Type |
|
|
818
485
|
| --- | --- |
|
|
819
|
-
|
|
|
820
|
-
|
|
|
821
|
-
|
|
822
|
-
<
|
|
823
|
-
|
|
824
|
-
### utils.windArrowTx(deg)
|
|
825
|
-
Convert wind direction in degrees to an arrow representation.
|
|
486
|
+
| code | <code>any</code> |
|
|
487
|
+
| [precipitation] | <code>number</code> |
|
|
488
|
+
| night | <code>boolean</code> |
|
|
489
|
+
| dark | <code>boolean</code> |
|
|
826
490
|
|
|
827
|
-
**Kind**: static method of [<code>utils</code>](#module_utils)
|
|
828
491
|
|
|
829
|
-
|
|
830
|
-
| --- | --- | --- |
|
|
831
|
-
| deg | <code>number</code> | Wind direction in degrees. |
|
|
492
|
+
* * *
|
|
832
493
|
|
|
833
|
-
<a name="
|
|
494
|
+
<a name="module_Utils"></a>
|
|
834
495
|
|
|
835
|
-
|
|
836
|
-
Return the wind level based on the speed.
|
|
496
|
+
## Utils
|
|
837
497
|
|
|
838
|
-
|
|
839
|
-
|
|
498
|
+
* [Utils](#module_Utils)
|
|
499
|
+
* [.directions](#module_Utils.directions) : <code>Array.<Compass></code>
|
|
500
|
+
* [.directionsEs](#module_Utils.directionsEs) : <code>Array.<Compass></code>
|
|
501
|
+
* [.ALERT_LEVEL](#module_Utils.ALERT_LEVEL) : <code>Array.<AlertLevel></code>
|
|
502
|
+
* [.WIND_LEVELS](#module_Utils.WIND_LEVELS) : <code>Array.<WindLevel></code>
|
|
503
|
+
* [.exports.degreesToCompass(degrees, language)](#module_Utils.exports.degreesToCompass) ⇒ <code>Object</code>
|
|
504
|
+
* [.exports.getWarningByDays(precipitationSumToday, precipitationSumTomorrow, showersSumToday, showersSumTomorrow)](#module_Utils.exports.getWarningByDays) ⇒ <code>Object</code> \| <code>null</code>
|
|
505
|
+
* [.exports.getWarning(precipitation, showers)](#module_Utils.exports.getWarning) ⇒ <code>Object</code> \| <code>null</code>
|
|
506
|
+
* [.exports.windArrowTx(deg)](#module_Utils.exports.windArrowTx)
|
|
507
|
+
* [.exports.getWindLevel(speed)](#module_Utils.exports.getWindLevel) ⇒ <code>WindLevel</code> \| <code>null</code>
|
|
508
|
+
* [.Compass](#module_Utils.Compass) : <code>Object</code>
|
|
509
|
+
* [.AlertLevel](#module_Utils.AlertLevel) : <code>Object</code>
|
|
510
|
+
* [.WindLevel](#module_Utils.WindLevel) : <code>Object</code>
|
|
840
511
|
|
|
841
|
-
| Param | Type | Description |
|
|
842
|
-
| --- | --- | --- |
|
|
843
|
-
| speed | <code>number</code> | Wind speed in km/h |
|
|
844
512
|
|
|
845
|
-
|
|
513
|
+
* * *
|
|
846
514
|
|
|
847
|
-
|
|
848
|
-
Alert levels for rain and showers
|
|
515
|
+
<a name="module_Utils.directions"></a>
|
|
849
516
|
|
|
850
|
-
|
|
851
|
-
|
|
517
|
+
### Utils.directions : <code>Array.<Compass></code>
|
|
518
|
+
English compass designations
|
|
852
519
|
|
|
853
|
-
|
|
854
|
-
|
|
520
|
+
**Kind**: static constant of [<code>Utils</code>](#module_Utils)
|
|
521
|
+
**Properties**
|
|
855
522
|
|
|
856
|
-
|
|
857
|
-
|
|
523
|
+
| Name | Type | Description |
|
|
524
|
+
| --- | --- | --- |
|
|
525
|
+
| short | <code>string</code> | Short compass designation |
|
|
526
|
+
| full | <code>string</code> | Full compass designation |
|
|
858
527
|
|
|
859
|
-
### utils~getWarningRain(precipitation) ⇒ <code>Object</code> \| <code>null</code>
|
|
860
|
-
Get warning by rain
|
|
861
528
|
|
|
862
|
-
|
|
529
|
+
* * *
|
|
863
530
|
|
|
864
|
-
|
|
865
|
-
| --- | --- |
|
|
866
|
-
| precipitation | <code>number</code> |
|
|
531
|
+
<a name="module_Utils.directionsEs"></a>
|
|
867
532
|
|
|
868
|
-
<
|
|
533
|
+
### Utils.directionsEs : <code>Array.<Compass></code>
|
|
534
|
+
Spanish compass designations
|
|
869
535
|
|
|
870
|
-
|
|
871
|
-
|
|
536
|
+
**Kind**: static constant of [<code>Utils</code>](#module_Utils)
|
|
537
|
+
**Properties**
|
|
872
538
|
|
|
873
|
-
|
|
539
|
+
| Name | Type | Description |
|
|
540
|
+
| --- | --- | --- |
|
|
541
|
+
| short | <code>string</code> | Short compass designation |
|
|
542
|
+
| full | <code>string</code> | Full compass designation |
|
|
874
543
|
|
|
875
|
-
| Param | Type |
|
|
876
|
-
| --- | --- |
|
|
877
|
-
| showers | <code>number</code> |
|
|
878
544
|
|
|
879
|
-
|
|
545
|
+
* * *
|
|
880
546
|
|
|
881
|
-
|
|
882
|
-
**Kind**: inner typedef of [<code>utils</code>](#module_utils)
|
|
883
|
-
**Properties**
|
|
547
|
+
<a name="module_Utils.ALERT_LEVEL"></a>
|
|
884
548
|
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
| levelNum | <code>number</code> | The alert level number. |
|
|
888
|
-
| level | <code>string</code> | The alert level string (e.g., "red", "orange", "yellow"). |
|
|
889
|
-
| precipitation | <code>number</code> | The precipitation threshold for the alert level. |
|
|
890
|
-
| showers | <code>number</code> | The showers threshold for the alert level. |
|
|
549
|
+
### Utils.ALERT\_LEVEL : <code>Array.<AlertLevel></code>
|
|
550
|
+
Alert levels for rain and showers
|
|
891
551
|
|
|
892
|
-
<
|
|
552
|
+
**Kind**: static constant of [<code>Utils</code>](#module_Utils)
|
|
893
553
|
|
|
894
|
-
|
|
895
|
-
**Kind**: inner typedef of [<code>utils</code>](#module_utils)
|
|
896
|
-
**Properties**
|
|
554
|
+
* * *
|
|
897
555
|
|
|
898
|
-
|
|
899
|
-
| --- | --- | --- |
|
|
900
|
-
| id | <code>number</code> | Level ID |
|
|
901
|
-
| speed | <code>number</code> | Minimum wind speed for this level |
|
|
902
|
-
| color | <code>string</code> | Color representing this level |
|
|
903
|
-
| tx | <code>string</code> | Text representing this level |
|
|
904
|
-
| txEn | <code>string</code> | Text representing this level |
|
|
556
|
+
<a name="module_Utils.WIND_LEVELS"></a>
|
|
905
557
|
|
|
906
|
-
<
|
|
558
|
+
### Utils.WIND\_LEVELS : <code>Array.<WindLevel></code>
|
|
559
|
+
Ordered list of wind levels.
|
|
907
560
|
|
|
908
|
-
|
|
561
|
+
**Kind**: static constant of [<code>Utils</code>](#module_Utils)
|
|
909
562
|
|
|
910
|
-
*
|
|
911
|
-
* _static_
|
|
912
|
-
* [.degreesToCompass(degrees, language)](#module_utils.degreesToCompass) ⇒ <code>Object</code>
|
|
913
|
-
* [.getWarningByDays(precipitationSumToday, precipitationSumTomorrow, showersSumToday, showersSumTomorrow)](#module_utils.getWarningByDays) ⇒ <code>Object</code> \| <code>null</code>
|
|
914
|
-
* [.getWarning(precipitation, showers)](#module_utils.getWarning) ⇒ <code>Object</code> \| <code>null</code>
|
|
915
|
-
* [.windArrowTx(deg)](#module_utils.windArrowTx)
|
|
916
|
-
* [.getWindLevel(speed)](#module_utils.getWindLevel) ⇒ <code>WindLevel</code> \| <code>null</code>
|
|
917
|
-
* _inner_
|
|
918
|
-
* [~ALERT_LEVEL](#module_utils..ALERT_LEVEL) : <code>Array.<AlertLevel></code>
|
|
919
|
-
* [~WIND_LEVELS](#module_utils..WIND_LEVELS) : <code>Array.<WindLevel></code>
|
|
920
|
-
* [~getWarningRain(precipitation)](#module_utils..getWarningRain) ⇒ <code>Object</code> \| <code>null</code>
|
|
921
|
-
* [~getWarningShowers(showers)](#module_utils..getWarningShowers) ⇒ <code>Object</code> \| <code>null</code>
|
|
922
|
-
* [~AlertLevel](#module_utils..AlertLevel) : <code>Object</code>
|
|
923
|
-
* [~WindLevel](#module_utils..WindLevel) : <code>Object</code>
|
|
563
|
+
* * *
|
|
924
564
|
|
|
925
|
-
<a name="
|
|
565
|
+
<a name="module_Utils.exports.degreesToCompass"></a>
|
|
926
566
|
|
|
927
|
-
###
|
|
567
|
+
### Utils.exports.degreesToCompass(degrees, language) ⇒ <code>Object</code>
|
|
928
568
|
Convert degrees to compass designation
|
|
929
569
|
|
|
930
|
-
**Kind**: static method of [<code>
|
|
570
|
+
**Kind**: static method of [<code>Utils</code>](#module_Utils)
|
|
931
571
|
|
|
932
572
|
| Param | Type | Description |
|
|
933
573
|
| --- | --- | --- |
|
|
934
574
|
| degrees | <code>number</code> | |
|
|
935
575
|
| language | <code>string</code> | Language code ("en-US", "es-ES", "auto") |
|
|
936
576
|
|
|
937
|
-
<a name="module_utils.getWarningByDays"></a>
|
|
938
577
|
|
|
939
|
-
|
|
578
|
+
* * *
|
|
579
|
+
|
|
580
|
+
<a name="module_Utils.exports.getWarningByDays"></a>
|
|
581
|
+
|
|
582
|
+
### Utils.exports.getWarningByDays(precipitationSumToday, precipitationSumTomorrow, showersSumToday, showersSumTomorrow) ⇒ <code>Object</code> \| <code>null</code>
|
|
940
583
|
Get warning by today and tomorrow
|
|
941
584
|
|
|
942
|
-
**Kind**: static method of [<code>
|
|
585
|
+
**Kind**: static method of [<code>Utils</code>](#module_Utils)
|
|
943
586
|
|
|
944
587
|
| Param | Type |
|
|
945
588
|
| --- | --- |
|
|
@@ -948,79 +591,71 @@ Get warning by today and tomorrow
|
|
|
948
591
|
| showersSumToday | <code>number</code> |
|
|
949
592
|
| showersSumTomorrow | <code>number</code> |
|
|
950
593
|
|
|
951
|
-
<a name="module_utils.getWarning"></a>
|
|
952
594
|
|
|
953
|
-
|
|
595
|
+
* * *
|
|
596
|
+
|
|
597
|
+
<a name="module_Utils.exports.getWarning"></a>
|
|
598
|
+
|
|
599
|
+
### Utils.exports.getWarning(precipitation, showers) ⇒ <code>Object</code> \| <code>null</code>
|
|
954
600
|
Get warning by precipitation and showers
|
|
955
601
|
|
|
956
|
-
**Kind**: static method of [<code>
|
|
602
|
+
**Kind**: static method of [<code>Utils</code>](#module_Utils)
|
|
957
603
|
|
|
958
604
|
| Param | Type |
|
|
959
605
|
| --- | --- |
|
|
960
606
|
| precipitation | <code>number</code> |
|
|
961
607
|
| showers | <code>number</code> |
|
|
962
608
|
|
|
963
|
-
<a name="module_utils.windArrowTx"></a>
|
|
964
609
|
|
|
965
|
-
|
|
610
|
+
* * *
|
|
611
|
+
|
|
612
|
+
<a name="module_Utils.exports.windArrowTx"></a>
|
|
613
|
+
|
|
614
|
+
### Utils.exports.windArrowTx(deg)
|
|
966
615
|
Convert wind direction in degrees to an arrow representation.
|
|
967
616
|
|
|
968
|
-
**Kind**: static method of [<code>
|
|
617
|
+
**Kind**: static method of [<code>Utils</code>](#module_Utils)
|
|
969
618
|
|
|
970
619
|
| Param | Type | Description |
|
|
971
620
|
| --- | --- | --- |
|
|
972
621
|
| deg | <code>number</code> | Wind direction in degrees. |
|
|
973
622
|
|
|
974
|
-
<a name="module_utils.getWindLevel"></a>
|
|
975
623
|
|
|
976
|
-
|
|
624
|
+
* * *
|
|
625
|
+
|
|
626
|
+
<a name="module_Utils.exports.getWindLevel"></a>
|
|
627
|
+
|
|
628
|
+
### Utils.exports.getWindLevel(speed) ⇒ <code>WindLevel</code> \| <code>null</code>
|
|
977
629
|
Return the wind level based on the speed.
|
|
978
630
|
|
|
979
|
-
**Kind**: static method of [<code>
|
|
631
|
+
**Kind**: static method of [<code>Utils</code>](#module_Utils)
|
|
980
632
|
**Returns**: <code>WindLevel</code> \| <code>null</code> - Wind level object or null if speed is null
|
|
981
633
|
|
|
982
634
|
| Param | Type | Description |
|
|
983
635
|
| --- | --- | --- |
|
|
984
636
|
| speed | <code>number</code> | Wind speed in km/h |
|
|
985
637
|
|
|
986
|
-
<a name="module_utils..ALERT_LEVEL"></a>
|
|
987
|
-
|
|
988
|
-
### utils~ALERT\_LEVEL : <code>Array.<AlertLevel></code>
|
|
989
|
-
Alert levels for rain and showers
|
|
990
|
-
|
|
991
|
-
**Kind**: inner constant of [<code>utils</code>](#module_utils)
|
|
992
|
-
<a name="module_utils..WIND_LEVELS"></a>
|
|
993
|
-
|
|
994
|
-
### utils~WIND\_LEVELS : <code>Array.<WindLevel></code>
|
|
995
|
-
Ordered list of wind levels.
|
|
996
|
-
|
|
997
|
-
**Kind**: inner constant of [<code>utils</code>](#module_utils)
|
|
998
|
-
<a name="module_utils..getWarningRain"></a>
|
|
999
638
|
|
|
1000
|
-
|
|
1001
|
-
Get warning by rain
|
|
639
|
+
* * *
|
|
1002
640
|
|
|
1003
|
-
|
|
641
|
+
<a name="module_Utils.Compass"></a>
|
|
1004
642
|
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
<a name="module_utils..getWarningShowers"></a>
|
|
643
|
+
### Utils.Compass : <code>Object</code>
|
|
644
|
+
**Kind**: static typedef of [<code>Utils</code>](#module_Utils)
|
|
645
|
+
**Properties**
|
|
1010
646
|
|
|
1011
|
-
|
|
1012
|
-
|
|
647
|
+
| Name | Type | Description |
|
|
648
|
+
| --- | --- | --- |
|
|
649
|
+
| short | <code>string</code> | Short compass designation |
|
|
650
|
+
| full | <code>string</code> | Full compass designation |
|
|
1013
651
|
|
|
1014
|
-
**Kind**: inner method of [<code>utils</code>](#module_utils)
|
|
1015
652
|
|
|
1016
|
-
|
|
1017
|
-
| --- | --- |
|
|
1018
|
-
| showers | <code>number</code> |
|
|
653
|
+
* * *
|
|
1019
654
|
|
|
1020
|
-
<a name="
|
|
655
|
+
<a name="module_Utils.AlertLevel"></a>
|
|
1021
656
|
|
|
1022
|
-
###
|
|
1023
|
-
**Kind**:
|
|
657
|
+
### Utils.AlertLevel : <code>Object</code>
|
|
658
|
+
**Kind**: static typedef of [<code>Utils</code>](#module_Utils)
|
|
1024
659
|
**Properties**
|
|
1025
660
|
|
|
1026
661
|
| Name | Type | Description |
|
|
@@ -1030,10 +665,13 @@ Get warning by showers
|
|
|
1030
665
|
| precipitation | <code>number</code> | The precipitation threshold for the alert level. |
|
|
1031
666
|
| showers | <code>number</code> | The showers threshold for the alert level. |
|
|
1032
667
|
|
|
1033
|
-
<a name="module_utils..WindLevel"></a>
|
|
1034
668
|
|
|
1035
|
-
|
|
1036
|
-
|
|
669
|
+
* * *
|
|
670
|
+
|
|
671
|
+
<a name="module_Utils.WindLevel"></a>
|
|
672
|
+
|
|
673
|
+
### Utils.WindLevel : <code>Object</code>
|
|
674
|
+
**Kind**: static typedef of [<code>Utils</code>](#module_Utils)
|
|
1037
675
|
**Properties**
|
|
1038
676
|
|
|
1039
677
|
| Name | Type | Description |
|
|
@@ -1044,3 +682,6 @@ Get warning by showers
|
|
|
1044
682
|
| tx | <code>string</code> | Text representing this level |
|
|
1045
683
|
| txEn | <code>string</code> | Text representing this level |
|
|
1046
684
|
|
|
685
|
+
|
|
686
|
+
* * *
|
|
687
|
+
|