@i-giann/open-meteo-wrapper 1.0.0
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/LICENSE +21 -0
- package/README.md +148 -0
- package/dist/hooks/useWeather.d.ts +22 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.esm.js +673 -0
- package/dist/services/adapters/OpenMeteoAdapter.d.ts +10 -0
- package/dist/services/api/OpenMeteoClient.d.ts +9 -0
- package/dist/services/index.d.ts +3 -0
- package/dist/services/weatherService.d.ts +24 -0
- package/dist/store/useWeatherStore.d.ts +66 -0
- package/dist/types/apiTypes.d.ts +23 -0
- package/dist/types/weatherTypes.d.ts +162 -0
- package/dist/utils/constants.d.ts +87 -0
- package/dist/utils/utils.d.ts +13 -0
- package/package.json +91 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Servicio principal para obtener y estructurar datos meteorológicos desde la API de Open-Meteo.
|
|
3
|
+
* Incluye manejo de errores y transformación de datos crudos mediante WeatherDataParser.
|
|
4
|
+
*/
|
|
5
|
+
import { FetchWeatherProps, StructureWeatherData, FetchError } from "../types/weatherTypes";
|
|
6
|
+
import { IWeatherApiClient } from "./api/OpenMeteoClient";
|
|
7
|
+
import { IWeatherAdapter } from "./adapters/OpenMeteoAdapter";
|
|
8
|
+
/**
|
|
9
|
+
* Realiza una solicitud a la API de Open-Meteo para obtener datos meteorológicos.
|
|
10
|
+
* Devuelve los datos organizados mediante WeatherDataParser o un error estructurado.
|
|
11
|
+
*
|
|
12
|
+
* Flujo principal:
|
|
13
|
+
* 1. Construye la URL y realiza la solicitud a la API.
|
|
14
|
+
* 2. Si la respuesta es exitosa, transforma los datos crudos con WeatherDataParser.
|
|
15
|
+
* 3. Si hay error, retorna un objeto FetchError estandarizado.
|
|
16
|
+
* 4. Maneja timeout y errores inesperados.
|
|
17
|
+
*
|
|
18
|
+
* @param {FetchWeatherProps} params Parámetros de la consulta meteorológica
|
|
19
|
+
* @returns {Promise<StructureWeatherData | FetchError>} Datos meteorológicos organizados o error
|
|
20
|
+
*/
|
|
21
|
+
export declare const fetchWeather: (params: FetchWeatherProps, options?: {
|
|
22
|
+
client?: IWeatherApiClient;
|
|
23
|
+
adapter?: IWeatherAdapter;
|
|
24
|
+
}) => Promise<StructureWeatherData | FetchError>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { DailyWeatherData, FetchWeatherProps, HourlyWeatherData, StructureWeatherData, FetchError } from "../types/weatherTypes";
|
|
2
|
+
export type WeatherFetcher = (params: FetchWeatherProps) => Promise<StructureWeatherData | FetchError>;
|
|
3
|
+
export declare const setWeatherFetcher: (fetcher: WeatherFetcher) => void;
|
|
4
|
+
/**
|
|
5
|
+
* Estado principal del store meteorológico.
|
|
6
|
+
*/
|
|
7
|
+
interface WeatherState {
|
|
8
|
+
/** Últimos datos meteorológicos obtenidos y organizados */
|
|
9
|
+
data: StructureWeatherData | null;
|
|
10
|
+
/** Indica si se está realizando una solicitud */
|
|
11
|
+
loading: boolean;
|
|
12
|
+
/** Último error producido en la consulta */
|
|
13
|
+
error: FetchError | null;
|
|
14
|
+
/** Si la actualización automática está activa */
|
|
15
|
+
autoRefresh: boolean;
|
|
16
|
+
/** Últimos parámetros usados para la consulta */
|
|
17
|
+
fetchParams: FetchWeatherProps | null;
|
|
18
|
+
/** Timestamp de la última consulta exitosa */
|
|
19
|
+
lastFetchTime: number | null;
|
|
20
|
+
/** Duración del caché en milisegundos */
|
|
21
|
+
cacheDuration: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Acciones y selectores del store meteorológico.
|
|
25
|
+
*
|
|
26
|
+
* `fetchWeather`: Realiza la consulta meteorológica y actualiza el estado.
|
|
27
|
+
* `isLoading`, `hasError`, `getError`, `clearError`: Métodos para manejar el estado de carga y errores.
|
|
28
|
+
* `setAutoRefresh`, `scheduleAutoRefresh`: Métodos para manejar la actualización automática de datos.
|
|
29
|
+
* `getAllWeatherData`, `getCurrentDayWeather`, `getPastDayWeather`, `getForecastWeather`, `getCurrentHourWeather`: Selectores para acceder a los datos meteorológicos organizados.
|
|
30
|
+
*/
|
|
31
|
+
interface WeatherActions {
|
|
32
|
+
fetchWeather: (params: FetchWeatherProps) => Promise<void>;
|
|
33
|
+
isLoading: () => boolean;
|
|
34
|
+
hasError: () => boolean;
|
|
35
|
+
getError: () => FetchError | null;
|
|
36
|
+
clearError: () => void;
|
|
37
|
+
setAutoRefresh: (value: boolean) => void;
|
|
38
|
+
scheduleAutoRefresh: () => void;
|
|
39
|
+
getAllWeatherData: () => StructureWeatherData | null;
|
|
40
|
+
getCurrentDayWeather: () => DailyWeatherData | null;
|
|
41
|
+
getPastDayWeather: () => DailyWeatherData[] | null;
|
|
42
|
+
getForecastWeather: () => DailyWeatherData[] | null;
|
|
43
|
+
getCurrentHourWeather: () => HourlyWeatherData | null;
|
|
44
|
+
}
|
|
45
|
+
export declare const useWeatherStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<WeatherState & WeatherActions>, "persist"> & {
|
|
46
|
+
persist: {
|
|
47
|
+
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<WeatherState & WeatherActions, {
|
|
48
|
+
data: StructureWeatherData | null;
|
|
49
|
+
fetchParams: FetchWeatherProps | null;
|
|
50
|
+
lastFetchTime: number | null;
|
|
51
|
+
autoRefresh: boolean;
|
|
52
|
+
}>>) => void;
|
|
53
|
+
clearStorage: () => void;
|
|
54
|
+
rehydrate: () => Promise<void> | void;
|
|
55
|
+
hasHydrated: () => boolean;
|
|
56
|
+
onHydrate: (fn: (state: WeatherState & WeatherActions) => void) => () => void;
|
|
57
|
+
onFinishHydration: (fn: (state: WeatherState & WeatherActions) => void) => () => void;
|
|
58
|
+
getOptions: () => Partial<import("zustand/middleware").PersistOptions<WeatherState & WeatherActions, {
|
|
59
|
+
data: StructureWeatherData | null;
|
|
60
|
+
fetchParams: FetchWeatherProps | null;
|
|
61
|
+
lastFetchTime: number | null;
|
|
62
|
+
autoRefresh: boolean;
|
|
63
|
+
}>>;
|
|
64
|
+
};
|
|
65
|
+
}>;
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HourlyParams } from "./weatherTypes";
|
|
2
|
+
export interface WeatherData {
|
|
3
|
+
latitude: number;
|
|
4
|
+
longitude: number;
|
|
5
|
+
timezone: string;
|
|
6
|
+
timezone_abbreviation?: string;
|
|
7
|
+
current?: {
|
|
8
|
+
time: Date;
|
|
9
|
+
};
|
|
10
|
+
hourly: {
|
|
11
|
+
time: (string | Date)[];
|
|
12
|
+
temperature_2m: number[];
|
|
13
|
+
weather_code: number[];
|
|
14
|
+
} & Partial<Record<Exclude<HourlyParams, HourlyParams.Temperature | HourlyParams.WeatherCode>, number[]>>;
|
|
15
|
+
daily: {
|
|
16
|
+
time: (string | Date)[];
|
|
17
|
+
temperature_2m_max: number[];
|
|
18
|
+
temperature_2m_min: number[];
|
|
19
|
+
sunrise?: (string | Date)[];
|
|
20
|
+
sunset?: (string | Date)[];
|
|
21
|
+
daylight_duration?: number[];
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
export declare enum MessageType {
|
|
2
|
+
SUCCESS = "success",
|
|
3
|
+
ERROR = "error",
|
|
4
|
+
WARNING = "warning",
|
|
5
|
+
INFO = "info"
|
|
6
|
+
}
|
|
7
|
+
export declare enum ErrorType {
|
|
8
|
+
NETWORK_ERROR = "network_error",
|
|
9
|
+
API_ERROR = "api_error",
|
|
10
|
+
DATA_ERROR = "data_error",
|
|
11
|
+
UNKNOWN_ERROR = "unknown_error"
|
|
12
|
+
}
|
|
13
|
+
export interface FetchError {
|
|
14
|
+
error: string;
|
|
15
|
+
status?: number;
|
|
16
|
+
type: MessageType;
|
|
17
|
+
errorType: ErrorType;
|
|
18
|
+
info?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare enum HourlyParams {
|
|
21
|
+
Temperature = "temperature_2m",// En grados Celsius ºC
|
|
22
|
+
RelativeHumidity = "relative_humidity_2m",// En porcentaje %
|
|
23
|
+
DewPoint = "dew_point_2m",// En grados Celsius ºC (Punto rocio)
|
|
24
|
+
ApparentTemperature = "apparent_temperature",// En grados Celsius ºC (Sensación térmica)
|
|
25
|
+
PrecipitationProbability = "precipitation_probability",// En porcentaje %
|
|
26
|
+
Precipitation = "precipitation",// En milímetros mm
|
|
27
|
+
Rain = "rain",// En milímetros mm
|
|
28
|
+
Snowfall = "snowfall",// En milímetros cm
|
|
29
|
+
SnowDepth = "snow_depth",// En metros m
|
|
30
|
+
WeatherCode = "weather_code",// En código WMO
|
|
31
|
+
PressureMsl = "pressure_msl",// En hectopascales hPa
|
|
32
|
+
CloudCover = "cloud_cover",// En porcentaje %
|
|
33
|
+
Visibility = "visibility",// En metros m
|
|
34
|
+
WindSpeed = "wind_speed_10m",// En kilometros por hora km/h
|
|
35
|
+
WindDirection = "wind_direction_10m",// En grados
|
|
36
|
+
UvIndex = "uv_index",// Índice UV
|
|
37
|
+
IsDay = "is_day"
|
|
38
|
+
}
|
|
39
|
+
export declare enum DailyParams {
|
|
40
|
+
TemperatureMax = "temperature_2m_max",
|
|
41
|
+
TemperatureMin = "temperature_2m_min",
|
|
42
|
+
Sunrise = "sunrise",
|
|
43
|
+
Sunset = "sunset",
|
|
44
|
+
DaylightDuration = "daylight_duration"
|
|
45
|
+
}
|
|
46
|
+
export interface FetchWeatherProps {
|
|
47
|
+
latitude: number;
|
|
48
|
+
longitude: number;
|
|
49
|
+
hourly?: HourlyParams[];
|
|
50
|
+
daily?: DailyParams[];
|
|
51
|
+
timezone?: string;
|
|
52
|
+
past_days?: number;
|
|
53
|
+
forecast_days?: number;
|
|
54
|
+
}
|
|
55
|
+
export interface StructureWeatherData {
|
|
56
|
+
latitude: number;
|
|
57
|
+
longitude: number;
|
|
58
|
+
timezone: string;
|
|
59
|
+
pastDay: DailyWeatherData[];
|
|
60
|
+
currentDay: DailyWeatherData;
|
|
61
|
+
forecast: DailyWeatherData[];
|
|
62
|
+
}
|
|
63
|
+
export interface WeatherValue {
|
|
64
|
+
value: number;
|
|
65
|
+
unit: string;
|
|
66
|
+
}
|
|
67
|
+
export interface DateValue {
|
|
68
|
+
value: Date;
|
|
69
|
+
unit: string;
|
|
70
|
+
}
|
|
71
|
+
export interface TextValue {
|
|
72
|
+
value: string;
|
|
73
|
+
unit: string;
|
|
74
|
+
}
|
|
75
|
+
export interface WindData {
|
|
76
|
+
speed: WeatherValue;
|
|
77
|
+
direction?: WeatherValue;
|
|
78
|
+
}
|
|
79
|
+
export interface UVData {
|
|
80
|
+
value: number;
|
|
81
|
+
riskLevel: UvRiskLevels;
|
|
82
|
+
description: string;
|
|
83
|
+
unit: string;
|
|
84
|
+
}
|
|
85
|
+
export interface DailyWeatherData {
|
|
86
|
+
day?: DateValue;
|
|
87
|
+
hourly?: HourlyWeatherData[];
|
|
88
|
+
temperatureMax?: WeatherValue;
|
|
89
|
+
temperatureMin?: WeatherValue;
|
|
90
|
+
sunrise?: DateValue;
|
|
91
|
+
sunset?: DateValue;
|
|
92
|
+
daylightDuration?: WeatherValue;
|
|
93
|
+
}
|
|
94
|
+
export interface HourlyWeatherData {
|
|
95
|
+
hour?: DateValue;
|
|
96
|
+
temperature?: WeatherValue;
|
|
97
|
+
relativeHumidity?: WeatherValue;
|
|
98
|
+
dewPoint?: WeatherValue;
|
|
99
|
+
apparentTemperature?: WeatherValue;
|
|
100
|
+
precipitationProbability?: WeatherValue;
|
|
101
|
+
precipitation?: WeatherValue;
|
|
102
|
+
rain?: WeatherValue;
|
|
103
|
+
snowfall?: WeatherValue;
|
|
104
|
+
snowDepth?: WeatherValue;
|
|
105
|
+
weatherCode?: WeatherValue;
|
|
106
|
+
weatherDescription?: TextValue;
|
|
107
|
+
pressureMsl?: WeatherValue;
|
|
108
|
+
cloudCover?: WeatherValue;
|
|
109
|
+
visibility?: WeatherValue;
|
|
110
|
+
wind?: WindData;
|
|
111
|
+
uv?: UVData;
|
|
112
|
+
isDay?: WeatherValue;
|
|
113
|
+
}
|
|
114
|
+
export declare enum UvRiskLevels {
|
|
115
|
+
UNKNOWN = "Desconocido",
|
|
116
|
+
LOW = "Bajo",
|
|
117
|
+
MODERATE = "Moderado",
|
|
118
|
+
HIGH = "Alto"
|
|
119
|
+
}
|
|
120
|
+
/** Relación entre códigos WMO y su descripción meteorológica correspondiente.
|
|
121
|
+
* WMO Weather interpretation codes (WW)
|
|
122
|
+
* 0 Clear sky
|
|
123
|
+
* 1, 2, 3 Mainly clear, partly cloudy, and overcast
|
|
124
|
+
* 45, 48 Fog and depositing rime fog
|
|
125
|
+
* 51, 53, 55 Drizzle: Light, moderate, and dense intensity
|
|
126
|
+
* 56, 57 Freezing Drizzle: Light and dense intensity
|
|
127
|
+
* 61, 63, 65 Rain: Slight, moderate and heavy intensity
|
|
128
|
+
* 66, 67 Freezing Rain: Light and heavy intensity
|
|
129
|
+
* 71, 73, 75 Snow fall: Slight, moderate, and heavy intensity
|
|
130
|
+
* 77 Snow grains
|
|
131
|
+
* 80, 81, 82 Rain showers: Slight, moderate, and violent
|
|
132
|
+
* 85, 86 Snow showers slight and heavy
|
|
133
|
+
* 95 Thunderstorm: Slight or moderate
|
|
134
|
+
*/
|
|
135
|
+
export declare enum WeatherDescriptions {
|
|
136
|
+
clear_sky = "Cielo despejado",
|
|
137
|
+
mainly_clear = "Mayormente despejado",
|
|
138
|
+
partly_cloudy = "Parcialmente nublado",
|
|
139
|
+
overcast = "Mayormente nublado",
|
|
140
|
+
fog = "Niebla",
|
|
141
|
+
depositing_rime_fog = "Niebla con escarcha",
|
|
142
|
+
drizzle_light = "Llovizna ligera",
|
|
143
|
+
drizzle_moderate = "Llovizna moderada",
|
|
144
|
+
drizzle_dense = "Llovizna densa",
|
|
145
|
+
freezing_drizzle_light = "Llovizna helada ligera",
|
|
146
|
+
freezing_drizzle_dense = "Llovizna helada densa",
|
|
147
|
+
rain_slight = "Lluvia ligera",
|
|
148
|
+
rain_moderate = "Lluvia moderada",
|
|
149
|
+
rain_heavy = "Lluvia intensa",
|
|
150
|
+
freezing_rain_light = "Lluvia helada ligera",
|
|
151
|
+
freezing_rain_heavy = "Lluvia helada intensa",
|
|
152
|
+
snowfall_slight = "Nevada ligera",
|
|
153
|
+
snowfall_moderate = "Nevada moderada",
|
|
154
|
+
snowfall_heavy = "Nevada intensa",
|
|
155
|
+
snow_grains = "Precipitaci\u00F3n de granos de nieve",
|
|
156
|
+
rain_showers_slight = "Chubascos ligeros",
|
|
157
|
+
rain_showers_moderate = "Chubascos moderados",
|
|
158
|
+
rain_showers_violent = "Chubascos violentos",
|
|
159
|
+
snow_showers_slight = "Chubascos de nieve ligeros",
|
|
160
|
+
snow_showers_heavy = "Chubascos de nieve intensos",
|
|
161
|
+
thunderstorm = "Tormenta"
|
|
162
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { DailyParams, HourlyParams, WeatherDescriptions } from "../types/weatherTypes";
|
|
2
|
+
/**
|
|
3
|
+
* URL base para las solicitudes de datos meteorológicos de Open-Meteo API.
|
|
4
|
+
*/
|
|
5
|
+
export declare const BASE_URL = "https://api.open-meteo.com/v1/forecast";
|
|
6
|
+
/**
|
|
7
|
+
* Configuración por defecto para las solicitudes meteorológicas.
|
|
8
|
+
* Estos valores se usan cuando el usuario no especifica parámetros.
|
|
9
|
+
*/
|
|
10
|
+
export declare const WEATHER_CONSTANTS: {
|
|
11
|
+
/** Zona horaria por defecto para las consultas */
|
|
12
|
+
readonly DEFAULT_TIMEZONE: "America/Sao_Paulo";
|
|
13
|
+
/** Parámetros meteorológicos por hora solicitados por defecto */
|
|
14
|
+
readonly DEFAULT_HOURLY_PARAMS: HourlyParams[];
|
|
15
|
+
/** Parámetros meteorológicos diarios solicitados por defecto */
|
|
16
|
+
readonly DEFAULT_DAILY_PARAMS: DailyParams[];
|
|
17
|
+
/** Número de días pasados a incluir por defecto */
|
|
18
|
+
readonly DEFAULT_PAST_DAYS: 0;
|
|
19
|
+
/** Número de días de pronóstico a incluir por defecto */
|
|
20
|
+
readonly DEFAULT_FORECAST_DAYS: 7;
|
|
21
|
+
/** Duración del caché en milisegundos (10 minutos) */
|
|
22
|
+
readonly DEFAULT_CACHE_DURATION: number;
|
|
23
|
+
/** Timeout para las solicitudes HTTP en milisegundos */
|
|
24
|
+
readonly REQUEST_TIMEOUT: 10000;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Configuración de niveles de riesgo UV según la OMS.
|
|
28
|
+
* @see https://www.who.int/news-room/questions-and-answers/item/radiation-the-ultraviolet-(uv)-index
|
|
29
|
+
*/
|
|
30
|
+
export declare const UV_RISK_CONFIG: {
|
|
31
|
+
/** Rangos de índice UV para cada nivel de riesgo */
|
|
32
|
+
readonly RANGES: {
|
|
33
|
+
readonly Bajo: {
|
|
34
|
+
readonly min: 0;
|
|
35
|
+
readonly max: 2;
|
|
36
|
+
};
|
|
37
|
+
readonly Moderado: {
|
|
38
|
+
readonly min: 3;
|
|
39
|
+
readonly max: 7;
|
|
40
|
+
};
|
|
41
|
+
readonly Alto: {
|
|
42
|
+
readonly min: 8;
|
|
43
|
+
readonly max: number;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
/** Descripciones de recomendaciones por nivel de riesgo UV */
|
|
47
|
+
readonly DESCRIPTIONS: {
|
|
48
|
+
readonly Desconocido: "No se puede determinar el riesgo de exposición";
|
|
49
|
+
readonly Bajo: "Puedes disfrutar de estar afuera con seguridad";
|
|
50
|
+
readonly Moderado: "Busca sombra durante las horas del mediodía. Ponte una remera, utiliza protector solar y un sombrero.";
|
|
51
|
+
readonly Alto: "Evita estar afuera durante las horas del mediodía. Asegúrate de buscar sombra. La remera, el protector solar y el sombrero son imprescindibles.";
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Mapeo de códigos meteorológicos WMO a descripciones en español.
|
|
56
|
+
* @see https://www.nodc.noaa.gov/archive/arc0021/0002199/1.1/data/0-data/HTML/WMO-CODE/WMO4677.HTM
|
|
57
|
+
*/
|
|
58
|
+
export declare const WMO_WEATHER_CODES: Record<number, WeatherDescriptions>;
|
|
59
|
+
/**
|
|
60
|
+
* Mapeo de parámetros meteorológicos a sus unidades correspondientes.
|
|
61
|
+
*/
|
|
62
|
+
export declare const UNITS: {
|
|
63
|
+
readonly time: "iso8601";
|
|
64
|
+
readonly hour: "iso8601";
|
|
65
|
+
readonly temperature_2m: "ºC";
|
|
66
|
+
readonly temperature_2m_max: "ºC";
|
|
67
|
+
readonly temperature_2m_min: "ºC";
|
|
68
|
+
readonly dew_point_2m: "ºC";
|
|
69
|
+
readonly apparent_temperature: "ºC";
|
|
70
|
+
readonly relative_humidity_2m: "%";
|
|
71
|
+
readonly precipitation_probability: "%";
|
|
72
|
+
readonly precipitation: "mm";
|
|
73
|
+
readonly rain: "mm";
|
|
74
|
+
readonly snowfall: "cm";
|
|
75
|
+
readonly snow_depth: "m";
|
|
76
|
+
readonly pressure_msl: "hPa";
|
|
77
|
+
readonly wind_speed_10m: "km/h";
|
|
78
|
+
readonly wind_direction_10m: "°";
|
|
79
|
+
readonly cloud_cover: "%";
|
|
80
|
+
readonly visibility: "km";
|
|
81
|
+
readonly weather_code: "wmo code";
|
|
82
|
+
readonly sunrise: "iso8601";
|
|
83
|
+
readonly sunset: "iso8601";
|
|
84
|
+
readonly daylight_duration: "h";
|
|
85
|
+
readonly uv_index: "index";
|
|
86
|
+
readonly is_day: "flag";
|
|
87
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UvRiskLevels } from "../types/weatherTypes";
|
|
2
|
+
/**
|
|
3
|
+
* Obtiene el nivel de riesgo UV basado en el índice UV.
|
|
4
|
+
* @param index - Índice UV.
|
|
5
|
+
* @returns Nivel de riesgo UV.
|
|
6
|
+
*/
|
|
7
|
+
export declare const getUvRiskLevel: (index: number) => UvRiskLevels;
|
|
8
|
+
/**
|
|
9
|
+
* Obtiene la descripción del riesgo UV basado en el índice UV.
|
|
10
|
+
* @param index - Índice UV.
|
|
11
|
+
* @returns Descripción del riesgo UV.
|
|
12
|
+
*/
|
|
13
|
+
export declare const getUvDescription: (index: number) => string;
|
package/package.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@i-giann/open-meteo-wrapper",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/IaconoG/open-meteo-wrapper-npm.git"
|
|
7
|
+
},
|
|
8
|
+
"description": "Un wrapper completo para la API de Open-Meteo con hooks de React y servicios reutilizables",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"weather",
|
|
11
|
+
"open-meteo",
|
|
12
|
+
"react",
|
|
13
|
+
"zustand",
|
|
14
|
+
"vite",
|
|
15
|
+
"typescript",
|
|
16
|
+
"weather-api",
|
|
17
|
+
"meteorology",
|
|
18
|
+
"forecast",
|
|
19
|
+
"climate"
|
|
20
|
+
],
|
|
21
|
+
"author": "Giann Iacono <email@example.com>",
|
|
22
|
+
"homepage": "https://github.com/IaconoG/open-meteo-wrapper-npm#readme",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/IaconoG/open-meteo-wrapper-npm/issues"
|
|
25
|
+
},
|
|
26
|
+
"private": false,
|
|
27
|
+
"main": "./dist/index.cjs",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"import": "./dist/index.esm.js",
|
|
33
|
+
"require": "./dist/index.cjs"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"dist",
|
|
38
|
+
"package.json",
|
|
39
|
+
"LICENSE",
|
|
40
|
+
"README.md"
|
|
41
|
+
],
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=18.0.0"
|
|
44
|
+
},
|
|
45
|
+
"module": "./dist/index.esm.js",
|
|
46
|
+
"sideEffects": false,
|
|
47
|
+
"license": "MIT",
|
|
48
|
+
"type": "module",
|
|
49
|
+
"scripts": {
|
|
50
|
+
"dev": "vite",
|
|
51
|
+
"build": "npm run build:js && npm run build:types",
|
|
52
|
+
"build:js": "vite build",
|
|
53
|
+
"build:types": "tsc -p tsconfig.build.json",
|
|
54
|
+
"lint": "eslint .",
|
|
55
|
+
"preview": "vite preview",
|
|
56
|
+
"format": "prettier --write .",
|
|
57
|
+
"test": "jest"
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"immer": "^10.1.1"
|
|
61
|
+
},
|
|
62
|
+
"peerDependencies": {
|
|
63
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
64
|
+
"zustand": "^5.0.3"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@eslint/js": "^9.39.2",
|
|
68
|
+
"@testing-library/react": "^16.2.0",
|
|
69
|
+
"@types/jest": "^29.5.14",
|
|
70
|
+
"@types/node": "^24.0.10",
|
|
71
|
+
"@types/react": "^19.1.8",
|
|
72
|
+
"@types/testing-library__react": "^10.2.0",
|
|
73
|
+
"@typescript-eslint/eslint-plugin": "^8.54.0",
|
|
74
|
+
"@typescript-eslint/parser": "^8.54.0",
|
|
75
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
76
|
+
"eslint": "^9.39.2",
|
|
77
|
+
"eslint-plugin-react": "^7.37.5",
|
|
78
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
79
|
+
"eslint-plugin-react-refresh": "^0.4.18",
|
|
80
|
+
"globals": "^15.15.0",
|
|
81
|
+
"jest": "^29.7.0",
|
|
82
|
+
"jest-fixed-jsdom": "^0.0.9",
|
|
83
|
+
"jiti": "^2.6.1",
|
|
84
|
+
"msw": "^2.7.3",
|
|
85
|
+
"ts-jest": "^29.2.6",
|
|
86
|
+
"tsc-alias": "^1.8.15",
|
|
87
|
+
"typescript": "~5.7.2",
|
|
88
|
+
"typescript-eslint": "^8.54.0",
|
|
89
|
+
"vite": "^6.1.0"
|
|
90
|
+
}
|
|
91
|
+
}
|