kelikatti/kelikatti-web/src/types.ts

84 lines
2.0 KiB
TypeScript

export type Condition =
| 'thunderstorm'
| 'drizzle'
| 'rain'
| 'snow'
| 'fog'
| 'mist'
| 'haze'
| 'tornado'
export interface WeatherDTO {
/** UTC timestamp of sunrise in milliseconds */
sunrise_utc_ms?: number
/** UTC timestamp of sunset in milliseconds */
sunset_utc_ms?: number
/** How much timestamps need to be shifted to get the local time in milliseconds */
timezone_shift_ms?: number
/** Temperature in Celsius */
temperature?: number
/** Perception of temperature in Celsius */
feels_like?: number
/** Wind speed in meters/second */
wind_speed?: number
/** Meteorological wind direction in degrees
*
* 0: From north
* 90: From east
* 180: Form south
* 270: From west
* */
wind_dir?: number
/** Speed of sudden gusts in meters/second */
gust_speed?: number
/** Humidity percentage (0 - 1) */
humidity?: number
/** Rain in mm/h */
rain_rate?: number
/** Snow in mm/h */
snow_rate?: number
/** Percentage of clouds covering the sky (0 - 1) */
cloudiness?: number
/** List of possible weather phenomena */
conditions: Condition[]
}
export interface ForecastDatapointDTO {
/** UTC timestamp of forecast in milliseconds */
timestamp_utc_ms: number
/** Is the forecast for daytime? */
is_day: boolean
/** Temperature in Celsius */
temperature?: number
/** Perception of temperature in Celsius */
feels_like?: number
/** Wind speed in meters/second */
wind_speed?: number
/** Meteorological wind direction in degrees
*
* 0: From north
* 90: From east
* 180: Form south
* 270: From west
* */
wind_dir?: number
/** Speed of sudden gusts in meters/second */
gust_speed?: number
/** Humidity percentage (0 - 1) */
humidity?: number
/** Chance of precipitation (0 - 1) */
precipitation_chance?: number
/** Rain in mm/h */
rain_rate?: number
/** Snow in mm/h */
snow_rate?: number
/** Percentage of clouds covering the sky (0 - 1) */
cloudiness?: number
/** List of possible weather phenomena */
conditions: Condition[]
}
export interface ForecastDTO {
list: ForecastDatapointDTO[]
}