On this page
Overview
Searches and loads Open-Meteo data into complete mutable Arcane weather entities.
- Artifact
OpenMeteoWeatherProvider.js· esm - Classification
public first party - Availability
Browser / native WebView / server with fetch + cloud - Normalization
Provider data normalized to entities; transport errors mixed.
Import and lifecycle
import * as module from '/arcane/modules/OpenMeteoWeatherProvider.js';
Construction creates two fetch-backed ApiModelDatabase instances and forwards their request/error events. search() and load() use Open-Meteo HTTPS by default; constructor and setEndpoints() can select caller-owned HTTP(S) endpoints. There is no global installation.
Application-facing behavior: Endpoint/event/error constants, default provider, mapForecast(); search/load methods, state-free EventTarget/on lifecycle compatibility, and dispose().
Protocol and host implementation
Open-Meteo HTTPS + per-realm globalThis.arcaneEvents authority This detail does not widen the application-facing API or grant authority.
Exports, signatures, parameters, and results
| Binding | Form | Declaration or signature | Parameter syntax |
|---|---|---|---|
OPEN_METEO_ENDPOINTS | variable · value | variable OPEN_METEO_ENDPOINTS | — |
OPEN_METEO_WEATHER_EVENTS | variable · value | variable OPEN_METEO_WEATHER_EVENTS | — |
OPEN_METEO_WEATHER_ERRORS | variable · value | variable OPEN_METEO_WEATHER_ERRORS | — |
default | default · class | class OpenMeteoWeatherProvider extends EventTarget | — |
mapForecast | function | function mapForecast(raw,location) | raw,location |
| Callable | Kind | Exact public signature | Parameter syntax |
|---|---|---|---|
mapForecast | exported-function | function mapForecast(raw,location) | raw,location |
| Member | Kind | Exact public declaration | Parameter syntax |
|---|---|---|---|
OpenMeteoWeatherProvider.constructor | constructor | constructor({
geocodingEndpoint=OPEN_METEO_ENDPOINTS.geocoding,
forecastEndpoint=OPEN_METEO_ENDPOINTS.forecast,
fetchImpl=globalThis.fetch
}={}) | {
geocodingEndpoint=OPEN_METEO_ENDPOINTS.geocoding,
forecastEndpoint=OPEN_METEO_ENDPOINTS.forecast,
fetchImpl=globalThis.fetch
}={} |
OpenMeteoWeatherProvider.addEventListener | method | addEventListener(type,listener,options) | type,listener,options |
OpenMeteoWeatherProvider.removeEventListener | method | removeEventListener(type,listener,options) | type,listener,options |
OpenMeteoWeatherProvider.on | method | on(type,listener,options) | type,listener,options |
OpenMeteoWeatherProvider.dispatchEvent | method | dispatchEvent(value) | value |
OpenMeteoWeatherProvider.setEndpoints | method | setEndpoints({geocoding,forecast}={}) | {geocoding,forecast}={} |
OpenMeteoWeatherProvider.search | async method | async search(query,optionsValue={}) | query,optionsValue={} |
OpenMeteoWeatherProvider.load | async method | async load(location,optionsValue={}) | location,optionsValue={} |
OpenMeteoWeatherProvider.emit | method | emit(type,detail={}) | type,detail={} |
OpenMeteoWeatherProvider.dispose | method | dispose() | — |
OpenMeteoWeatherProvider.destroy | method | destroy() | — |
Parameter meanings and results
OPEN_METEO_ENDPOINTS exposes the default geocoding/forecast URLs. new Provider({geocodingEndpoint?,forecastEndpoint?,fetchImpl?}); setEndpoints({geocoding?,forecast?}) returns effective endpoints; search(nonblankQuery,{signal?}) resolves the complete WeatherLocation[]; load(location,{temperatureUnit?,windSpeedUnit?,precipitationUnit?,forecastDays?,signal?}) resolves WeatherSnapshot; mapForecast(raw,location) returns WeatherSnapshot.
Events, side effects, and errors
Source-literal CustomEvent dispatches
No source-literal CustomEvent dispatch is part of this artifact.
Lifecycle and event flow
- weather-request
- weather-error
- weather-locations with {locations}
- weather-weather with {weather}
Direct coded failures
This artifact directly assigns no stable coded failure.
Exported Error subclasses
This artifact exports no Error subclass.
Documented failure behavior
- TypeError for a blank query or invalid Weather entity.
- Fetch/HTTP/parser errors propagate after weather-error notification.
Availability and capabilities
Browser / native WebView / server with fetch + cloud. Provider data normalized to entities; transport errors mixed.
None; default calls use public Open-Meteo fetch endpoints. A caller-selected endpoint owns its separate browser, CORS, and network-policy authority.
Contract example
import Weather from '/arcane/modules/OpenMeteoWeatherProvider.js';
const weather = new Weather();
const [place] = await weather.search('Chicago');
if (place) console.log(await weather.load(place));
Related reference
No direct Core call is claimed for this artifact. Any injected provider or consuming module retains its own documented authority.