@itwin/core-frontend
Version:
iTwin.js frontend components
38 lines • 1.67 kB
TypeScript
/** @packageDocumentation
* @module QuantityFormatting
*/
import { UnitConversionProps, UnitProps, UnitsProvider } from "@itwin/core-quantity";
/** Units provider that provides a limited number of UnitDefinitions that are needed to support basic tools.
* @internal
*/
export declare class BasicUnitsProvider implements UnitsProvider {
/** Find a unit given the unitLabel. */
findUnit(unitLabel: string, schemaName?: string, phenomenon?: string, unitSystem?: string): Promise<UnitProps>;
/** Find all units given phenomenon */
getUnitsByFamily(phenomenon: string): Promise<UnitProps[]>;
protected findUnitDefinition(name: string): UnitDefinition | undefined;
/** Find a unit given the unit's unique name. */
findUnitByName(unitName: string): Promise<UnitProps>;
/** Return the information needed to convert a value between two different units. The units should be from the same phenomenon. */
getConversion(fromUnit: UnitProps, toUnit: UnitProps): Promise<UnitConversionProps>;
}
/** interface use to define unit conversions to a base used for a phenomenon */
interface ConversionDef {
numerator: number;
denominator: number;
offset: number;
}
interface UnitDefinition {
readonly name: string;
readonly phenomenon: string;
readonly displayLabel: string;
readonly altDisplayLabels?: string[];
readonly conversion: ConversionDef;
readonly system: string;
}
/** Function to generate default set of alternate unit labels
* @internal
*/
export declare function getDefaultAlternateUnitLabels(): Map<string, Set<string>> | undefined;
export {};
//# sourceMappingURL=BasicUnitsProvider.d.ts.map