/** * Type definitions for lightning strike data * Supports Blitzortung.org and other lightning detection networks */ /** * Safety risk levels based on lightning proximity */ export type LightningSafetyLevel = 'safe' | 'elevated' | 'high' | 'extreme'; /** * Lightning strike data from detection network */ export interface LightningStrike { timestamp: Date; latitude: number; longitude: number; polarity: number; amplitude: number; stationCount?: number; distance?: number; } /** * Lightning activity request parameters */ export interface LightningActivityParams { latitude: number; longitude: number; radius?: number; timeWindow?: number; } /** * Lightning activity statistics */ export interface LightningStatistics { totalStrikes: number; cloudToGroundStrikes: number; intraCloudStrikes: number; averageDistance: number | null; nearestDistance: number | null; strikesPerMinute: number; densityPerSqKm: number; } /** * Lightning safety assessment */ export interface LightningSafetyAssessment { level: LightningSafetyLevel; message: string; recommendations: string[]; nearestStrikeDistance: number | null; nearestStrikeTime: Date | null; isActiveThunderstorm: boolean; } /** * How much of the requested time window is actually backed by live monitoring. * Strikes are collected into a rolling buffer that only fills while the area's * MQTT subscriptions are active, so a fresh server (or a first query for an * area) may cover far less history than the requested window. */ export interface LightningMonitoringCoverage { monitoringSince: Date | null; coverageMinutes: number; isComplete: boolean; feedUnavailable: boolean; } /** * Why a lightning query could not reach the live feed. Classified at the point * of failure from the transport phase, never from an error message, so no broker * URL or upstream error detail can reach a rendered report or a log line. */ export type LightningFeedFailureReason = 'connect_timeout' | 'connection_error' | 'subscribe_failed'; /** * The moment and sanitized cause of a transport failure a lightning query * swallowed. Associated with the array that query returned, never stored as a * "last failure" field: queries overlap, so a shared field would let one query's * outcome be read by another. */ export interface LightningFeedFailure { at: Date; reason: LightningFeedFailureReason; } /** * Lightning activity response */ export interface LightningActivityResponse { location: { latitude: number; longitude: number; }; searchRadius: number; timeWindow: number; searchPeriod: { start: Date; end: Date; }; strikes: LightningStrike[]; statistics: LightningStatistics; safety: LightningSafetyAssessment; coverage: LightningMonitoringCoverage; source: string; generatedAt: Date; disclaimer?: string; } /** * Blitzortung.org API response types */ export interface BlitzortungStrike { time: number; lat: number; lon: number; alt: number; pol: number; mcs: number; stat: number; } export interface BlitzortungResponse { strikes: BlitzortungStrike[]; } //# sourceMappingURL=lightning.d.ts.map