mirror of
https://github.com/piyush-eon/tanstack-query-weather-app.git
synced 2025-11-24 05:11:19 +00:00
61 lines
1010 B
TypeScript
61 lines
1010 B
TypeScript
export interface Coordinates {
|
|
lat: number;
|
|
lon: number;
|
|
}
|
|
|
|
export interface GeocodingResponse {
|
|
name: string;
|
|
local_names?: Record<string, string>;
|
|
lat: number;
|
|
lon: number;
|
|
country: string;
|
|
state?: string;
|
|
}
|
|
|
|
export interface WeatherCondition {
|
|
id: number;
|
|
main: string;
|
|
description: string;
|
|
icon: string;
|
|
}
|
|
|
|
export interface WeatherData {
|
|
coord: Coordinates;
|
|
weather: WeatherCondition[];
|
|
main: {
|
|
temp: number;
|
|
feels_like: number;
|
|
temp_min: number;
|
|
temp_max: number;
|
|
pressure: number;
|
|
humidity: number;
|
|
};
|
|
wind: {
|
|
speed: number;
|
|
deg: number;
|
|
};
|
|
sys: {
|
|
sunrise: number;
|
|
sunset: number;
|
|
country: string;
|
|
};
|
|
name: string;
|
|
dt: number;
|
|
}
|
|
|
|
export interface ForecastData {
|
|
list: Array<{
|
|
dt: number;
|
|
main: WeatherData["main"];
|
|
weather: WeatherData["weather"];
|
|
wind: WeatherData["wind"];
|
|
dt_txt: string;
|
|
}>;
|
|
city: {
|
|
name: string;
|
|
country: string;
|
|
sunrise: number;
|
|
sunset: number;
|
|
};
|
|
}
|