christian
e52b362512
Some checks failed
Docker Build & Publish / Build Docker (push) Failing after 52s
184 lines
3.8 KiB
TypeScript
184 lines
3.8 KiB
TypeScript
export interface Forecast {
|
|
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;
|
|
}
|
|
|
|
export interface HourlyWeather {
|
|
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[];
|
|
}
|
|
|
|
export interface LocationType {
|
|
results: {
|
|
address_components: {
|
|
long_name: string;
|
|
short_name: string;
|
|
types: string[];
|
|
}[];
|
|
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[];
|
|
}[];
|
|
status: string;
|
|
}
|
|
|
|
export interface coordType {
|
|
name: string;
|
|
geo: {
|
|
lat: number;
|
|
lng: number;}
|
|
}
|
|
|
|
export type EffectCallback = () => void | (() => void | undefined);
|
|
|
|
export interface TempInfo {
|
|
temp: number;
|
|
feels_like: number;
|
|
temp_min: number;
|
|
temp_max: number;
|
|
pressure: number;
|
|
humidity: number;
|
|
}
|
|
|
|
|
|
export interface LocationContextType {
|
|
geoLocation: coordType;
|
|
setGeoLocation: React.Dispatch<React.SetStateAction<coordType>>;
|
|
}
|
|
|
|
export interface WeatherContextType {
|
|
weather: Forecast;
|
|
setWeather: React.Dispatch<React.SetStateAction<Forecast>>;
|
|
}
|
|
|
|
export interface HourlyCardPropType {
|
|
temperature: number;
|
|
weatherCode: number;
|
|
time: string;
|
|
}
|
|
export interface DailyCardPropType {
|
|
temperature: number;
|
|
weatherCode: number;
|
|
time: string;
|
|
} |