UnitsProvider Interface

This interface is implemented by the class that is responsible for locating units by name or label and providing conversion values between units. The methods to be implemented are async allowing the UnitsProvider to query the backend when necessary to look up unit definition and conversion rules.

Methods

Name Description
findUnit(unitLabel: string, schemaName?: string, phenomenon?: string, unitSystem?: string): Promise<UnitProps>    
findUnitByName(unitName: string): Promise<UnitProps>    
getConversion(fromUnit: UnitProps, toUnit: UnitProps): Promise<UnitConversionProps>    
getUnitsByFamily(phenomenon: string): Promise<UnitProps[]>    

Defined in

Last Updated: 15 March, 2024