import { Unit } from './Unit.ts'; import { BaseUnitDefinition, DerivedUnitDefinition, FactorDefinition } from './types'; export type BaseUnitsOf = S extends UnitSystem ? U : never; export type FactorsOf = S extends UnitSystem ? F : never; export type DerivedUnitsOf = S extends UnitSystem ? D : never; export declare class UnitSystem>, F extends Record>, D extends Record>> { readonly baseUnits: U; readonly factors: F; readonly derivedUnits: D; constructor(baseUnits: U, factors: F, derivedUnits: D); /** * Given a factor definition, tries to find a corresponding symbol for it. * @example * SI.getFactorSymbol({ mul: 1, base: 10, exp: 3 }) // "k" * IEC.getFactorSymbol({ mul: 1, base: 2, exp: 20 }) // "Mi" */ getFactorSymbol(f: FactorDefinition): (string & keyof F) | undefined; getNearestLowerFactor(needle: FactorDefinition): { factor: keyof F; ratio: number; }; createUnit(baseUnit: Unit['baseUnits'], factor?: FactorDefinition | keyof F): Unit; parseUnit(text: string): Unit; }