@angelrove/forecast-utils 1.1.10 → 1.1.12
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 +3 -3
- package/dist/types/OpenMeteo/current/useForecastCurrent.d.ts +1 -1
- package/dist/types/OpenMeteo/daily/useForecastDaily.d.ts +2 -1
- package/dist/types/OpenMeteo/hourly/useForecastHourly.d.ts +1 -1
- package/package.json +4 -3
- package/src/OpenMeteo/current/useForecastCurrent.js +1 -1
- package/src/OpenMeteo/daily/useForecastDaily.js +2 -1
- package/src/OpenMeteo/hourly/useForecastHourly.js +1 -1
- package/dist/types/astronomy/types.d.ts +0 -36
package/README.md
CHANGED
|
@@ -379,7 +379,7 @@ Get local time from a given location (lat, lng) using 'GoogleMaps TimeZone' API.
|
|
|
379
379
|
Custom hook to fetch current weather data from OpenMeteo API.
|
|
380
380
|
|
|
381
381
|
**Kind**: static method of [<code>OpenMeteo</code>](#module_OpenMeteo)
|
|
382
|
-
**Returns**: <code>ForecastData</code> -
|
|
382
|
+
**Returns**: <code>ForecastData</code> - {data, isLoading, isError, apiUrl}
|
|
383
383
|
|
|
384
384
|
| Param | Type |
|
|
385
385
|
| --- | --- |
|
|
@@ -397,7 +397,7 @@ Custom hook to fetch daily forecast (10 days) data from OpenMeteo API.
|
|
|
397
397
|
https://api.open-meteo.com/v1/forecast?timezone=auto&latitude=36.6644363&longitude=-4.5108962&forecast_days=10&daily=weathercode
|
|
398
398
|
|
|
399
399
|
**Kind**: static method of [<code>OpenMeteo</code>](#module_OpenMeteo)
|
|
400
|
-
**Returns**: <code>ForecastData</code> -
|
|
400
|
+
**Returns**: <code>ForecastData</code> - {data, isLoading, isError, apiUrl}
|
|
401
401
|
|
|
402
402
|
| Param | Type |
|
|
403
403
|
| --- | --- |
|
|
@@ -414,7 +414,7 @@ https://api.open-meteo.com/v1/forecast?timezone=auto&latitude=36.6644363&longitu
|
|
|
414
414
|
Custom hook to fetch hourly forecast data for a given location and number of days from OpenMeteo API.
|
|
415
415
|
|
|
416
416
|
**Kind**: static method of [<code>OpenMeteo</code>](#module_OpenMeteo)
|
|
417
|
-
**Returns**: <code>ForecastData</code> -
|
|
417
|
+
**Returns**: <code>ForecastData</code> - {data, isLoading, isError, apiUrl}
|
|
418
418
|
|
|
419
419
|
| Param | Type | Description |
|
|
420
420
|
| --- | --- | --- |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @param {number} lat
|
|
5
5
|
* @param {number} lon
|
|
6
6
|
* @param {number} refreshIntervalMin
|
|
7
|
-
* @returns {ForecastData}
|
|
7
|
+
* @returns {ForecastData} {data, isLoading, isError, apiUrl}
|
|
8
8
|
* @memberof module:OpenMeteo
|
|
9
9
|
*/
|
|
10
10
|
export function useForecastCurrent(lat: number, lon: number, refreshIntervalMin?: number): ForecastData;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Custom hook to fetch daily forecast (10 days) data from OpenMeteo API.
|
|
3
|
+
*
|
|
3
4
|
* https://api.open-meteo.com/v1/forecast?timezone=auto&latitude=36.6644363&longitude=-4.5108962&forecast_days=10&daily=weathercode
|
|
4
5
|
*
|
|
5
6
|
* @param {number} lat
|
|
6
7
|
* @param {number} lon
|
|
7
8
|
* @param {number} refreshIntervalMin
|
|
8
|
-
* @returns {ForecastData}
|
|
9
|
+
* @returns {ForecastData} {data, isLoading, isError, apiUrl}
|
|
9
10
|
* @memberof module:OpenMeteo
|
|
10
11
|
*/
|
|
11
12
|
export function useForecastDaily(lat: number, lon: number, refreshIntervalMin?: number): ForecastData;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @param {{ latitude: number, longitude: number }} location
|
|
5
5
|
* @param {number} dayNum Number of days from today: -1 = 24 hours, 0 = today, 1 = tomorrow, ...
|
|
6
|
-
* @returns {ForecastData}
|
|
6
|
+
* @returns {ForecastData} {data, isLoading, isError, apiUrl}
|
|
7
7
|
* @memberof module:OpenMeteo
|
|
8
8
|
*/
|
|
9
9
|
export function useForecastHourly(location: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "Jose Angel Romero Vegas",
|
|
3
3
|
"name": "@angelrove/forecast-utils",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.12",
|
|
5
5
|
"description": "Utilities for obtaining weather and astronomy forecast data.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"publishConfig": {
|
|
@@ -39,9 +39,10 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@biomejs/biome": "1.9.4",
|
|
42
|
-
"jsdoc-to-markdown": "^9.1.1",
|
|
43
42
|
"@types/react": "^19.1.5",
|
|
44
|
-
"@types/react-dom": "^19.1.5"
|
|
43
|
+
"@types/react-dom": "^19.1.5",
|
|
44
|
+
"jsdoc-to-markdown": "^9.1.1",
|
|
45
|
+
"typescript": "^5.8.3"
|
|
45
46
|
},
|
|
46
47
|
"dependencies": {}
|
|
47
48
|
}
|
|
@@ -10,7 +10,7 @@ import transformer from "./transformer.js";
|
|
|
10
10
|
* @param {number} lat
|
|
11
11
|
* @param {number} lon
|
|
12
12
|
* @param {number} refreshIntervalMin
|
|
13
|
-
* @returns {ForecastData}
|
|
13
|
+
* @returns {ForecastData} {data, isLoading, isError, apiUrl}
|
|
14
14
|
* @memberof module:OpenMeteo
|
|
15
15
|
*/
|
|
16
16
|
export function useForecastCurrent(lat, lon, refreshIntervalMin = 0) {
|
|
@@ -6,12 +6,13 @@ import transformer from "./transformer.js";
|
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Custom hook to fetch daily forecast (10 days) data from OpenMeteo API.
|
|
9
|
+
*
|
|
9
10
|
* https://api.open-meteo.com/v1/forecast?timezone=auto&latitude=36.6644363&longitude=-4.5108962&forecast_days=10&daily=weathercode
|
|
10
11
|
*
|
|
11
12
|
* @param {number} lat
|
|
12
13
|
* @param {number} lon
|
|
13
14
|
* @param {number} refreshIntervalMin
|
|
14
|
-
* @returns {ForecastData}
|
|
15
|
+
* @returns {ForecastData} {data, isLoading, isError, apiUrl}
|
|
15
16
|
* @memberof module:OpenMeteo
|
|
16
17
|
*/
|
|
17
18
|
export function useForecastDaily(lat, lon, refreshIntervalMin = 0) {
|
|
@@ -9,7 +9,7 @@ import { fetchParams } from "./fetchParams.js";
|
|
|
9
9
|
*
|
|
10
10
|
* @param {{ latitude: number, longitude: number }} location
|
|
11
11
|
* @param {number} dayNum Number of days from today: -1 = 24 hours, 0 = today, 1 = tomorrow, ...
|
|
12
|
-
* @returns {ForecastData}
|
|
12
|
+
* @returns {ForecastData} {data, isLoading, isError, apiUrl}
|
|
13
13
|
* @memberof module:OpenMeteo
|
|
14
14
|
*/
|
|
15
15
|
export function useForecastHourly(location, dayNum) {
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export type AstroPosition = {
|
|
2
|
-
altitude: number;
|
|
3
|
-
azimuth: number;
|
|
4
|
-
direction: string;
|
|
5
|
-
direction_full: string;
|
|
6
|
-
};
|
|
7
|
-
export type LocalTimeData = {
|
|
8
|
-
/**
|
|
9
|
-
* - The local time.
|
|
10
|
-
*/
|
|
11
|
-
time: Date;
|
|
12
|
-
/**
|
|
13
|
-
* - The formatted local time string.
|
|
14
|
-
*/
|
|
15
|
-
timeStr: string;
|
|
16
|
-
/**
|
|
17
|
-
* - The timezone name.
|
|
18
|
-
*/
|
|
19
|
-
timezone: string;
|
|
20
|
-
/**
|
|
21
|
-
* - The timezone ID.
|
|
22
|
-
*/
|
|
23
|
-
timezoneId: string;
|
|
24
|
-
/**
|
|
25
|
-
* - The UTC offset in hours.
|
|
26
|
-
*/
|
|
27
|
-
offset: number;
|
|
28
|
-
/**
|
|
29
|
-
* - The sign of the offset ('+' or '-').
|
|
30
|
-
*/
|
|
31
|
-
offsetSign: string;
|
|
32
|
-
/**
|
|
33
|
-
* - The DST offset in hours.
|
|
34
|
-
*/
|
|
35
|
-
dstOffset: number;
|
|
36
|
-
};
|