/** * Service for the MeteoAlarm country warning feeds * (https://feeds.meteoalarm.org/api/v1/warnings/feeds-). * * MeteoAlarm (EUMETNET) aggregates the official severe-weather warnings of * the European national meteorological services as keyless per-country CAP * JSON feeds. There is no pan-Europe aggregate on the keyless tier — one * fetch per country. * * Load-bearing behaviours, all observed live (2026-08-13): * - `info[]` is duplicated per language; the `en`-prefixed entry is selected * with a fallback to the first. * - Feeds contain expired warnings (Germany: 161 published, 51 unexpired) — * client-side expiry filtering is mandatory, and it must run at **read * time**: a cached list must never serve a warning that expired since it * was cached. * - `Update` messages carry `references` to the identifiers they replace; * after expiry filtering, warnings referenced by a surviving Update are * dropped (supersession). * - Payloads are large and uncompressed (Germany 2.76 MB) — the parsed * result is cached for the alerts TTL (5 min) and the feed is never * fetched per-request without the cache in front. * * Errors are plain sanitized `Error`s (the ACIS/NIFC precedent — no * `ApiError` union change): the alerts handler formats them for users. * * Licence terms honoured downstream (renderer): alerts display unmodified, * attribution "EUMETNET – MeteoAlarm" plus the national service, time of * issue always shown. */ import type { MeteoAlarmCapInfo, MeteoAlarmCountryFeed, MeteoAlarmWarning } from '../types/meteoalarm.js'; export interface MeteoAlarmServiceConfig { baseURL?: string; timeout?: number; } /** * MeteoAlarm membership: lowercase ISO 3166-1 alpha-2 country code → feed * slug, display name, and (where known) the national meteorological service * for the attribution footer. * * Every slug in this table was live-verified (HTTP 200 JSON with a * `warnings` array) on 2026-08-13 — 38/38 members passed after one * correction (`mk`: `north-macedonia` 404'd; the live slug is * `republic-of-north-macedonia`). A country absent from this map routes to * the not-covered message by design, so the map degrades gracefully; never * add an unverified slug. */ export declare const COUNTRY_FEEDS: Record; /** * Whether a country (lowercase ISO 3166-1 alpha-2 code) has a MeteoAlarm * feed in the verified membership map. */ export declare function isMeteoAlarmCountry(countryCode: string): boolean; /** * Select the language variant to render: the first `en`-prefixed `info` * entry (`en`, `en-GB`, …), falling back to the first entry. Feeds without * an English variant render in their own language, unmodified (a licence * term either way). */ export declare function selectEnglishInfo(info: MeteoAlarmCapInfo[] | undefined): MeteoAlarmCapInfo | undefined; /** * Parse a MeteoAlarm `awareness_level` parameter value * (`"2; yellow; Moderate"`) into its colour segment, lowercased. Malformed * values return `undefined` — never a throw. */ export declare function parseAwarenessColour(value: string | undefined): string | undefined; /** * Extract the referenced identifiers from a CAP `references` value: a * space-separated list of `sender,identifier,sent` triples. Entries without * a comma are taken as bare identifiers (permissive — feeds vary). */ export declare function parseReferences(references: string | undefined): string[]; /** * Read-time filter pipeline, in order: * 1. drop non-`Actual` status and `Cancel` messages; * 2. drop warnings already expired at `now`; * 3. drop warnings whose identifier is referenced by a *surviving* `Update` * (supersession — deliberately after expiry, so references held by * expired Updates are inert). * * Pure and exported for tests; `getWarnings` applies it on every return, * cached or fresh — a stale cache entry must never serve a warning that * expired after it was cached. */ export declare function filterActiveWarnings(warnings: MeteoAlarmWarning[], now: Date): MeteoAlarmWarning[]; /** * MeteoAlarm country feed client. No API key required. */ export declare class MeteoAlarmService { private client; private cache; private maxRetries; constructor(config?: MeteoAlarmServiceConfig); /** * Fetch the current warnings for a MeteoAlarm member country. * * The **parsed** (unfiltered) warning list is cached for the alerts TTL — * one worst-case 2.8 MB country fetch per 5 minutes — and * `filterActiveWarnings` runs on every return so expiry and supersession * are always evaluated against the caller's `now`. * * @param countryCode Lowercase ISO 3166-1 alpha-2 code of a member country * @throws {Error} If the country is not in the verified membership map, or * the feed request fails. */ getWarnings(countryCode: string): Promise; /** * Make a request with retry on transient failures (rate limit, server * error, timeout), exponential backoff with jitter — the NOAA client's * pattern. * @private */ private makeRequest; /** * Normalize API failures into plain sanitized `Error`s — never leak * internals; the alerts handler formats messages for users. * @private */ private handleError; /** Get cache statistics. */ getCacheStats(): import("../utils/cache.js").CacheStats; /** Clear the cache. */ clearCache(): void; } //# sourceMappingURL=meteoalarm.d.ts.map