This commit is contained in:
2026-01-03 14:16:16 -08:00
commit 1f0e678d47
71 changed files with 16127 additions and 0 deletions

92
frontend/lib/types.ts Normal file
View File

@@ -0,0 +1,92 @@
// Core weather data types matching backend models
export interface WeatherPoint {
timestamp: string
temperature: number
wind_speed: number
wind_gust: number
wind_direction: number
cloud_cover: number
precipitation: number
visibility: number
pressure: number
humidity: number
}
export interface Thresholds {
max_wind_speed: number
max_wind_gust: number
max_precipitation: number
min_visibility: number
max_cloud_cover: number
min_temperature?: number
max_temperature?: number
}
export interface Assessment {
is_flyable: boolean
reasons: string[]
score: number
}
export interface FlyableWindow {
start: string
end: string
duration_hours: number
avg_conditions: {
wind_speed: number
wind_gust: number
temperature: number
cloud_cover: number
}
}
// API Response types
export interface CurrentWeatherResponse {
location: {
lat: number
lon: number
name?: string
}
current: WeatherPoint
assessment: Assessment
last_updated: string
}
export interface ForecastResponse {
location: {
lat: number
lon: number
name?: string
}
forecast: WeatherPoint[]
flyable_windows: FlyableWindow[]
generated_at: string
}
export interface HistoricalResponse {
location: {
lat: number
lon: number
name?: string
}
date: string
data: WeatherPoint[]
}
export interface AssessmentRequest {
thresholds: Thresholds
}
export interface AssessmentResponse {
current: WeatherPoint
assessment: Assessment
thresholds_used: Thresholds
}
// Error response type
export interface APIError {
error: string
detail?: string
}