/** * Temperature units + pure conversion/formatting helpers. * * Framework-agnostic and product-agnostic — nothing here knows about any * particular story, Reuters, or Svelte. This is the foundation the rest of the * toolkit (detection, storage, the reactive state and the components) builds on. */ /** A temperature display unit. */ export type TemperatureUnit = 'celsius' | 'fahrenheit'; /** The known units, in a stable order (Celsius first). */ export declare const TEMPERATURE_UNITS: readonly ["celsius", "fahrenheit"]; /** Narrowing type guard for untrusted input (events, storage, attributes). */ export declare function isTemperatureUnit(value: unknown): value is TemperatureUnit; /** The "other" unit — handy for toggles. */ export declare function otherUnit(unit: TemperatureUnit): TemperatureUnit; /** * Convert an absolute temperature in Celsius to the target unit. * * @param celsius - Temperature in degrees Celsius. * @param unit - Target display unit. */ export declare function convertTemperature(celsius: number, unit: TemperatureUnit): number; /** * Convert a temperature *delta* (a difference/anomaly) in Celsius to the target * unit. Deltas scale by 9/5 only — no +32 offset. */ export declare function convertDelta(celsius: number, unit: TemperatureUnit): number; /** Options for the string formatters. */ export interface FormatOptions { /** Decimal places (default 0). */ digits?: number; /** Append the degree suffix (default true). */ suffix?: boolean; /** Include the degree ring in the suffix (default true → `°F`, else `F`). */ degree?: boolean; } /** The degree suffix for a unit, e.g. `°F` (or `F` with `degree: false`). */ export declare function unitSuffix(unit: TemperatureUnit, { degree }?: Pick): string; /** Format an absolute temperature: convert, round, and (optionally) suffix. */ export declare function formatTemperature(celsius: number, unit: TemperatureUnit, { digits, suffix, degree }?: FormatOptions): string; /** * Format a temperature delta with an explicit sign (e.g. `+3°F`, `−2°C`). Uses a * true minus sign (U+2212) for typographic parity with the plus. */ export declare function formatDelta(celsius: number, unit: TemperatureUnit, { digits, suffix, degree }?: FormatOptions): string;