/** * UnitRegistry — Runtime dimensional analysis and unit conversion. * * Provides a registry of physical dimensions and conversion factors. * Used at system boundaries to validate that user-supplied values * have compatible dimensions before entering the solver pipeline. * * All conversions target SI base units (kg, m, s, K, A, mol, cd). * * References: * BIPM SI Brochure (9th ed., 2019) * NIST SP 811 — Guide for the Use of the International System of Units */ import type { DimensionVector } from './PhysicalQuantity'; /** * Definition of a unit and its conversion to the SI base unit. */ export interface UnitDefinition { symbol: string; name: string; /** Dimension signature [kg, m, s, K, A, mol, cd] */ dimension: DimensionVector; /** Multiplier to convert to SI base unit */ scale: number; /** Additive offset to convert to SI base unit (e.g., for Celsius to Kelvin) */ offset: number; } export declare class DimensionalMismatchError extends Error { readonly fromSymbol: string; readonly toSymbol: string; readonly fromDimension: DimensionVector; readonly toDimension: DimensionVector; constructor(fromSymbol: string, toSymbol: string, fromDimension: DimensionVector, toDimension: DimensionVector); } export declare class UnitRegistry { private units; constructor(); register(unit: UnitDefinition): void; getUnit(symbol: string): UnitDefinition; /** * Convert a value from one unit to another. * Throws an error if the units are not dimensionally compatible. */ convert(value: number, fromSymbol: string, toSymbol: string): number; /** * Asserts that two units are dimensionally compatible. * Throws DimensionalMismatchError if they differ. */ assertCompatible(fromUnit: UnitDefinition, toUnit: UnitDefinition): void; /** * Check whether two unit symbols share the same physical dimension. */ isCompatible(fromSymbol: string, toSymbol: string): boolean; /** * Convert a value to SI base units from the given unit. */ toSI(value: number, fromSymbol: string): number; /** * Convert a value from SI base units to the given unit. */ fromSI(siValue: number, toSymbol: string): number; /** * List all registered unit symbols. */ listUnits(): string[]; /** * Register common standard units. */ private registerStandardUnits; } export declare const registry: UnitRegistry; //# sourceMappingURL=UnitRegistry.d.ts.map