2024-05-05 07:51:29 +00:00
|
|
|
export interface Forecast {
|
2024-05-09 23:00:26 +00:00
|
|
|
latitude: number;
|
|
|
|
longitude: number;
|
|
|
|
generationtime_ms: number;
|
|
|
|
utc_offset_seconds: number;
|
|
|
|
timezone: string;
|
|
|
|
timezone_abbreviation: string;
|
|
|
|
elevation: number;
|
|
|
|
current_units: CurrentUnits;
|
|
|
|
current: CurrentWeather;
|
|
|
|
hourly_units: HourlyUnits;
|
|
|
|
hourly: HourlyWeather;
|
|
|
|
daily_units: DailyUnits;
|
|
|
|
daily: DailyWeather;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface CurrentUnits {
|
|
|
|
time: string;
|
|
|
|
interval: string;
|
|
|
|
temperature_2m: string;
|
|
|
|
apparent_temperature: string;
|
|
|
|
is_day: string;
|
|
|
|
precipitation: string;
|
|
|
|
rain: string;
|
|
|
|
showers: string;
|
|
|
|
snowfall: string;
|
|
|
|
weather_code: string;
|
|
|
|
cloud_cover: string;
|
|
|
|
wind_speed_10m: string;
|
|
|
|
wind_direction_10m: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface CurrentWeather {
|
|
|
|
time: string;
|
|
|
|
interval: number;
|
|
|
|
temperature_2m: number;
|
|
|
|
apparent_temperature: number;
|
|
|
|
is_day: number;
|
|
|
|
precipitation: number;
|
|
|
|
rain: number;
|
|
|
|
showers: number;
|
|
|
|
snowfall: number;
|
|
|
|
weather_code: number;
|
|
|
|
cloud_cover: number;
|
|
|
|
wind_speed_10m: number;
|
|
|
|
wind_direction_10m: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface HourlyUnits {
|
|
|
|
time: string;
|
|
|
|
temperature_2m: string;
|
|
|
|
apparent_temperature: string;
|
|
|
|
precipitation_probability: string;
|
|
|
|
precipitation: string;
|
|
|
|
weather_code: string;
|
|
|
|
wind_speed_10m: string;
|
|
|
|
is_day: string;
|
|
|
|
}
|
|
|
|
|
2024-05-10 12:50:01 +00:00
|
|
|
export interface HourlyWeather {
|
2024-05-09 23:00:26 +00:00
|
|
|
time: string[];
|
|
|
|
temperature_2m: number[];
|
|
|
|
apparent_temperature: number[];
|
|
|
|
precipitation_probability: number[];
|
|
|
|
precipitation: number[];
|
|
|
|
weather_code: number[];
|
|
|
|
wind_speed_10m: number[];
|
|
|
|
is_day: number[];
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DailyUnits {
|
|
|
|
time: string;
|
|
|
|
weather_code: string;
|
|
|
|
temperature_2m_max: string;
|
|
|
|
temperature_2m_min: string;
|
|
|
|
apparent_temperature_max: string;
|
|
|
|
apparent_temperature_min: string;
|
|
|
|
sunrise: string;
|
|
|
|
sunset: string;
|
|
|
|
daylight_duration: string;
|
|
|
|
sunshine_duration: string;
|
|
|
|
uv_index_max: string;
|
|
|
|
precipitation_sum: string;
|
|
|
|
precipitation_hours: string;
|
|
|
|
wind_speed_10m_max: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DailyWeather {
|
|
|
|
time: string[];
|
|
|
|
weather_code: number[];
|
|
|
|
temperature_2m_max: number[];
|
|
|
|
temperature_2m_min: number[];
|
|
|
|
apparent_temperature_max: number[];
|
|
|
|
apparent_temperature_min: number[];
|
|
|
|
sunrise: string[];
|
|
|
|
sunset: string[];
|
|
|
|
daylight_duration: number[];
|
|
|
|
sunshine_duration: number[];
|
|
|
|
uv_index_max: number[];
|
|
|
|
precipitation_sum: number[];
|
|
|
|
precipitation_hours: number[];
|
|
|
|
wind_speed_10m_max: number[];
|
2024-05-09 21:40:14 +00:00
|
|
|
}
|
2024-05-05 20:55:51 +00:00
|
|
|
|
2024-05-05 07:51:29 +00:00
|
|
|
export interface LocationType {
|
2024-05-05 20:55:51 +00:00
|
|
|
results: {
|
2024-05-09 21:40:14 +00:00
|
|
|
address_components: {
|
|
|
|
long_name: string;
|
|
|
|
short_name: string;
|
2024-05-05 20:55:51 +00:00
|
|
|
types: string[];
|
2024-05-09 21:40:14 +00:00
|
|
|
}[];
|
|
|
|
formatted_address: string;
|
|
|
|
geometry: {
|
|
|
|
bounds: {
|
|
|
|
northeast: {
|
|
|
|
lat: number;
|
|
|
|
lng: number;
|
|
|
|
};
|
|
|
|
southwest: {
|
|
|
|
lat: number;
|
|
|
|
lng: number;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
location: {
|
|
|
|
lat: number;
|
|
|
|
lng: number;
|
|
|
|
};
|
|
|
|
location_type: string;
|
|
|
|
viewport: {
|
|
|
|
northeast: {
|
|
|
|
lat: number;
|
|
|
|
lng: number;
|
|
|
|
};
|
|
|
|
southwest: {
|
|
|
|
lat: number;
|
|
|
|
lng: number;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
place_id: string;
|
|
|
|
types: string[];
|
2024-05-05 20:55:51 +00:00
|
|
|
}[];
|
|
|
|
status: string;
|
2024-05-09 21:40:14 +00:00
|
|
|
}
|
2024-05-05 20:55:51 +00:00
|
|
|
|
|
|
|
export interface coordType {
|
2024-05-09 23:00:26 +00:00
|
|
|
name: string;
|
|
|
|
geo: {
|
|
|
|
lat: number;
|
2024-05-17 20:55:48 +00:00
|
|
|
lng: number;
|
|
|
|
};
|
2024-05-09 21:40:14 +00:00
|
|
|
}
|
2024-05-09 23:00:26 +00:00
|
|
|
|
2024-05-09 21:40:14 +00:00
|
|
|
export type EffectCallback = () => void | (() => void | undefined);
|
2024-05-06 21:22:57 +00:00
|
|
|
|
|
|
|
export interface TempInfo {
|
|
|
|
temp: number;
|
|
|
|
feels_like: number;
|
|
|
|
temp_min: number;
|
|
|
|
temp_max: number;
|
|
|
|
pressure: number;
|
|
|
|
humidity: number;
|
2024-05-09 21:40:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface LocationContextType {
|
|
|
|
geoLocation: coordType;
|
|
|
|
setGeoLocation: React.Dispatch<React.SetStateAction<coordType>>;
|
2024-05-09 23:00:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface WeatherContextType {
|
2024-05-12 05:06:44 +00:00
|
|
|
weather: Forecast;
|
|
|
|
setWeather: React.Dispatch<React.SetStateAction<Forecast>>;
|
2024-05-10 12:50:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface HourlyCardPropType {
|
2024-05-10 17:23:02 +00:00
|
|
|
temperature: number;
|
|
|
|
weatherCode: number;
|
2024-05-10 22:45:03 +00:00
|
|
|
time: string;
|
2024-05-12 05:06:44 +00:00
|
|
|
}
|
|
|
|
export interface DailyCardPropType {
|
|
|
|
temperature: number;
|
|
|
|
weatherCode: number;
|
|
|
|
time: string;
|
2024-05-17 20:55:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface WeatherIconType {
|
|
|
|
code: number;
|
|
|
|
url: string;
|
|
|
|
}
|