Skip to content

Commit

Permalink
fix: update UnitConversionRate type and create UnknownUnitConversionR…
Browse files Browse the repository at this point in the history
…ate type
  • Loading branch information
RebeccaStevens committed Aug 11, 2023
1 parent 25c65b9 commit ee942be
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ export type UnitFrom<
*
* @group Unit Generators
*/
export type UnitConversionRate<M extends UnitSubvalues> = Unit<{}, M>;
export type UnitConversionRate<M extends UnitSubvalues> = number & {
readonly __uom_types__unit_meta: UnitMeta<M>;
};

/**
* Create a {@link UnitConversionRate} from already existing {@link UnitMeta}.
Expand Down Expand Up @@ -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.
*
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export type {
UnknownAbstractUnit,
UnknownUnit,
UnknownUnitClass,
UnknownUnitConversionRate,
UnknownUnitMeta,
} from "./core";
export type {
Expand Down

0 comments on commit ee942be

Please sign in to comment.