/** * Service for interacting with the NOAA Weather API */ import type { PointsResponse, ForecastResponse, ObservationResponse, ObservationCollectionResponse, StationCollectionResponse, AlertCollectionResponse, NWPSGauge, NWPSStageFlowResponse, USGSIVResponse } from '../types/noaa.js'; import { type ServiceProbeResult } from '../utils/serviceStatusProbe.js'; export interface NOAAServiceConfig { userAgent?: string; baseURL?: string; nwpsBaseURL?: string; usgsBaseURL?: string; timeout?: number; maxRetries?: number; } export declare class NOAAService { private client; private nwpsClient; private usgsClient; private maxRetries; private cache; constructor(config?: NOAAServiceConfig); /** * Handle API errors with retry logic and helpful status information */ private handleError; /** * Make request with retry logic */ private makeRequest; /** * Get cache statistics */ getCacheStats(): import("../utils/cache.js").CacheStats; /** * Clear the cache */ clearCache(): void; /** * Check whether the NOAA API answers, and how * Performs a lightweight health check by requesting a well-known endpoint. * Every HTTP status resolves (validateStatus) so the probe reads it itself; the * interceptor rewrites rejections, so the catch only records that no answer came. * @returns What the probe observed; never rejects */ checkServiceStatus(): Promise; /** * Convert lat/lon coordinates to NWS grid information * This is the first step for getting forecast or observation data */ getPointData(latitude: number, longitude: number): Promise; /** * Get forecast for a location using grid coordinates */ getForecast(office: string, gridX: number, gridY: number, units?: 'us' | 'si'): Promise; /** * Get hourly forecast for a location using grid coordinates */ getHourlyForecast(office: string, gridX: number, gridY: number, units?: 'us' | 'si'): Promise; /** * Get forecast for a location using lat/lon (convenience method) * This combines getPointData and getForecast */ getForecastByCoordinates(latitude: number, longitude: number, units?: 'us' | 'si'): Promise; /** * Get hourly forecast for a location using lat/lon (convenience method) * This combines getPointData and getHourlyForecast */ getHourlyForecastByCoordinates(latitude: number, longitude: number, units?: 'us' | 'si'): Promise; /** * Get gridpoint data for a location using grid coordinates * Contains detailed forecast data including fire weather indices */ getGridpointData(office: string, gridX: number, gridY: number): Promise; /** * Get gridpoint data for a location using lat/lon (convenience method) * This combines getPointData and getGridpointData */ getGridpointDataByCoordinates(latitude: number, longitude: number): Promise; /** * Get nearest observation stations for a location */ getStations(latitude: number, longitude: number): Promise; /** * Get the latest observation from a station */ getLatestObservation(stationId: string): Promise; /** * Get observations from a station within a time range */ getObservations(stationId: string, startTime?: Date, endTime?: Date, limit?: number): Promise; /** * Get current conditions for a location (convenience method) * This combines getStations and getLatestObservation */ getCurrentConditions(latitude: number, longitude: number): Promise; /** * Get historical observations for a location (convenience method) */ getHistoricalObservations(latitude: number, longitude: number, startTime: Date, endTime: Date, limit?: number): Promise; /** * Get active weather alerts for a location * @param latitude Latitude coordinate * @param longitude Longitude coordinate * @param activeOnly Whether to filter to only active alerts (default: true) * @returns Collection of weather alerts */ getAlerts(latitude: number, longitude: number, activeOnly?: boolean): Promise; /** * NWPS (National Water Prediction Service) Methods for River Gauges */ /** * Get a specific river gauge by its NWSLI identifier * @param lid 5-character NWSLI identifier (e.g., "LOLT2") * @returns River gauge data with current conditions and flood stages */ getNWPSGauge(lid: string): Promise; /** * Get stage/flow time series data for a specific gauge * @param lid 5-character NWSLI identifier * @returns Time series of stage and flow data */ getNWPSStageFlow(lid: string): Promise; /** * Get all NWPS gauges (warning: large response, should be filtered) * Note: This endpoint returns all gauges across the US. Consider using * geographic filtering or querying by specific gauge IDs instead. * @returns Array of all river gauges * @deprecated Use getNWPSGaugesInBoundingBox instead to avoid downloading entire catalog */ getAllNWPSGauges(): Promise; /** * Get NWPS river gauges within a bounding box * More efficient than getAllNWPSGauges() for location-specific queries * @param west Western longitude boundary * @param south Southern latitude boundary * @param east Eastern longitude boundary * @param north Northern latitude boundary * @returns Array of gauges within the bounding box */ getNWPSGaugesInBoundingBox(west: number, south: number, east: number, north: number): Promise; /** * USGS Water Services Methods for Streamflow Data */ /** * Get real-time streamflow data for sites within a bounding box * @param west Western longitude boundary * @param south Southern latitude boundary * @param east Eastern longitude boundary * @param north Northern latitude boundary * @returns USGS instantaneous values response with streamflow data */ getUSGSStreamflow(west: number, south: number, east: number, north: number): Promise; /** * Get real-time streamflow data for a specific USGS site * @param siteNumber USGS site number (e.g., "01646500") * @returns USGS instantaneous values response with streamflow data */ getUSGSStreamflowForSite(siteNumber: string): Promise; } //# sourceMappingURL=noaa.d.ts.map