import { type EnvironmentField, type EnvironmentFieldConfig } from "./envField.js"; import { type WindFieldConfig, type WindVector } from "./wind.js"; /** Wind is metres/second along world X,Z; world Y points up. Times are simulation seconds. */ export type AuthoredWeatherMode = "clear" | "rain" | "snow" | "mixed" | "dust"; /** Precipitation intensity, temperature offset in degrees, and normalized lightning brightness. */ export interface WeatherConditions { mode: AuthoredWeatherMode; intensity: number; temperatureOffset?: number; lightning?: number; } /** A named set of conditions referenced by the authored schedule. */ export interface AuthoredWeatherProfile extends WeatherConditions { id: string; } /** An absolute simulation-time profile change with an optional continuous blend. */ export interface AuthoredWeatherTransition { atSeconds: number; profileId: string; transitionSeconds?: number; } /** A local weather override and additive wind source centered in world X,Z metres. */ export interface AuthoredWeatherZone { id: string; center: readonly [number, number]; radius: number; /** Blend distance outside the radius, in metres. */ falloff?: number; weather?: WeatherConditions; wind?: WindFieldConfig; /** Local wind points outward from the center; it adds to ambient wind. */ radial?: boolean; } /** Serializable weather lists capped at 256 entries. Wind amplitudes and direction components are bounded to 1e6, gust frequency to 1000 Hz; coordinates and times to 1e12 metres/seconds. */ export interface AuthoredWeatherConfig { ambient?: WeatherConditions; profiles?: readonly AuthoredWeatherProfile[]; initialProfileId?: string; /** Ordered absolute times, relative to the simulation clock. */ schedule?: readonly AuthoredWeatherTransition[]; wind?: WindFieldConfig; /** Later weather zones blend over earlier ones; wind zones add to ambient wind. */ zones?: readonly AuthoredWeatherZone[]; } /** Resolved conditions and wind at a world point and absolute simulation time. */ export interface AuthoredWeatherSample extends WeatherConditions { timeSeconds: number; wind: WindVector; precipitation: number; rain: number; snow: number; dust: number; } /** Pure spatial weather queries using the caller’s authoritative simulation clock. */ export interface AuthoredWeather { sample(x: number, z: number, timeSeconds: number): AuthoredWeatherSample; } /** Validate authoring references and work bounds before persisting a weather document. * @capability authored-weather-validation Reject invalid weather profiles, schedules, zones and wind before authoring mutations. */ export declare function validateAuthoredWeather(config: AuthoredWeatherConfig): void; /** Pure authored weather sampling; the caller's simulation clock owns pause, replay and restore. * @capability authored-weather Sample scheduled precipitation and local wind from one authored document and simulation clock. */ export declare function createAuthoredWeather(source?: AuthoredWeatherConfig): AuthoredWeather; /** Surface capacity and normalized wetting, drying, snowfall and melting rates per second. */ export interface WeatherExposureConfig { maxSurfaces?: number; /** Accumulation and drying rates in normalized coverage/second. */ wettingRate?: number; dryingRate?: number; snowRate?: number; meltRate?: number; } /** A stable surface id and world X,Z position with explicit sky exposure and temperature. */ export interface WeatherExposureSurface { id: string; x: number; z: number; /** Fraction of open sky; 0 means fully sheltered. */ exposure?: number; /** Degrees above zero melt snow; omitted uses the weather temperature offset. */ temperature?: number; } /** Retained normalized wetness and snow coverage, temperature, and sky exposure. */ export interface WeatherExposureSample { wetness: number; snow: number; heat: number; exposure: number; } /** Detached accumulation values keyed by retained surface id. */ export interface WeatherExposureSnapshot { surfaces: { id: string; value: WeatherExposureSample; }[]; } /** Injected persistence for detached surface accumulation snapshots. */ export interface WeatherExposureStorage { read(): WeatherExposureSnapshot | undefined; write(snapshot: WeatherExposureSnapshot): void; } /** Bounded surface accumulation with restoration, live rate tuning and explicit release. */ export interface WeatherExposure { step(dt: number, timeSeconds: number, surfaces: readonly WeatherExposureSurface[], weather: AuthoredWeather): void; sample(id: string): WeatherExposureSample | null; forget(id: string): void; snapshot(): WeatherExposureSnapshot; restore(state: WeatherExposureSnapshot): void; retune(config: WeatherExposureConfig): void; } /** Bounded surface accumulation shared by gameplay and material adapters, with injected persistence. * @capability weather-surface-accumulation Persist and retune bounded surface wetness, snow, temperature and exposure independently of rendering. */ export declare function createWeatherExposure(config?: WeatherExposureConfig, storage?: WeatherExposureStorage): WeatherExposure; /** Environment temperature, sunlight and shelter read the same authored precipitation as rendering. * @capability weather-environment-field Connect authored precipitation and temperature changes to spatial environment queries. */ export declare function createWeatherEnvironmentField(weather: AuthoredWeather, config?: Omit): EnvironmentField;