export type MetricPrefix = '' | 'p' | 'n' | 'mc' | 'm' | 'c' | 'd' | 'da' | 'h' | 'k' | 'M' | 'G' | 'T' | 'f'; export type UnitMetric = 'g' | 'J' | 'K' | 'l' | 'm' | 'Pa' | 's' | 'S' | 'Hz' | 'V'; export type Units = 'dBHL' | 'dBASPL' | '%' | 'count' | 'IU' | 'appleEffortScore'; export type MeterUnit = `${Prefix}m`; export type LiterUnit = `${Prefix}l`; export type GramUnit = `${Prefix}g`; export type PascalUnit = `${Prefix}Pa`; export type SecondUnit = `${Prefix}s`; export type JouleUnit = `${Prefix}J`; export type HertzUnit = `${Prefix}Hz`; export type VoltUnit = `${Prefix}V`; export type SiemenUnit = `${Prefix}S`; export type MoleUnit = `mol<${MolarMass}>`; export type MoleUnitWith = `${Prefix}mol<${MolarMass}>`; export type FrequencyUnit = HertzUnit; /** * More SI prefixes also available as literals, just type the string * @example 'cm', 'km' */ export type UnitOfLength = 'ft' /** * More SI prefixes also available as literals, just type the string * @example 'cm', 'km' */ | 'm' | 'in' | 'yd' | 'mi'; export type LengthUnit = MeterUnit | UnitOfLength; /** * More SI prefixes also available as literals, just type the string * @example 'ml', 'cl' */ export type UnitOfVolume = 'cup_imp' | 'fl_oz_imp' | 'pt_imp' | 'cup_us' | 'fl_oz_us' | 'pt_us' /** * More SI prefixes also available as literals, just type the string * @example 'ml', 'cl' */ | 'l'; export type VolumeUnit = LiterUnit | UnitOfVolume; /** * More SI prefixes also available as literals, just type the string * @example 'mg', 'kg' */ export type UnitOfMass = 'oz' | 'st' | 'lb' /** * More SI prefixes also available as literals, just type the string * @example 'mg', 'kg' */ | 'g'; /** * More SI prefixes also available as literals, just type the string * @example 'mg', 'kg' */ export type MassUnit = GramUnit | UnitOfMass; /** * More SI prefixes also available as literals, just type the string * @example 'kPa', 'hPa' */ export type UnitOfPressure = 'atm' | 'cmAq' | 'mmHg' | 'inHg' | 'dBASPL' /** * More SI prefixes also available as literals, just type the string * @example 'kPa', 'hPa' */ | 'Pa'; /** * More SI prefixes also available as literals, just type the string * @example 'kPa', 'hPa' */ export type PressureUnit = PascalUnit | UnitOfPressure; /** * More SI prefixes also available as literals, just type the string * @example 'ms' */ export type UnitOfTime = 'd' | 'min' | 'hr' /** * More SI prefixes also available as literals, just type the string * @example 'ms' */ | 's'; /** * More SI prefixes also available as literals, just type the string * @example 'ms' */ export type TimeUnit = SecondUnit | UnitOfTime; export type TemperatureUnit = 'degC' | 'degF' | 'K'; /** * More SI prefixes also available as literals, just type the string * @example 'kJ' */ export type UnitOfEnergy = 'kcal' | 'Cal' | 'cal' | 'J'; export type EnergyUnit = JouleUnit | UnitOfEnergy; export type BloodGlucoseUnit = 'mmol<180.15588000005408>/l' | 'mg/dL'; export type SpeedUnit = `${TLength}/${TTime}`; export type CountPerTime = `count/${TTime}`; export type Unit = BloodGlucoseUnit | CountPerTime | EnergyUnit | FrequencyUnit | Units | LengthUnit | MassUnit | PressureUnit | SpeedUnit | TemperatureUnit | TimeUnit | VolumeUnit; export interface IdentifierWithUnit { typeIdentifier: string; unit: string; }