import { type UnitConfig } from './config'; import { type TemperatureUnit } from './units'; /** Construction options: any {@link UnitConfig} field plus an explicit seed. */ export type UnitStateOptions = Partial & { /** Force the initial unit (e.g. an explicit SSR value). */ initial?: TemperatureUnit; }; export declare class TemperatureUnitState { #private; /** The active unit. Reactive — reading it in markup/`$derived` auto-updates. */ current: TemperatureUnit; /** Resolved configuration (names/knobs). */ readonly config: UnitConfig; constructor(options?: UnitStateOptions); /** Set the unit explicitly: persist, update the attribute, notify others. */ set(unit: TemperatureUnit): void; /** Flip to the other unit and persist. */ toggle(): void; /** Remove the window listener (teardown for tests/short-lived hosts). */ destroy(): void; /** Degree suffix for the active unit, e.g. `°F`. */ get suffix(): string; /** Convert an absolute Celsius value to the active unit. */ toDisplay(celsius: number): number; /** Convert a Celsius delta (anomaly) to the active unit. */ toDisplayDelta(celsius: number): number; } /** Provide a state instance to descendants via Svelte context. */ export declare function setUnitContext(state: TemperatureUnitState): TemperatureUnitState; /** * Read the nearest provided state, falling back to the shared default singleton * when no provider is present (so the components work with zero setup). */ export declare function getUnitContext(): TemperatureUnitState; /** Shared, app-wide state used when no context provider is set. */ export declare const defaultUnitState: TemperatureUnitState;