From ee942bed8a8c31101474c28f92b1cfede2f9d629 Mon Sep 17 00:00:00 2001 From: Rebecca Stevens Date: Fri, 11 Aug 2023 21:58:30 +1200 Subject: [PATCH] fix: update UnitConversionRate type and create UnknownUnitConversionRate type --- src/core.ts | 13 ++++++++++++- src/index.ts | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/core.ts b/src/core.ts index f902e077..6e71aeb8 100644 --- a/src/core.ts +++ b/src/core.ts @@ -58,7 +58,9 @@ export type UnitFrom< * * @group Unit Generators */ -export type UnitConversionRate = Unit<{}, M>; +export type UnitConversionRate = number & { + readonly __uom_types__unit_meta: UnitMeta; +}; /** * Create a {@link UnitConversionRate} from already existing {@link UnitMeta}. @@ -107,6 +109,15 @@ export type UnknownAbstractUnit = number & { readonly __uom_types__unit_class: UnknownUnitClass; }; +/** + * An {@link UnitConversionRate} that we don't know anything about. + * + * @group Unknown Units + */ +export type UnknownUnitConversionRate = number & { + readonly __uom_types__unit_meta: UnknownUnitMeta; +}; + /** * A {@link UnitClass} that we don't know anything about. * diff --git a/src/index.ts b/src/index.ts index 533edde7..4207d926 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,6 +15,7 @@ export type { UnknownAbstractUnit, UnknownUnit, UnknownUnitClass, + UnknownUnitConversionRate, UnknownUnitMeta, } from "./core"; export type {