feat: add Open-Meteo weather forecast
This commit is contained in:
52
types/forecast.ts
Normal file
52
types/forecast.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
export interface RawForecastSeries {
|
||||
time?: unknown;
|
||||
temperature_2m?: unknown;
|
||||
apparent_temperature?: unknown;
|
||||
precipitation_probability?: unknown;
|
||||
precipitation?: unknown;
|
||||
weather_code?: unknown;
|
||||
wind_speed_10m?: unknown;
|
||||
temperature_2m_max?: unknown;
|
||||
temperature_2m_min?: unknown;
|
||||
precipitation_probability_max?: unknown;
|
||||
precipitation_sum?: unknown;
|
||||
sunrise?: unknown;
|
||||
sunset?: unknown;
|
||||
}
|
||||
|
||||
export interface RawWeatherForecast {
|
||||
latitude?: unknown;
|
||||
longitude?: unknown;
|
||||
timezone?: unknown;
|
||||
hourly?: RawForecastSeries;
|
||||
daily?: RawForecastSeries;
|
||||
}
|
||||
|
||||
export interface HourlyForecast {
|
||||
time: string;
|
||||
temperature: number | null;
|
||||
feelsLike: number | null;
|
||||
precipitationProbability: number | null;
|
||||
precipitation: number | null;
|
||||
weatherCode: number | null;
|
||||
windSpeed: number | null;
|
||||
}
|
||||
|
||||
export interface DailyForecast {
|
||||
date: string;
|
||||
temperatureMax: number | null;
|
||||
temperatureMin: number | null;
|
||||
precipitationProbability: number | null;
|
||||
precipitation: number | null;
|
||||
weatherCode: number | null;
|
||||
sunrise: string | null;
|
||||
sunset: string | null;
|
||||
}
|
||||
|
||||
export interface WeatherForecast {
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
timezone: string;
|
||||
hourly: HourlyForecast[];
|
||||
daily: DailyForecast[];
|
||||
}
|
||||
@@ -10,6 +10,8 @@ export interface LocationSearchResult {
|
||||
export interface SelectedLocation {
|
||||
name: string;
|
||||
province: string | null;
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
stationId: string;
|
||||
stationName: string;
|
||||
distanceKm: number;
|
||||
|
||||
Reference in New Issue
Block a user